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 numeric 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

Whether to return the predicted values based on the model. Default is TRUE.

CV

Whether to do cross-validation in addition to "ordinary" analysis, default is TRUE.

usePriorBetweenGroups

Whether to use prior probabilities also in estimating the model (compared to only in prediction); default is TRUE.

...

Arguments passed to function MASS::lda.

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.2.3 Index]