mahalDist: Mahalanobis distance from a smn.lmm or smsn.lmm object

View source: R/residuals.R

mahalDistR Documentation

Mahalanobis distance from a smn.lmm or smsn.lmm object

Description

Returns the squared Mahalanobis distance from a fitted SMN-LMM or SMSN-LMM.

Usage

mahalDist(object, decomposed = FALSE, dataPlus = NULL)

Arguments

object

An object inheriting from class SMN or SMSN, representing a fitted scale mixture of (skew) normal linear mixed model.

decomposed

Logical. If TRUE, the Mahalanobis distance is decomposed in an error term and a random effect term. Default is FALSE.

dataPlus

Optional. Expanded dataset that should be used instead the one used for fitting, useful for using Healy's plot with missing data.

Value

A vector containing the Mahalanobis distance, if decomposed = FALSE, or a data frame containing the Mahalanobis distance and its decomposition in error term and random effect (b) term, if decomposed = TRUE.

Author(s)

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

References

Schumacher, F. L., Lachos, V. H., and Matos, L. A. (2021). Scale mixture of skew-normal linear mixed models with within-subject serial dependence. Statistics in Medicine 40(7), 1790-1810.

Zeller, C. B., Labra, F. V., Lachos, V. H. & Balakrishnan, N. (2010). Influence analyses of skew-normal/independent linear mixed models. Computational Statistics & Data Analysis, 54(5).

See Also

smn.lmm, smsn.lmm, plot.mahalDist

Examples

fm1 = smn.lmm(distance ~ age+Sex, data=nlme::Orthodont, groupVar="Subject")
mahalDist(fm1)
plot(mahalDist(fm1), nlabels=2)

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