Learn R Programming

GDAtools (version 2.1)

DA: Discriminant Analysis

Description

Descriptive discriminant analysis, aka "Analyse Factorielle Discriminante" for the French school of multivariate data analysis.

Usage

DA(data, class, row.w = NULL, type = "FR")

Value

An object of class PCA from FactoMineR package, with class as qualitative supplementary variable, and one additional item :

cor_ratio

correlation ratios between class and the discriminant factors

Arguments

data

data frame with only numeric variables

class

factor specifying the class

row.w

numeric vector of row weights. If NULL (default), a vector of 1 for uniform row weights is used.

type

If "FR" (default), the inverse of the total covariance matrix is used as metric. If "GB", it is the inverse of the within-class covariance matrix (Mahalanobis metric), which makes the results equivalent to linear discriminant analysis as implemented in lda function in MASS package.

Author

Marie Chavent, Nicolas Robette

Details

The results are the same with type "FR" or "GB", only the eigenvalues vary. With type="FR", these eigenvalues vary between 0 and 1 and can be interpreted as "discriminant power".

References

Bry X., 1996, Analyses factorielles multiples, Economica.

Lebart L., Morineau A. et Warwick K., 1984, Multivariate Descriptive Statistical Analysis, John Wiley and sons, New-York.)

Saporta G., 2006, Probabilités, analyses des données et statistique, Editions Technip.

See Also

bcPCA, PCAiv

Examples

Run this code
library(FactoMineR)
data(decathlon)
points <- cut(decathlon$Points, c(7300, 7800, 8000, 8120, 8900), c("Q1","Q2","Q3","Q4"))
res <- DA(decathlon[,1:10], points)
# plot of observations colored by class
plot(res, choix = "ind", invisible = "quali", habillage = res$call$quali.sup$numero)
# plot of class categories
plot(res, choix = "ind", invisible = "ind", col.quali = "darkblue")
# plot of variables
plot(res, choix = "varcor", invisible = "none")

Run the code above in your browser using DataLab