Description Usage Arguments Value References Examples

Calculates lethal concentration (LC) and its fiducial confidence limits (CL) using a logit analysis according to Finney 1971, Wheeler et al. 2006, and Robertson et al. 2007.

1 2 3 4 5 |

`formula` |
an object of class |

`data` |
an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula), typically the environment from which |

`p` |
Lethal Concentration (LC) values for given p, example will return a LC50 value if p equals 50. If more than one LC value wanted specify by creating a vector. LC values can be calculated down to the 1e-16 of a percentage (e.g. LC99.99). However, the tibble produced can round to nearest whole number. |

`weights` |
vector of 'prior weights' to be used in the fitting process. Only needs to be supplied if you are taking the response / total for your response variable within the formula call of |

`subset` |
allows for the data to be subseted if desired. Default set to |

`log_base` |
default is |

`log_x` |
default is |

`het_sig` |
significance level from person's chi square goodness-of-fit test that is used to decide if a heterogeneity factor is used. |

`conf_level` |
adjust confidence level as necessary or |

`conf_type` |
default is |

`long_output` |
default is |

Returns a tibble with predicted LC for given p level, lower CL (LCL), upper CL (UCL), Pearson's chi square goodness-of-fit test (pgof), slope, intercept, slope and intercept p values and standard error, and LC variance.

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: 9780849323317

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | ```
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_logit((response / total) ~ log10(dose), p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"))
# OR
m1 <- LC_logit(cbind(response, survive) ~ log10(dose), p = c(50, 99),
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "May"))
# view calculated LC50 and LC99 for seasonal toxicity of a pisicide,
# to lamprey in 2011
m
# they are the same
m1
# dose-response curve can be plotted using 'ggplot2'
# Uncomment the below lines to run create plots
# library(ggplot2)
# lc_may <- subset(lamprey_tox, month %in% c("May"))
# p1 <- ggplot(data = lc_may[lc_may$nominal_dose != 0, ],
# aes(x = log10(dose), y = (response / total))) +
# geom_point() +
# geom_smooth(method = "glm",
# method.args = list(family = binomial(link = "logit")),
# aes(weight = total), colour = "#FF0000", se = TRUE)
# p1
# calculate LC50s and LC99s for multiple toxicity tests, June, August, and September
j <- LC_logit((response / total) ~ log10(dose), p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "June"))
a <- LC_logit((response / total) ~ log10(dose), p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "August"))
s <- LC_logit((response / total) ~ log10(dose), p = c(50, 99),
weights = total,
data = lamprey_tox[lamprey_tox$nominal_dose != 0, ],
subset = c(month == "September"))
# group results together in a dataframe to plot with 'ggplot2'
results <- rbind(m[, c(1, 3:8, 11)], j[,c(1, 3:8, 11)],
a[, c(1, 3:8, 11)], s[, c(1, 3:8, 11)])
results$month <- factor(c(rep("May", 2), rep("June", 2),
rep("August", 2), rep("September", 2)),
levels = c("May", "June", "August", "September"))
# p2 <- ggplot(data = results, aes(x = month, y = dose,
# group = factor(p), fill = factor(p))) +
# geom_col(position = position_dodge(width = 0.9), colour = "#000000") +
# geom_errorbar(aes(ymin = LCL, ymax = UCL),
# size = 0.4, width = 0.06,
# position = position_dodge(width = 0.9))
# p2
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.