SurvregME: Mixed-effects Additive Parametric Survival Models

View source: R/SurvregME.R

SurvregMER Documentation

Mixed-effects Additive Parametric Survival Models

Description

Estimates various mixed-effects additive parametric models (not exclusively) for survival analysis.

Usage

SurvregME(
  formula,
  data,
  subset,
  weights,
  offset,
  na.action = na.omit,
  dist = c("weibull", "logistic", "gaussian", "exponential", "rayleigh", "loggaussian",
    "lognormal", "loglogistic"),
  scale = 0,
  silent = TRUE,
  resid = FALSE,
  do_update = FALSE,
  estinit = TRUE,
  initpar = NULL,
  fixed = NULL,
  nofit = FALSE,
  control = optim_control(),
  ...
)

Arguments

formula

A formula describing the model. Smooth additive terms are defined the way as in mgcv, and random effects consistently with the notation used in lme4.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model. If not found in data, the variables are taken from environment(formula).

subset

an optional vector specifying a subset of observations to be used in the fitting process.

weights

an optional vector of case weights to be used in the fitting process. Should be NULL or a numeric vector. If present, the weighted log-likelihood is maximised.

offset

this can be used to specify an _a priori_ known component to be included in the linear predictor during fitting. This should be NULL or a numeric vector of length equal to the number of cases.

na.action

a function which indicates what should happen when the data contain NAs. The default is set to na.omit.

dist

character defining the conditional distribution of the (not necessarily positive) response, current choices include Weibull, logistic, normal, exponential, Rayleigh, log-normal (same as log-gaussian), or log-logistic.

scale

a fixed value for the scale parameter(s).

silent

Logical. Make TMB functionality silent.

resid

Logical. If TRUE, the score residuals are also calculated. This comes with some performance cost.

do_update

Logical. If TRUE, the model is set up so that the weights and the offsets are updateable. This comes with some performance cost.

estinit

Logical. Estimate a vector of initial values for the fixed effects parameters from a (fixed effects only) mlt model

initpar

Named list of initial parameter values, if NULL, it is ignored

fixed

a named vector of fixed regression coefficients; the names need to correspond to column names of the design matrix

nofit

logical, if TRUE, creates the model object, but does not run the optimization

control

list with controls for optimization

...

Optional arguments to tram

Details

The parameterization is slightly different from survival::survreg, see Hothorn et al. (2018). The results can be transformed back to the survreg parameterization with specific methods provided by tramME.

The model extends tram::Survreg with random effects and (optionally penalized) additive terms. For details on mixed-effect transformation models, see Tamasi and Hothorn (2021).

The elements of the linear predictor are parameterized with negative parameters (i.e. negative = TRUE in tram).

Value

A SurvregME model object.

References

Hothorn, Torsten, Lisa Möst, and Peter Bühlmann. "Most Likely Transformations." Scandinavian Journal of Statistics 45, no. 1 (March 2018): 110–34. <doi:10.1111/sjos.12291>

Tamasi, Balint, and Torsten Hothorn. "tramME: Mixed-Effects Transformation Models Using Template Model Builder." The R Journal 13, no. 2 (2021): 398–418. <doi:10.32614/RJ-2021-075>

Examples

library("survival")
rats$litter <- factor(rats$litter)
m <- SurvregME(Surv(time, status) ~ rx + (1 | litter), data = rats,
               dist = "weibull")
summary(m)
coef(m, as.survreg = TRUE)

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