get_tls_est: Extract TLS estimates (draws or summary) from a 'tls' object

View source: R/accessors.R

get_tls_estR Documentation

Extract TLS estimates (draws or summary) from a tls object

Description

Pulls the posterior draws or the summary (median + 95% credible interval) for any or all thermal-load-sensitivity quantities (z, CTmax, and, when the fit was extracted with lethal = TRUE, Tcrit) from a tls() result. Draws are returned in tidy-long form (quantity, .draw, value, plus any grouping column), so a posterior contrast is a join on .draw followed by a difference of value.

Usage

get_tls_est(x, what = c("summary", "draws"), params = NULL)

Arguments

x

A tls object, the result of tls().

what

Either "summary" (the default; median + lower/upper per quantity x group) or "draws" (one row per posterior draw per quantity x group).

params

Optional character vector selecting quantities to return, matched case-insensitively against "z", "CTmax", "Tcrit". NULL (default) returns all available quantities.

Value

A tibble. For what = "summary": columns quantity, median, lower, upper (plus grouping columns for a grouped fit). For what = "draws": columns quantity, .draw, value (plus grouping columns).

See Also

tls(), which produces the object this reads.

Examples

## Not run: 
fit <- fit_4pl(standardize_data(my_data, temp = "temp", duration = "time",
                                n_total = "n", n_dead = "dead"))
est <- tls(fit, lethal = TRUE)
get_tls_est(est, "summary")             # all quantities: median + 95% CrI
zd  <- get_tls_est(est, "draws", "z")   # z draws, ready for a contrast

## End(Not run)

bayesTLS documentation built on Nov. 29, 2026, 1:06 a.m.