ggadd_partial.Rd
Adds the main and partial effects of a supplmentary variable to a MCA cloud of individuals, with one or more supplementary partialled out
ggplot2
object with the cloud of variables or the cloud of individuals
object created with MCA
, speMCA
, csMCA
, wcMCA
, bcMCA
, stMCA
or multiMCA
function
factor. The categorical supplementary variable.
data frame of supplementary variables to be partialled out (i.e. control variables)
numeric vector of indexes of the categories of the supplementary variable. By default, every categories are used.
numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2).
the color for the labels and lines. Default is "black".
size of the labels of categories. Default is 4.
logical. Whether to add colored lines between the points of the categories of v1. Default is TRUE.
logical. Whether to add gray dashed lines between the points of the categories of v2. Default is TRUE.
the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector). Default is right.
force of repulsion between overlapping text labels. Defaults to 1. If 0, labels are not repelled at all.
exclude text labels that overlap too many things. Defaults to Inf, which means no labels are excluded.
a ggplot2
object
Coordinates of the partial effect of the supplementary variables are derives from linear regression, with individual coordinates as dependent variable, and the supplementary and control variables as independent variables.
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).
# specific MCA of Taste example data set
data(Taste)
junk <- c("FrenchPop.NA", "Rap.NA", "Rock.NA", "Jazz.NA", "Classical.NA",
"Comedy.NA", "Crime.NA", "Animation.NA", "SciFi.NA", "Love.NA",
"Musical.NA")
mca <- speMCA(Taste[,1:11], excl = junk)
# effect of education,
# with age partialled out (partial effect) or not (main effect)
p <- ggcloud_indiv(mca, col = "grey95")
ggadd_partial(p, mca, Taste$Educ, Taste$Age)
#> Warning: Using alpha for a discrete variable is not advised.