| plot.mahalDist | R Documentation |
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.
## S3 method for class 'mahalDist' plot(x, fitobject, type, level = 0.99, nlabels = 3, ...)
x |
An object inheriting from class |
fitobject |
Optional. An object inheriting from class |
type |
Optional. Either |
level |
An optional numeric value in (0,1) indicating the level of the quantile. It only has utility if |
nlabels |
Number of observations that should be labeled. Default is 3. |
... |
Additional arguments. |
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.
Fernanda L. Schumacher, Larissa A. Matos and Victor H. Lachos
ggplot, mahalDist, smn.lmm, smsn.lmm
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")