crimcoords | R Documentation |
Compute the discriminant coordinates or crimcoords obtained by projecting the observed data from multiple groups onto the discriminant subspace. The optimal projection subspace is given by the linear transformation of the original variables that maximizes the ratio of the between-groups covariance (which represents groups separation) to the pooled within-group covariance (which represents within-group dispersion).
crimcoords(data, classification,
numdir = NULL,
unbiased = FALSE,
...)
## S3 method for class 'crimcoords'
summary(object, numdir, ...)
## S3 method for class 'crimcoords'
plot(x, ...)
data |
A numeric vector, matrix, or data frame of observations. Categorical variables are not allowed. If a matrix or data frame, rows correspond to observations and columns correspond to variables. |
classification |
A vector (numerical, character string, or factor) giving the groups classification (either the known class labels or the estimated clusters) for the observed data. |
numdir |
An integer value specifying the number of directions of the discriminant subspace to return. If not provided, the maximal number of directions are returned (which is given by the number of non-null eigenvalues, the minimum among the number of variables and the number of groups minus one). However, since the effectiveness of the discriminant coordinates in highlighting the separation of groups is decreasing, it might be useful to provide a smaller value, say 2 or 3. |
unbiased |
A logical specifying if unbiased estimates should be used for the
between-groups and within-groups covariances. By default
|
object , x |
An object of class |
... |
further arguments passed to or from other methods. |
A list of class crimcoords
with the following components:
means |
A matrix of within-groups means. |
B |
The between-groups covariance matrix. |
W |
The pooled within-groups covariance matrix. |
evalues |
A vector of eigenvalues. |
basis |
A matrix of eigenvectors specifying the basis of the discriminant subspace. |
projection |
A matrix of projected data points onto the discriminant subspace. |
classification |
A vector giving the groups classification. |
Luca Scrucca luca.scrucca@unipg.it
Gnanadesikan, R. (1977) Methods for Statistical Data Analysis of Multivariate Observations. John Wiley 1& Sons, Sec. 4.2.
Flury, B. (1997) A First Course in Multivariate Statistics. Springer, Sec. 7.3.
MclustDR
, clPairs
.
# discriminant coordinates for the iris data using known classes
data("iris")
CRIMCOORDS = crimcoords(iris[,-5], iris$Species)
summary(CRIMCOORDS)
plot(CRIMCOORDS)
# banknote data
data("banknote")
# discriminant coordinate on known classes
CRIMCOORDS = crimcoords(banknote[,-1], banknote$Status)
summary(CRIMCOORDS)
plot(CRIMCOORDS)
# discriminant coordinates on estimated clusters
mod = Mclust(banknote[,-1])
CRIMCOORDS = crimcoords(banknote[,-1], mod$classification)
summary(CRIMCOORDS)
plot(CRIMCOORDS)
plot(CRIMCOORDS$projection, type = "n")
text(CRIMCOORDS$projection, cex = 0.8,
labels = strtrim(banknote$Status, 2),
col = mclust.options("classPlotColors")[1:mod$G][mod$classification])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.