supplementary.individuals: Add supplementary individuals to a result object

Description Usage Arguments Value Examples

View source: R/functions_analysis.r

Description

Add supplementary individuals to a result object

Usage

1
supplementary.individuals(object, sup.indicator, replace = FALSE)

Arguments

object

is a soc.ca class object created with soc.mca

sup.indicator

is a indicator matrix for the supplementary individuals with the same columns as the active variables in object.

replace

if TRUE the coordinates of the active individuals are discarded. If FALSE the coordinates of the supplementary and active individuals are combined. The factor object$supplementary.individuals marks the supplementary individuals.

Value

a soc.ca class object created with soc.mca

Examples

1
2
3
4
5
6
7
example(soc.mca)
res.pas   <- soc.mca(active, passive = "Costume")
res.sup   <- supplementary.individuals(res.pas, sup.indicator = indicator(active))
a         <- res.sup$coord.ind[res.sup$supplementary.individuals == "Supplementary",]
b         <- res.pas$coord.ind
all.equal(as.vector(a), as.vector(b))
map.ind(res.sup)

Example output

Loading required package: ggplot2

soc.mc> # Loads the "taste" dataset included in this package
soc.mc> data(taste)

soc.mc> # Create a data frame of factors containing all the active variables 
soc.mc> taste          <- taste[which(taste$Isup == 'Active'), ]

soc.mc> attach(taste)

soc.mc> active         <- data.frame(TV, Film, Art, Eat)

soc.mc> sup            <- data.frame(Gender, Age, Income)

soc.mc> detach(taste)

soc.mc> # Runs the analysis
soc.mc> result         <- soc.mca(active, sup)

soc.mc> # Prints the results
soc.mc> result
                        Specific Multiple Correspondence Analysis:                         
 
                    Statistics                                   Scree plot               
	Active dimensions:                            12  |  1.     47.6%   ************************
	Dimensions explaining 80% of inertia:          3  |  2.     21.5%   ***********
	Active modalities:                            29  |  3.     11.8%   ******
	Supplementary modalities:                     14  |  4.      7.1%   ****
	Individuals:                                1215  |  5.      5.0%   **
	Share of passive mass:                         0  |  6.      3.0%   **
	Number of passive modalities:                  0  |  7.      1.7%   *

                    The 4 active variables: [No. modalities - share of variance]                    

             TV [8 - 28%]            Film [8 - 28%]             Art [7 - 24%] 
            Eat [6 - 20%]

soc.mc> # A specific multiple correspondence analysis
soc.mc> # options defines what words or phrases that are looked for in the labels of the active modalities.
soc.mc> options(passive = c("Film: CostumeDrama", "TV: Tv-Sport"))

soc.mc> soc.mca(active, sup)
                        Specific Multiple Correspondence Analysis:                         
 
                    Statistics                                   Scree plot               
	Active dimensions:                            11  |  1.     45.8%   ***********************
	Dimensions explaining 80% of inertia:          3  |  2.     27.9%   **************
	Active modalities:                            27  |  3.      8.8%   ****
	Supplementary modalities:                     14  |  4.      6.5%   ***
	Individuals:                                1215  |  5.      4.2%   **
	Share of passive mass:                      0.06  |  6.      3.4%   **
	Number of passive modalities:                  2  |  7.      1.5%   *

                    The 4 active variables: [No. modalities - share of variance]                    

             TV [7 - 24%]            Film [7 - 24%]             Art [7 - 24%] 
            Eat [6 - 20%]

soc.mc> options(passive = NULL)
[1] TRUE

soc.ca documentation built on Sept. 5, 2021, 5:21 p.m.