| ts_stage1 | R Documentation |
Fits a separate logistic dose-response curve at each assay temperature and
reads off log10(LT50) (the duration at 50% survival). The binomial family
uses stats::glm; the beta-binomial family uses
glmmTMB::glmmTMB with a betabinomial family (overdispersion at Stage 1).
ts_stage1(
data,
temp = "temp",
duration = "duration",
n_surv = "n_surv",
n_total = "n_total",
family = c("binomial", "betabinomial")
)
data |
Data frame with one row per (temperature, duration) replicate. |
temp, duration, n_surv, n_total |
Column names (strings) for assay temperature (°C), exposure duration, survivors, and trials. |
family |
|
Two validity flags are returned so callers can choose their own success rule:
finite_ok (finite coefficients, negative non-trivial slope) and bracket_ok
(the fitted LT50 lies within the observed duration range, padded by 0.5 on the
log10 scale). stage1_ok is their conjunction.
A tibble with one row per temperature: temp, log10_lt50,
se_log10_lt50, slope, phi (beta-binomial precision, else NA),
finite_ok, bracket_ok, stage1_ok.
d <- simulate_tls(
family = "binomial", temps = seq(30, 42, by = 2),
times = c(0.01, 0.03, 0.1, 0.3, 1, 3, 10, 30, 100),
reps = 4, n = 50, CTmax = 36, z = 4, seed = 42
)
ts_stage1(d, "temp", "duration", "survived", "total", family = "binomial")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.