LDA | R Documentation |
Calculates a LDA on Coe on top of MASS::lda.
LDA(x, fac, retain, ...)
## Default S3 method:
LDA(x, fac, retain, ...)
## S3 method for class 'PCA'
LDA(x, fac, retain = 0.99, ...)
x |
a Coe or a PCA object |
fac |
the grouping factor (names of one of the $fac column or column id) |
retain |
the proportion of the total variance to retain (if retain<1) using scree, or the number of PC axis (if retain>1). |
... |
additional arguments to feed lda |
a 'LDA' object on which to apply plot.LDA, which is a list with components:
x
any Coe object (or a matrix)
fac
grouping factor used
removed
ids of columns in the original matrix that have been removed since constant (if any)
mod
the raw lda mod from lda
mod.pred
the predicted model using x and mod
CV.fac
cross-validated classification
CV.tab
cross-validation tabke
CV.correct
proportion of correctly classified individuals
CV.ce
class error
LDs
unstandardized LD scores see Claude (2008)
mshape
mean values of coefficients in the original matrix
method
inherited from the Coe object (if any)
For LDA.PCA, retain can be passed as a vector (eg: 1:5, and retain=1, retain=2, ..., retain=5) will be tried, or as "best" (same as before but retain=1:number_of_pc_axes is used).
Silent message and progress bars (if any) with options("verbose"=FALSE)
.
Other multivariate:
CLUST()
,
KMEANS()
,
KMEDOIDS()
,
MANOVA_PW()
,
MANOVA()
,
MDS()
,
MSHAPES()
,
NMDS()
,
PCA()
,
classification_metrics()
bot.f <- efourier(bot, 24)
bot.p <- PCA(bot.f)
LDA(bot.p, 'type', retain=0.99) # retains 0.99 of the total variance
LDA(bot.p, 'type', retain=5) # retain 5 axis
bot.l <- LDA(bot.p, 'type', retain=0.99)
plot_LDA(bot.l)
bot.f <- mutate(bot.f, plop=factor(rep(letters[1:4], each=10)))
bot.l <- LDA(PCA(bot.f), 'plop')
plot_LDA(bot.l) # will replace the former soon
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.