Learn R Programming

skewlmm (version 1.1.3)

mahalDist: 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)

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.

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.

Author

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

References

Schumacher, F. L., Matos, L. A., and Lachos, V. H. (2025). "skewlmm: An R Package for Fitting Skewed and Heavy-Tailed Linear Mixed Models." Journal of Statistical Software, 115(7), 1--32.

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

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

Run the code above in your browser using DataLab