lda: Runs Linear Discriminant Analysis using the MASS package....

View source: R/lda.R

ldaR Documentation

Runs Linear Discriminant Analysis using the MASS package. Returns the lda model object from the MASS package with an additional elements that holds the fishers classification function coefficients and the predicted outcome.

Description

Runs Linear Discriminant Analysis using the MASS package. Returns the lda model object from the MASS package with an additional elements that holds the fishers classification function coefficients and the predicted outcome.

Usage

lda(df, id, dep, indeps, prior = NULL, create_algorithm = FALSE)

Arguments

df

data.frame of numeric variables.

id

unique row identifier.

dep

target variable to be predicted.

indeps

predictor variables.

prior

numeric vector of prior probabilities. If NULL, will default to 1 divided by number of distinct categories in the dependent variable.

create_algorithm

TRUE/FALSE. If TRUE, will produce an excel file containing the prediction algorithm.

Examples

df <- rsegmenter::test_seg_unlabelled
lda(df, dep="seg1", indeps=c("seg2","seg3","seg4"),prior=rep(1/4,4))


PrenolanM/rsegmenter documentation built on Aug. 7, 2022, 8:56 p.m.