Last data update: 2014.03.03

R: Draw confidence ellipses in CA
ellipseCAR Documentation

Draw confidence ellipses in CA

Description

Draw confidence ellipses in CA around rows and/or columns.

Usage

ellipseCA (x, ellipse=c("col","row"), method="multinomial", nbsample=100,
    axes=c(1,2), xlim=NULL, ylim=NULL, col.row="red", col.col="blue",
	col.row.ell=col.row, col.col.ell=col.col, ...)

Arguments

x

an object of class CA

ellipse

a vector of character that defines which ellipses are drawn

method

the method to construct ellipses (see details below)

nbsample

number of samples drawn to evaluate the stability of the points

axes

a length 2 vector specifying the components to plot

xlim

range for the plotted 'x' values, defaulting to the range of the finite values of 'x'

ylim

range for the plotted 'y' values, defaulting to the range of the finite values of 'y'

col.row

a color for the rows points

col.col

a color for columns points

col.row.ell

a color for the ellipses of rows points (the color "transparent" can be used if an ellipse should not be drawn)

col.col.ell

a color for the ellipses of columns points (the color "transparent" can be used if an ellipse should not be drawn)

...

further arguments passed to or from the plot.CA function, such as title, invisible, ...

Details

With method="multinomial", the table X with the active elements is taken as a reference. Then new data tables are drawn in the following way: N (the sum of X) values are drawn from a multinomial distribution with theoretical frequencies equals to the values in the cells divided by N.

With method="boot", the values are bootstrapped row by row: Ni (the sum of row i in the X table) values are taken in a vector with Nij equals to column j (with j varying from 1 to J).

Thus nbsample new datasets are drawn and projected as supplementary rows and/or supplementary columns. Then confidence ellipses are drawn for each elements thanks to the nbsample supplementary points.

Value

Returns the factor map with the joint plot of CA with ellipses around some elements.

Author(s)

Francois Husson Francois.Husson@agrocampus-ouest.fr

References

Lebart, L., Morineau, A. and Piron, M. (1995) Statistique exploratoire multidimensionnelle, Dunod.

See Also

plot.CA, CA

Examples

data(children)
res.ca <- CA (children, col.sup = 6:8, row.sup = 15:18)
## Ellipses for all the active elements
ellipseCA(res.ca)
## Ellipses around some columns only
ellipseCA(res.ca,ellipse="col",col.col.ell=c(rep("blue",2),rep("transparent",3)),
     invisible=c("row.sup","col.sup"))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(FactoMineR)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FactoMineR/ellipseCA.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ellipseCA
> ### Title: Draw confidence ellipses in CA
> ### Aliases: ellipseCA
> ### Keywords: multivariate
> 
> ### ** Examples
> 
> data(children)
> res.ca <- CA (children, col.sup = 6:8, row.sup = 15:18)
> ## Ellipses for all the active elements
> ellipseCA(res.ca)
> ## Ellipses around some columns only
> ellipseCA(res.ca,ellipse="col",col.col.ell=c(rep("blue",2),rep("transparent",3)),
+      invisible=c("row.sup","col.sup"))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>