lrlda | R Documentation |
Function lrlda
implements logratio linear discriminant analysis for compositional data, using the centred logratio
transformation (clr)
lrlda(Xtrain, group, Xtest = NULL, divisorn = FALSE, verbose = FALSE)
Xtrain |
A compositional data set, the training data for logratio-LDA. |
group |
A categorical variable defining the groups. |
Xtest |
A compositional data set for which group prediction is sought (the test data). If no test data is supplied, the training data itself is classified. |
divisorn |
Use divisor "n" ( |
verbose |
Print output ( |
Function lrlda
uses the centred logratio transformation, which produces a singular covariance matrix. This singularity is
dealt with by using a generalized inverse. When test data is supplied via argument Xtest
, the scores of the linear classifier,
the poster probabilities and the predicted classes are calculated for the test data. If no test data is supplied, these quantities
are calculated for the training data.
LD |
Scores on the linear classifier for the test observations. These are also the biplot coordinates of the individuals. |
Fp |
Biplot coordinates of the group means. |
Gs |
Biplot coordinates of the variables. |
Sp |
Pooled covariance matrix. |
Mc |
Matrix of centred clr mean vectors, one row for each group. |
S.list |
Covariance matrices of each group. |
la |
Vector of eigenvalues. |
pred |
Predicted class for the test observations. |
CM |
The confusion matrix. |
gsize |
Sample size of each group. |
Mclr |
Matrix of mean vectors for clr coordinates, one row for each group. |
prob.posterior |
Vector of posterior probabilities. |
decom |
Table with decomposition of variability as expressed by the eigenvalues. |
Jan Graffelman (jan.graffelman@upc.edu)
lrpca
,lrlda
data(Tubb)
sampleid <- Tubb$Sample
site <- factor(Tubb$site)
Oxides <- as.matrix(Tubb[,2:10])
rownames(Oxides) <- sampleid
Oxides <- Oxides/rowSums(Oxides)
out.lda <- lrlda(Oxides,site,verbose=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.