Identifies the variables and the categories that are the most characteristic according to each dimension obtained by a MCA. It is inspired by dimdesc function in FactoMineR package (see Husson et al, 2010), but allows to analyze variants of MCA, such as specific MCA or class specific MCA.

dimdescr(resmca, vars = NULL, dim = c(1,2), 
         limit = NULL, correlation = "pearson",
         na.rm.cat = FALSE, na.value.cat = "NA", na.rm.cont = FALSE,
         nperm = NULL, distrib = "asympt",
         shortlabs = TRUE)

Arguments

resmca

object of class MCA, speMCA, csMCA, stMCA or multiMCA

vars

data frame of variables to describes the MCA dimensions with. If NULL (default), the active variables of the MCA will be used.

dim

the dimensions which are described. Default is c(1,2)

limit

for the relationship between a dimension and a categorical variable, only associations (measured with point-biserial correlations) higher or equal to limit will be displayed. If NULL (default), they are all displayed.

correlation

character string. The type of correlation measure to be used between two numerical variables : "pearson" (default), "spearman" or "kendall".

na.rm.cat

logical, indicating whether NA values in the categorical variables should be silently removed before the computation proceeds. If FALSE (default), an additional level is added to the categorical variables (see na.value.cat argument).

na.value.cat

character string. Name of the level for NA category. Default is "NA". Only used if na.rm.cat = FALSE.

na.rm.cont

logical indicating whether NA values in the numerical variables should be silently removed before the computation proceeds. Default is FALSE.

nperm

numeric. Number of permutations for the permutation tests of independence. If NULL (default), no permutation test is performed.

distrib

the null distribution of permutation test of independence can be approximated by its asymptotic distribution ("asympt", default) or via Monte Carlo resampling ("approx").

shortlabs

logical. If TRUE (default), the data frame will have short column names, so that all columns can be displayed side by side on a laptop screen.

Details

See condesc.

Value

Returns a list of ncp lists including:

variables

associations between dimensions of the MCA and the variables in vars

categories

a data frame with categorical variables from vars and associations measured by correlation coefficients

References

Husson, F., Le, S. and Pages, J. (2010). Exploratory Multivariate Analysis by Example Using R, Chapman and Hall.

Author

Nicolas Robette

Examples

# specific MCA on Music example data set
data(Music)
junk <- c("FrenchPop.NA", "Rap.NA", "Rock.NA", "Jazz.NA", "Classical.NA")
mca <- speMCA(Music[,1:5], excl = junk)
# description of the dimensions
dimdescr(mca, limit = 0.1, nperm = 10)
#> $dim.1
#> $dim.1$variables
#>    variable measure association  pvalue
#> 1      Jazz    Eta2       0.611 0.00000
#> 2 Classical    Eta2       0.539 0.00000
#> 3      Rock    Eta2       0.160 0.00000
#> 4       Rap    Eta2       0.075 0.00000
#> 5 FrenchPop    Eta2       0.012 0.00043
#> 
#> $dim.1$categories
#>       categories avg.coord.in.cat sd.coord.in.cat sd.coord.in.dim    cor
#> 1        Jazz.No            0.204           0.324           0.528  0.751
#> 2   Classical.No            0.244           0.335           0.528  0.710
#> 3        Rock.No            0.131           0.471           0.528  0.398
#> 4        Rap.Yes            0.339           0.504           0.528  0.274
#> 5   FrenchPop.No            0.072           0.543           0.528  0.108
#> 6  FrenchPop.Yes           -0.044           0.511           0.528 -0.103
#> 7         Rap.No           -0.062           0.510           0.528 -0.264
#> 8       Rock.Yes           -0.344           0.514           0.528 -0.396
#> 9  Classical.Yes           -0.615           0.414           0.528 -0.734
#> 10      Jazz.Yes           -0.849           0.340           0.528 -0.780
#>       pval
#> 1  0.00000
#> 2  0.00000
#> 3  0.00000
#> 4  0.00000
#> 5  0.00001
#> 6  0.01043
#> 7  0.00000
#> 8  0.00000
#> 9  0.00000
#> 10 0.00000
#> 
#> 
#> $dim.2
#> $dim.2$variables
#>    variable measure association  pvalue
#> 1       Rap    Eta2       0.526 0.00000
#> 2      Rock    Eta2       0.456 0.00000
#> 3 Classical    Eta2       0.077 0.00000
#> 4      Jazz    Eta2       0.031 0.00000
#> 5 FrenchPop    Eta2       0.003 0.55391
#> 
#> $dim.2$categories
#>      categories avg.coord.in.cat sd.coord.in.cat sd.coord.in.dim    cor  pval
#> 1        Rap.No            0.147           0.320           0.467  0.704 0e+00
#> 2       Rock.No            0.192           0.339           0.467  0.660 0e+00
#> 3 Classical.Yes            0.205           0.445           0.467  0.276 0e+00
#> 4       Jazz.No            0.040           0.443           0.467  0.165 7e-05
#> 5      Jazz.Yes           -0.169           0.526           0.467 -0.175 5e-05
#> 6  Classical.No           -0.083           0.451           0.467 -0.273 0e+00
#> 7      Rock.Yes           -0.519           0.363           0.467 -0.676 0e+00
#> 8       Rap.Yes           -0.793           0.318           0.467 -0.724 0e+00
#> 
#>