lda | R 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.
lda(df, id, dep, indeps, prior = NULL, create_algorithm = FALSE)
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. |
df <- rsegmenter::test_seg_unlabelled lda(df, dep="seg1", indeps=c("seg2","seg3","seg4"),prior=rep(1/4,4))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.