confband.tramME: Confidence intervals and bands from a 'tramME' model

View source: R/confband.R

confband.tramMER Documentation

Confidence intervals and bands from a tramME model

Description

Pointwise confidence intervals or multiplicity-adjusted confidence bands for transformation, distribution, survivor or cumulative hazard functions.

Usage

## S3 method for class 'tramME'
confband(
  object,
  newdata,
  level = 0.95,
  type = c("trafo", "distribution", "survivor", "cumhazard"),
  adjust = FALSE,
  K = 40,
  cheat = K,
  q = NULL,
  baseline_only = FALSE,
  ...
)

Arguments

object

The tramME object.

newdata

A data frame of covariate values.

level

Confidence level.

type

The scale on which the condfidence bands are calculated.

adjust

If TRUE, multiplicity-adjusted confidence bands are calculated. (see Details)

K

The number of grid points at which the outcome distribution is evaluated.

cheat

In the case of multiplicity adjustment (adjust = TRUE), an option to decrease the number of grid points (cheat < K), for faster calculations and increased numerical stability. (see Details)

q

The quantiles at which the model is evaluated.

baseline_only

If TRUE, only evaluate the baseline transformation function and ignore the shift terms.

...

Optional arguments passed to confint.glht.

Details

Similarly to confband, this method evaluates the conditional distribution of the outcome on a selected scale given a number of grid-points and claculates the corresponding confidence intervals or bands (adjusting for multiplicity).

The point estimates retured by this function could also be calculated with predict.tramME (when newdata does not contain response values and K is set to the number of grid points). While predict.tramME is designed to calculate a potentially large number of point estimates on a wider range of available scales, confband calculates the asymptotic intervals from the joint covariance matrix of the fixed and random effects. For technical reasons, a smaller set of type options are available, and the calculations are slower than with predict.tramME. The handling of random effects is currently stricter than in predict.tramME: No ranef option is available, and grouping factors for random effects supplied in newdata must have the same levels as the dataset used to fit the model.

The multiplicity adjustment is done using confint.glht. The cheat argument reduces the dimensionality of the multivariate root-finding problem (see qmvt) for speed and (occasionally) numerical stability. The critical value for the confidence bands are obtained for cheat < K grid points, but the confidence bands are calculated for K grid points. As a result, the nominal level of the returned confidence band is not maintained, but the deviation is expected to be small if cheat is reasonably large. It is the user's responsibility to set this value, and by default cheat = K.

Value

A matrix (in the case when newdata has a single row) or a list of matrices for each row of newdata.

Warning

This method implements new functionality. Its user interface may be subject to change.


tramME documentation built on July 2, 2024, 5:07 p.m.