varsup.Rd
From MCA results, computes statistics (weights, coordinates, contributions, test-values, variances) for a categorical supplementary variable.
varsup(resmca, var)
object of class MCA
, speMCA
, csMCA
, stMCA
or multiMCA
the categorical supplementary variable. It does not need to have been used at the MCA step.
Returns a list:
numeric vector of categories weights
data frame of categories coordinates
data frame of categories square cosine
data frame of categories within variances, variance between and within categories and variable square correlation ratio (eta2)
data frame of categories typicality test statistics
data frame of categories p-values from typicality test statistics
data frame of categories correlation coefficients
Le Roux B. and Rouanet H., Multiple Correspondence Analysis, SAGE, Series: Quantitative Applications in the Social Sciences, Volume 163, CA:Thousand Oaks (2010).
Le Roux B. and Rouanet H., Geometric Data Analysis: From Correspondence Analysis to Stuctured Data Analysis, Kluwer Academic Publishers, Dordrecht (June 2004).
## Performs a specific MCA on 'Music' example data set
## ignoring every 'NA' (i.e. 'not available') categories,
## and then computes statistics for age supplementary variable.
data(Music)
getindexcat(Music)
#> [1] "FrenchPop.No" "FrenchPop.Yes" "FrenchPop.NA" "Rap.No"
#> [5] "Rap.Yes" "Rap.NA" "Rock.No" "Rock.Yes"
#> [9] "Rock.NA" "Jazz.No" "Jazz.Yes" "Jazz.NA"
#> [13] "Classical.No" "Classical.Yes" "Classical.NA" "Gender.Men"
#> [17] "Gender.Women" "Age.15-24" "Age.25-49" "Age.50+"
#> [21] "OnlyMus.Daily" "OnlyMus.Often" "OnlyMus.Rare" "OnlyMus.Never"
#> [25] "Daily.No" "Daily.Yes"
mca <- speMCA(Music[,1:5],excl=c(3,6,9,12,15))
varsup(mca,Music$Age)
#> $weight
#> 15-24 25-49 50+
#> 78 204 218
#>
#> $coord
#> dim.1 dim.2 dim.3 dim.4 dim.5
#> 15-24 0.445924 -0.781930 0.313437 0.002163 0.105164
#> 25-49 -0.050511 -0.236099 -0.105504 -0.102956 0.003924
#> 50+ -0.112283 0.500710 -0.013419 0.095570 -0.041299
#>
#> $cos2
#> dim.1 dim.2 dim.3 dim.4 dim.5
#> 15-24 0.036754 0.113010 0.018159 0.000001 0.002044
#> 25-49 0.001758 0.038417 0.007671 0.007305 0.000011
#> 50+ 0.009746 0.193811 0.000139 0.007061 0.001319
#>
#> $var
#> dim.1 dim.2 dim.3 dim.4 dim.5
#> 15-24 0.224468 0.162922 0.216555 0.333632 0.080558
#> 25-49 0.299116 0.241927 0.199184 0.195215 0.123800
#> 50+ 0.254595 0.101594 0.192788 0.087921 0.150360
#> within 0.268060 0.168417 0.199105 0.170028 0.128634
#> between 0.010461 0.049580 0.004052 0.001424 0.000319
#> total 0.278521 0.217997 0.203157 0.171452 0.128953
#> eta2 0.037558 0.227433 0.019946 0.008308 0.002475
#>
#> $typic
#> dim.1 dim.2 dim.3 dim.4 dim.5
#> 15-24 4.282548 -7.509471 3.010171 0.020778 1.009972
#> 25-49 -0.936718 -4.378377 -1.956531 -1.909278 0.072764
#> 50+ -2.205306 9.834220 -0.263555 1.877042 -0.811141
#>
#> $pval
#> dim.1 dim.2 dim.3 dim.4 dim.5
#> 15-24 0.000018 0.0e+00 0.002611 0.983423 0.312509
#> 25-49 0.348903 1.2e-05 0.050403 0.056226 0.941994
#> 50+ 0.027433 0.0e+00 0.792123 0.060512 0.417285
#>
#> $cor
#> dim.1 dim.2 dim.3 dim.4 dim.5
#> 15-24 0.192 -0.336 0.135 0.001 0.045
#> 25-49 -0.042 -0.196 -0.088 -0.085 0.003
#> 50+ -0.099 0.440 -0.012 0.084 -0.036
#>