| confint.profile_tls | R Documentation |
confint() returns confidence intervals for the natural-scale parameters of a
fit_tls() model. Three methods are available:
## S3 method for class 'profile_tls'
confint(
object,
parm = NULL,
level = 0.95,
method = c("profile", "wald", "bootstrap"),
npoints = 30L,
trace = FALSE,
fallback = TRUE,
nboot = 1000L,
boot_seed = NULL,
cores = 1L,
...
)
object |
A |
parm |
Character vector of target names (for example |
level |
Confidence level (default |
method |
One of |
npoints |
Number of grid points used per profile (default |
trace |
Logical; print inner-optimisation progress (profile/bootstrap). |
fallback |
Logical; when |
nboot |
Number of bootstrap replicates for |
boot_seed |
Optional integer seed making the bootstrap reproducible
without disturbing the caller's random stream (default |
cores |
Number of CPU cores for the bootstrap refits (default |
... |
Reserved; must be empty. |
method = "profile" (default) computes profile-likelihood confidence
intervals by inverting the likelihood-ratio test: the interval is
{psi : D(psi) <= qt(1 - alpha/2, df)^2}, found by stats::uniroot() on each
side of the MLE on the unconstrained internal coordinate, with the endpoints
transformed to the natural scale. The cutoff is the squared profile-t
quantile on df = n - p residual degrees of freedom (Bates-Watts profile-t),
not qchisq(level, 1); the two coincide as df -> Inf. These intervals are
prior-free and respect asymmetry. They are equivariant under monotone
reparameterisation, so the z interval equals exp() of the internal
log_z interval.
method = "wald" reuses the Phase-2 Wald path: estimate +/- t * se (with
t = qt(1 - alpha/2, df) on df = n - p) on the internal (link) scale,
back-transformed.
method = "bootstrap" returns prior-free parametric-bootstrap percentile
intervals: responses are regenerated at the observed design from the fitted
mean and response family, the model is refitted nboot times, and the interval is the
percentile range of the replicate estimates. This is a frequentist
resampling interval, not a posterior or credible interval. A finite interval
requires at least 20 usable refits; otherwise limits are NA with
conf.status = "bootstrap_unstable".
When a fixed-effects profile does not close on one side, or the fitted Hessian
is not positive definite (pdHess = FALSE), confint() attempts a parametric
bootstrap for the affected parameters (with a message). For random-effects
fits, these conditions route profiled fixed effects to Wald intervals; variance
components also use Wald intervals. The explicit method = "bootstrap" option
performs random-effects-aware refits. Either fallback can still return NA
when its interval is unavailable. Set fallback = FALSE to keep
the strict profile behaviour, which returns NA on
the open side (never a fabricated bound) with a warning that the parameter is
weakly identified (see vignette("profile-likelihood")). The upper asymptote up has its own
coordinate beta_up under disjoint bounds but is not yet profiled, so it is
reported with the delta-method Wald interval under the profile/Wald methods,
with a message.
For a fit with a random intercept (CTmax ~ <fixed> + (1 | group)),
method = "profile" profiles the fixed-effect coordinates by re-running the
Laplace approximation at each grid point, which is slower than a fixed-effects
profile. General continuous shape coefficients are reported with their Wald
intervals because they are not profile coordinates. Variance components keep
their log-scale Wald intervals under the profile method, and a non-closing
random-effects profile falls back to Wald.
method = "bootstrap" instead redraws every active random-intercept block and
refits with the Laplace approximation, returning percentile intervals when
enough stable refits remain.
A tibble with one row per target and columns
parameter, conf.low, conf.high, estimate, level, method,
scale, and conf.status.
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)
confint(fit, "CTmax", method = "profile")
confint(fit, "z", method = "profile")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.