residuals.tramME: Residuals of a tramME model

residuals.tramMER Documentation

Residuals of a tramME model

Description

Calculates the score residuals of an intercept term fixed at 0.

Usage

## S3 method for class 'tramME'
residuals(
  object,
  param = NULL,
  newdata = NULL,
  fix_smooth = !is.null(newdata),
  ...
)

Arguments

object

A tramME object.

param

An optional named list of parameter values (beta and theta). See details. Optionally, gamma elements can also be added, which leads to 'fixing' those random effects terms at the supplied values.

newdata

An optional data.frame of observations for which we want to calculate the residuals.

fix_smooth

Logical; it is set to TRUE by default, if newdata is supplied. The random effects parameters corresponding the smooth terms are fixed and not fitted (posterior mode) to newdata instead they are treated just like fixed effects parameters. See details.

...

Optional arguments (for consistency with generic)

Examples


library("survival")
fit <- SurvregME(Surv(time, status) ~ rx + (1 | litter), data = rats)
resid(fit)


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