Description Usage Arguments Details Value Author(s) References See Also Examples
Performs a Descriptive Discriminant Analysis (a.k.a. Factorial Discriminant Analysis from the french Analyse Factorielle Discriminante)
1 |
variables |
matrix or data frame with explanatory variables |
group |
vector or factor with group memberships |
covar |
character string indicating the covariance
matrix to be used. Options are |
When covar="within"
the estimated pooled
within-class covariance matrix is used in the
calculations.
When covar="total"
the total
covariance matrix is used in the calculations.
The
difference between covar="within"
and
covar="total"
is in the obtained eigenvalues.
The estiamted pooled within-class covariance matrix is
actually the within-class covariance matrix divided by
the number of observations minus the number of classes
(see getWithin
)
An object of class "desda"
, basically a list with
the following elements
power |
table with discriminant power of the explanatory variables |
values |
table of eigenvalues |
discrivar |
table of discriminant variables, i.e. the coefficients of the linear discriminant functions |
discor |
table of correlations between the variables and the discriminant axes |
scores |
table of discriminant scores for each observation |
Gaston Sanchez
Lebart L., Piron M., Morineau A. (2006) Statistique Exploratoire Multidimensionnelle. Dunod, Paris.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Not run:
# load bordeaux wines dataset
data(bordeaux)
# descriptive discriminant analysis with within covariance matrix
my_dda1 = desDA(bordeaux[,2:5], bordeaux$quality)
my_dda1
# descriptive discriminant analysis with total covariance matrix
my_dda2 = desDA(bordeaux[,2:5], bordeaux$quality, covar="total")
my_dda2
# plot factor coordinates with ggplot
library(ggplot2)
bordeaux$f1 = my_dda1$scores[,1]
bordeaux$f2 = my_dda1$scores[,2]
ggplot(data=bordeaux, aes(x=f1, y=f2, colour=quality)) +
geom_hline(yintercept=0, colour="gray70") +
geom_vline(xintercept=0, colour="gray70") +
geom_text(aes(label=year), size=4) +
opts(title="Discriminant Map - Bordeaux Wines (years)")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.