ggadd_attractions.Rd
Adds attractions between categories, as measured by phi coefficients or percentages of maximum deviation (PEM), by plotting segments onto a MCA cloud of variables.
ggadd_attractions(p, resmca, axes = c(1,2), measure = "phi", min.asso = 0.3,
col.segment = "lightgray", col.text = "black", text.size = 3)
ggplot2
object with the cloud of variables
object of class MCA
, speMCA
, csMCA
, stMCA
or multiMCA
.
numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2).
character string. The measure for attractions: "phi" (default) for phi coefficients, "pem" for percentages of maximum deviation (PEM).
numerical value ranging from 0 to 1. The minimal attraction value for segments to be plotted. Default is 0.3.
Character string with the color of the segments. Default is lightgray.
Character string with the color of the labels of the categories. Default is black.
Size of the labels of categories. Default is 3.
a ggplot2
object
Cibois, Philippe. Les méthodes d’analyse d’enquêtes. Nouvelle édition [en ligne]. Lyon: ENS Éditions, 2014. <http://books.openedition.org/enseditions/1443>
# specific MCA on 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)
# Plots attractions
p <- ggcloud_variables(mca, col="white", legend="none")
ggadd_attractions(p, mca, measure="phi", min.asso=0.1)