Learn R Programming

GDAtools (version 2.1)

ggbootvalid_supvars: Ellipses of bootstrap validation (supplementary variables)

Description

Ellipses for bootstrap validation of MCA, through the computation of the coordinates of supplementary variables for bootstrap replications of the data.

Usage

ggbootvalid_supvars(resmca, vars = NULL, axes = c(1,2), K = 30,
                    ellipse = "norm", level = 0.95,
                    col = NULL, active = FALSE, legend = "right")

Value

a ggplot2 object

Arguments

resmca

object of class speMCA.

vars

A data frame of categorical supplementary variables. All these variables should be factors.

axes

numeric vector of length 2, specifying the components (axes) to plot. Default is c(1,2).

K

integer. Number of bootstrap replications (default is 30).

ellipse

character string. The type of ellipse. The default "norm" assumes a multivariate normal distribution, "t" assumes a multivariate t-distribution, and "euclid" draws a circle with the radius equal to level, representing the euclidean distance from the center.

level

numerical value. The level at which to draw an ellipse, or, if ellipse="euclid", the radius of the circle to be drawn.

col

Character string. Color name for the ellipses and labels of the categories. If NULL (default), the default ggplot2 palette is used, with one color per variable.

active

logical. If TRUE, the labels of active variables are added to the plot in lightgray. Default is FALSE.

legend

the position of legends ("none", "left", "right", "bottom", "top", or two-element numeric vector). Default is right.

Author

Nicolas Robette

Details

The bootstrap technique is used here as an internal (and non-parametric) validation procedure of the results of a multiple correspondence analysis. For supplementary variables, only partial bootstrap is possible. The partial bootstrap does not compute new MCAs: it projects bootstrap replications of the initial data as supplementary elements of the MCA. See references for more details.

The default parameters for ellipses assume a multivariate normal distribution drawn at level 0.95.

References

Lebart L. (2006). "Validation Techniques in Multiple Correspondence Analysis". In M. Greenacre et J. Blasius (eds), Multiple Correspondence Analysis and related techniques, Chapman and Hall/CRC, p.179-196.

Lebart L. (2007). "Which bootstrap for principal axes methods?". In P. Brito et al. (eds), Selected Contributions in Data Analysis and Classification, Springer, p.581-588.

See Also

bootvalid_supvars, ggbootvalid_variables

Examples

Run this code
# 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)
# bootstrap validation ellipses
# for three supplementary variables
sup <- Taste[,c("Gender", "Age", "Educ")]
ggbootvalid_supvars(mca, sup)

Run the code above in your browser using DataLab