DModX
Distance to the model of X-space.
DModX(object, dat, newdata=FALSE, type=c("normalized","absolute"), ...)
object |
a pcaRes object |
dat |
the original data, taken from |
newdata |
logical indicating if this data was part of the training data or not. If it was, it is adjusted by a near one factor v=(N/ (N-A-A0))^-1 |
type |
if absolute or normalized values should be given. Normalized values are adjusted to the the total RSD of the model. |
... |
Not used |
Measures how well described the observations are, i.e. how well they fit in the mode. High DModX indicate a poor fit. Defined as:
\frac{√{\frac{SSE_i}{K-A}}}{√{\frac{SSE}{(N-A-A_0)(K-A)}}}
For observation i, in a model with A components, K variables and N obserations. SSE is the squared sum of the residuals. A_0 is 1 if model was centered and 0 otherwise. DModX is claimed to be approximately F-distributed and can therefore be used to check if an observation is significantly far away from the PCA model assuming normally distributed data.
Pass original data as an argument if the model was calculated with
completeObs=FALSE
.
A vector with distances from observations to the PCA model
Henning Redestig
Introduction to Multi- and Megavariate Data Analysis using Projection Methods (PCA and PLS), L. Eriksson, E. Johansson, N. Kettaneh-Wold and S. Wold, Umetrics 1999, p. 468
data(iris) pcIr <- pca(iris[,1:4]) with(iris, plot(DModX(pcIr)~Species))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.