derive_lt: Derive the lethal / survival-threshold duration at a...

View source: R/predict.R

derive_ltR Documentation

Derive the lethal / survival-threshold duration at a temperature

Description

derive_lt() solves the fitted four-parameter curve for the duration at which survival crosses a target probability p at each requested temperature (an "LT" / lethal- time-style quantity, e.g. p = 0.5 gives the absolute 50% survival time). To obtain the curve's relative midpoint, use p = (low + up) / 2; that crossing has log10(duration) = mid exactly.

Usage

derive_lt(object, p = 0.5, temp, group = NULL)

Arguments

object

A profile_tls fit from fit_tls() or a freq_tls workflow fit.

p

Absolute target survival probability in ⁠(low, up)⁠ (default 0.5); either one value or one value per temperature.

temp

Numeric temperature(s) at which to solve. If p is a vector, it must have the same length as temp.

group

Optional single group level (grouped fits only). Required when the fit is grouped.

Details

The selected curve maps the normalized fraction (p - low) / (up - low) back to eta = k * (log10(duration) - mid). The log-logistic, log-normal, and both Weibull curves use their own inverse map; all return log10(duration) relative to the common midpoint. The target must lie strictly between low and up for a finite crossing; otherwise the survival curve never reaches p and derive_lt() aborts with an explanatory message (confidence-language, never silent). A vector of p values may be supplied, one for each temperature. Temperature- varying shape formulas and a freq_tls workflow fit are supported. For a random-effects fit this is a population-level derived quantity; it does not add a group BLUP (best linear unbiased predictor; see ranef()).

Value

A numeric vector of durations (same length as temp) in the fitted duration unit; standardize_data() fits use minutes.

Examples

d <- simulate_tls(family = "binomial", times = c(30, 60, 120, 240, 480),
                  CTmax = 36, z = 4, tref = 60, seed = 1)
fit <- fit_tls(d, y = survived, n = total, time = duration, temp = temp,
               family = "binomial", tref = 60)
# Absolute 50% survival duration at 36 C:
derive_lt(fit, p = 0.5, temp = 36)


freqTLS documentation built on Dec. 4, 2026, 5:11 p.m.