plot.mahalDist {skewlmm} | R Documentation |
Plot Mahalanobis distance for a fitted smn.lmm or smsn.lmm
Description
Plot method for objects of class "mahalDist". For the total Mahalanobis distance, it gives a quantile for outlier detection, based on the Mahalanobis distance theoretical distribution.
Usage
## S3 method for class 'mahalDist'
plot(x, fitobject, type, level = 0.99, nlabels = 3, ...)
Arguments
x |
An object inheriting from class |
fitobject |
Optional. An object inheriting from class |
type |
Optional. Either |
level |
An optional numeric value in |
nlabels |
Number of observations that should be labeled. Default is 3. |
... |
Additional arguments. |
Value
A ggplot object, plotting the index versus the Mahalanobis distance, if all subject have the same number of observations; or plotting the number of observations per subject versus the Mahalanobis, otherwise.
Author(s)
Fernanda L. Schumacher, Larissa A. Matos and Victor H. Lachos
See Also
ggplot
, mahalDist
, smn.lmm
, smsn.lmm
Examples
fm1 = smn.lmm(distance ~ age+Sex, data=nlme::Orthodont, groupVar="Subject")
plot(mahalDist(fm1), nlabels=2)
#the estimated quantile is stored at the attribute "info" of the plot object
plotMD = plot(mahalDist(fm1))
attr(plotMD, "info")