tidy_parameters: Tidy the parameters of a fitted freqTLS model

View source: R/extract.R

tidy_parametersR Documentation

Tidy the parameters of a fitted freqTLS model

Description

tidy_parameters() returns a broom-style tibble with one row for each fitted parameter or fixed-effect coefficient and optional Wald confidence intervals. Constant and one-hot shape designs report natural-scale shape estimates. General shape designs report their regression coefficients on the fitted link scale because a slope has no natural-scale back-transform. Wald intervals for natural-scale parameters are computed on the internal (link) scale as ⁠estimate +/- z * std.error⁠ and then back-transformed to the natural scale, so they respect each parameter's bounds (for example z > 0, ⁠0 < low < up⁠) and are equivariant under the link. For CTmax (identity link) this is the usual symmetric Wald interval.

Usage

tidy_parameters(
  fit,
  conf.int = TRUE,
  conf.level = 0.95,
  method = c("wald", "profile")
)

Arguments

fit

A profile_tls fit from fit_tls().

conf.int

Logical; include conf.low / conf.high columns (default TRUE).

conf.level

Confidence level for the interval (default 0.95).

method

Either "wald" (default) or "profile".

Details

With method = "profile" the intervals are profile-likelihood confidence intervals (see confint.profile_tls()); with method = "wald" (default) they are back-transformed for natural-scale parameters and remain on the fitted link scale for general shape coefficients. The returned shape is identical; only interval_type and the interval values differ. A profile that does not close returns NA on the open side (never a fabricated bound).

Value

A tibble with one row per fitted parameter and columns parameter, group, estimate, std.error, conf.low, conf.high, interval_type, and scale. scale describes displayed values: "natural" for response-scale parameters, or the fitted link ("identity", "log", or "logit") for general coefficients. General low, up, and k coefficients and their Wald limits are both on the fitted link scale. Covariate-model z rows are exponentiated multipliers and are reported on the natural scale. interval_type is "wald", "profile", "fixed" for exact fitted asymptotes, or "none" when confidence intervals were not requested.

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)
tidy_parameters(fit)
tidy_parameters(fit, method = "profile")


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