residuals.SMNCens: Extract model residuals from smn.clmm objects

residuals.SMNclmmR Documentation

Extract model residuals from smn.clmm objects

Description

The conditional residuals are obtained by subtracting the fitted values from the response vector, while the marginal residuals are obtained by subtracting only the fixed effects from the response vector.

Censored values are imputed using their conditional expectation from the fitting algorithm.

Usage

  ## S3 method for class 'SMNclmm'
residuals(object, level = "conditional", ...)

Arguments

object

An object inheriting from class SMNclmm, representing a fitted scale mixture of normal censored linear mixed model.

level

Either "conditional", for obtaining conditional residuals, or "marginal", for marginal residuals.

...

Additional arguments.

Value

Vector with the residuals of length equal to nrow(data).

Note

The residuals are computed after imputing the censored observations.

Author(s)

Fernanda L. Schumacher, Larissa A. Matos, Victor H. Lachos and Katherine L. Valeriano

See Also

smn.clmm, mahalDistCens

Examples

nj1 = 5; m = 30
time = rep(1:nj1, times=m)
groups = as.factor(rep(1:m, each=nj1))
dat1 = rsmsn.clmm(time, groups, cbind(1,time), rep(1,m*nj1), sigma2=0.7,
                  D=0.6*diag(1), beta=c(1,2), depStruct="CS", phi=0.4)

fm1 = smn.clmm(dat1, formFixed=y~x, groupVar="ind", depStruct="CS", ci="ci",
               lcl="lcl", ucl="ucl", control=lmmControl(max.iter=30))
residuals(fm1)

skewlmm documentation built on July 9, 2023, 7:29 p.m.