wcMCA {GDAtools} | R Documentation |
Within-class MCA
Description
Within-class MCA, also called conditional MCA
Usage
wcMCA(data, class, excl = NULL, row.w = NULL, ncp = 5)
Arguments
data |
data frame with only categorical variables, i.e. factors |
class |
factor specifying the class |
excl |
numeric vector indicating the indexes of the "junk" categories (default is NULL). See |
row.w |
numeric vector of row weights. If NULL (default), a vector of 1 for uniform row weights is used. |
ncp |
number of dimensions kept in the results (by default 5) |
Details
Within-class Multiple Correspondence Analysis is a MCA where the active categories are centered on the mean of their class (i.e. conditional frequencies) instead of the overall mean (i.e. marginal frequencies).
It is also known as "conditional MCA" and can be seen as a special case of MCA on orthogonal instrumental variables, with only one (categorical) instrumental variable.
Value
An object of class speMCA
, with an additional item :
ratio |
the within-class inertia percentage |
.
Note
The code is adapted from speMCA
function.
As in speMCA
, if there are NAs in data
, these NAs will be automatically considered as junk categories. If one desires more flexibility, data
should be recoded to add explicit factor levels for NAs and then excl
option may be used to select the junk categories.
Author(s)
Nicolas Robette
References
Escofier B., 1990, Analyse des correspondances multiples conditionnelle, La revue de Modulad, 5, 13-28.
Lebart L., Morineau A. et Warwick K., 1984, Multivariate Descriptive Statistical Analysis, John Wiley and sons, New-York.)
See Also
Examples
# within-class analysis of tea data
# with SPC as class
library(FactoMineR)
data(tea)
res <- wcMCA(tea[,1:18], tea$SPC)
res$ratio
ggcloud_variables(res)