tls: Thermal-load-sensitivity quantities (z, CTmax) with...

View source: R/tls.R

tlsR Documentation

Thermal-load-sensitivity quantities (z, CTmax) with confidence intervals

Description

The frequentist analogue of bayesTLS::tls(). Reads a fit_4pl() (freq_tls) fit and returns the headline thermal-load-sensitivity quantities — thermal sensitivity z and CTmax — as point estimates with confidence intervals, one row per group when the fit is grouped. CTmax is the critical thermal maximum at reference time tref; z is thermal sensitivity in degrees per decade of duration. The default target is relative, the curve midpoint; absolute requests a specified survival proportion. Relative requests use profile-likelihood intervals by default (or Wald / bootstrap via method), while absolute requests use bootstrap refits.

Usage

tls(
  object,
  by = NULL,
  params = "all",
  target_surv = "relative",
  lethal = FALSE,
  method = NULL,
  level = 0.95,
  nboot = 1000L,
  TC_rate_range = c(0.1, 1),
  seed = NULL,
  mode = NULL,
  p = NULL,
  ...
)

tls_z(object, ...)

tls_ctmax(object, ...)

tls_tcrit(object, ...)

Arguments

object

A freq_tls fit from fit_4pl() (or a bare profile_tls fit from fit_tls()).

by

Optional name or names of the grouping columns in ⁠$summary⁠; defaults to the fit's moderator (e.g. the ctmax/z/by factor).

params

"all" (z and CTmax, the default, plus T_crit when lethal = TRUE), or any combination of "z", "ctmax", and "tcrit". An explicit quantity vector determines exactly which quantities are returned. Selecting "tcrit" requests the bootstrap-derived T_crit quantity, but requires lethal = TRUE because T_crit assumes a lethal endpoint. This selects the returned headline quantities; use tdt_parameter_table() or get_shape() for low, up, and k.

target_surv

Survival threshold for CTmax: "relative" (the curve midpoint, the default), "absolute" (50% survival), or a number in ⁠(0, 1)⁠ for an LTx. An absolute target must lie strictly between the fitted asymptotes for every reported group. Absolute targets and a requested T_crit are derived per bootstrap replicate via extract_tdt().

lethal

A single non-missing logical value. If TRUE, declare a lethal endpoint so T_crit can be requested; params = "all" then includes T_crit. When params is an explicit quantity vector, only those quantities are returned. T_crit uses the bootstrap path. Setting lethal = TRUE alone does not request draws; select T_crit, request an absolute target, or set method = "bootstrap".

method

Interval method for relative requests: "profile" (default, from the fit's stored default), "wald", or "bootstrap". Absolute targets and requested T_crit use bootstrap; a relative request for other quantities follows method.

level

Confidence level (default 0.95).

nboot, seed

Number of bootstrap replicates and optional random seed. Used for draw-level extraction and bootstrap interval calculations. Percentile limits are reported only with at least 20 usable refits. The explicit bootstrap extraction path returns its converged draws and requested/converged/failed counts; automatic fallback from a relative profile request returns interval limits, method, and status only.

TC_rate_range

Passed to extract_tdt() for T_crit.

mode, p

Legacy bayesTLS aliases. mode = "relative" maps to the relative target and cannot be combined with p; mode = "absolute" maps to p or 0.5. If mode is omitted, p alone supplies the absolute target. Do not combine these aliases with target_surv.

...

Recognized Bayesian-only arguments are rejected with guidance when freqTLS cannot honor them. Unknown names also raise an explicit error.

Value

A tls object with ⁠$summary⁠ (⁠[<group>,] quantity, median, lower, upper⁠) and ⁠$meta⁠. The threshold in ⁠$meta$mode⁠ applies to CTmax and T_crit. ⁠$meta$z_definition⁠ describes z as relative-midpoint thermal sensitivity. The explicit bootstrap extraction path also returns ⁠$draws⁠. When confint.profile_tls() supplies intervals, ⁠$meta$methods⁠ and ⁠$meta$conf.status⁠ record each parameter's method and status. Printed summaries show those details when methods are mixed or a status is not successful. Bootstrap summaries also report requested, converged, and failed refits and identify quantities whose percentile limits were withheld.

See Also

fit_4pl(), tls_z(), tls_ctmax(), confint.profile_tls()

Examples

raw <- simulate_tls(family = "binomial", times = c(30, 60, 120, 240, 480),
                    CTmax = 36, z = 4, tref = 60, seed = 1)
dat <- standardize_data(
  raw, temp = "temp", duration = "duration",
  n_total = "total", n_surv = "survived", duration_unit = "minutes"
)
fit <- fit_4pl(
  dat, family = "binomial", t_ref = 60, method = "wald", quiet = TRUE
)
tls(fit)
tls_z(fit)
tls_ctmax(fit)

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