ecotox
Overview
'ecotox' was created as simple approach to using either probit or logit analysis to calculate lethal concentration (LC) or time (LT) and the appropriate fiducial confidence limits desired for selected LC or LT for ecotoxicology studies (Finney 1971; Wheeler et al. 2006; Robertson et al. 2007). The simplicity of 'ecotox' comes from the syntax it implies within its functions which are similar to functions like glm() and lm(). In addition to the simplicity of the syntax, a comprehensive tibble is produced which gives the user a predicted LC or LT value for the desired level and a suite of parameters such as fiducial confidence limits, z-value, and slope. 'ecotox' was built for and is published in Hlina et al. In Review.
Installation
You can install the CRAN released version of 'ecotox' from CRAN with:
install.packages("ecotox")
You can install the developer version of 'ecotox' from github with:
install.packages("devtools")
devtools::install_github("benjaminhlina/ecotox")
Example
This is an example which uses the LC_probit function to calculate a LC50 and LC99 for a probit analysis :
## Calculate LC50 and LC99
head(lamprey_tox)
## within the dataframe used, control dose, unless produced a value
## during experimentation, are removed from the dataframe,
## as glm cannot handle values of infinite. Other statistical programs
## make note of the control dose but do not include within analysis.
## calculate LC50 and LC99 for May
m <- LC_probit((response / total) ~ log10(dose),
p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"))
## view calculated LC50 and LC99 for seasonal toxicity of a pisicide,
## 3-trifluoromethyl-4-nitrophenol (TFM) to lamprey in 2011
m
## several new features include 1) being able to change the output length
## 2) you can indicate whether the x variable has been log10 transformed or
## not if it has the output will take that into consideration
m_2 <- LC_probit((response / total) ~ dose,
p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"),
log_x = FALSE,
long_output = FALSE)
## view calculated LC50 and LC99 for seasonal toxicity of a pisicide,
## 3-trifluoromethyl-4-nitrophenol (TFM) to lamprey in 2011.
m_2
## A new function `ratio_test` has been added
# view lamprey_tox data
head(lamprey_tox)
# using glm() to detemine LC values using probit model for May and June
m <- glm((response / total) ~ log10(dose),
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"),
weights = total,
family = binomial(link = "probit"))
j <- glm((response / total) ~ log10(dose),
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "June"),
weights = total,
family = binomial(link = "probit"))
# now that both May and June models have been made. use ratio_test to
# compare LC50 values or whatever LC values of interest.
ratios <- ratio_test(model_1 = m, model_2 = j,
percentage = 50,
compare = "May - June")
# view ratio test results
ratios
References
Finney, D.J., 1971. Probit analysis. Cambridge University Press, Cambridge, England. ISBN: 052108041X
Wheeler, M.W., Park, R.M., and Bailey, A.J. 2006. Comparing median lethal concentration values using confidence interval overlap or ratio tests. Environ. Toxic. Chem. 25(5), 1441-1444. 10.1897/05-320R.1
Robertson, J.L., Savin, N.E., Russell, R.M. and Preisler, H.K., 2007. Bioassays with arthropods. CRC press. ISBN: 0849323312
Citation
When using this package please cite the following publication:
Hlina, B.L., Birceanu, O., Robinson, C.S., Dhiyebi, H., Wilkie, M.P. In Reivew. Seasonal Variation in the Sensitivity of Invasive Sea Lampreys to the Lampricide TFM: Importance of Energy Reserves and Temperature. North American Journal of Fisheries Management.
Version 1.4.1 written by Benjamin L. Hlina, Carleton University, Ottawa, Ontario, Canada. Written in 'Programming Language R', version 3.6.1 (2019-07-05) -- "Action of the Toes". Source code is available at 'ecotox' or by contacting Benjamin L. Hlina at benjamin.hlina@gmail.com