Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

LdaClassic

Linear Discriminant Analysis


Description

Performs a linear discriminant analysis and returns the results as an object of class LdaClassic (aka constructor).

Usage

LdaClassic(x, ...)


## Default S3 method:
LdaClassic(x, grouping, prior = proportions, tol = 1.0e-4, ...)

Arguments

x

a matrix or data frame containing the explanatory variables (training set).

grouping

grouping variable: a factor specifying the class for each observation.

prior

prior probabilities, default to the class proportions for the training set.

tol

tolerance

...

arguments passed to or from other methods.

Value

Returns an S4 object of class LdaClassic

Author(s)

Valentin Todorov valentin.todorov@chello.at

References

Todorov V & Filzmoser P (2009), An Object Oriented Framework for Robust Multivariate Analysis. Journal of Statistical Software, 32(3), 1–47. URL http://www.jstatsoft.org/v32/i03/.

See Also

Examples

## Example anorexia
library(MASS)
data(anorexia)

## rrcov: LdaClassic()
lda <- LdaClassic(Treat~., data=anorexia)
predict(lda)@classification

## MASS: lda()
lda.MASS <- lda(Treat~., data=anorexia)
predict(lda.MASS)$class

## Compare the prediction results of MASS:::lda() and LdaClassic()
all.equal(predict(lda)@classification, predict(lda.MASS)$class)

rrcov

Scalable Robust Estimators with High Breakdown Point

v1.5-5
GPL (>= 2)
Authors
Valentin Todorov [aut, cre] (<https://orcid.org/0000-0003-4215-0245>)
Initial release
2020-07-31

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.