ldaPlus {multiUS}R Documentation

Linear discriminant analysis

Description

The function performs a linear discriminant analysis (by using the MASS::lda function). Compared to the MASS::lda function, the ldaPlus function enable to consider the prior probabilities to predict the values of a categorical variable, it provides with predicted values and with (Jack-knife) classification table and also with statistical test of canonical correlations between the variable that represents groups and numberic variables.

Usage

ldaPlus(x, grouping, pred = TRUE, CV = TRUE, usePriorBetweenGroups = TRUE, ...)

Arguments

x

A data frame with values of numeric variables.

grouping

Categorical variable that defines groups.

pred

Wheter to retun the predicted values based on the model. Default is TRUE.

CV

Whether to do cross-valiation in addition to "ordinary" analyisis, default is TRUE.

usePriorBetweenGroups

Wheter to use prior probabilites aslo in estimating the model (compared to only in prediction); default is TRUE.

...

Arguments passed to function MASS::lda.

prior

The prior probabilities of class membership. If unspecified, the class proportions for the training set are used. If present, the probabilities should be specified in the order of the factor levels.

Details

The specified prior is not taken into account when computing eigenvalues and all statistics based on them (everything in components eigModel and sigTest of the returned value).

Value

The following objects are also a part of what is returned by the MASS::lda function.

The additional following objects are generated by the multiUS::ldaPlus function.

Author(s)

Aleš Žiberna

References

R Data Analysis Examples: Canonical Correlation Analysis, UCLA: Statistical Consulting Group. From http://www.ats.ucla.edu/stat/r/dae/canonical.htm (accessed Decembar 27, 2013).

Examples

ldaPlus(x = mtcars[,c(1, 3, 4, 5, 6)], grouping = mtcars[,10])

[Package multiUS version 1.0.5 Index]