coord.ellipse {FactoMineR} | R Documentation |
Construct confidence ellipses
Description
Construct confidence ellipses
Usage
coord.ellipse (coord.simul, centre = NULL, axes = c(1, 2),
level.conf = 0.95, npoint = 100, bary = FALSE)
Arguments
coord.simul |
a data frame containing the coordinates of the individuals for which the confidence ellipses are constructed. This data frame can contain more than 2 variables; the variables taken into account are chosen after. The first column must be a factor which allows to associate one row to an ellipse. The simule object of the result of the simule function correspond to a data frame. |
centre |
a data frame whose columns are the same than those of the coord.simul, and with the coordinates of the centre of each ellipse. This parameter is optional and NULL by default; in this case, the centre of the ellipses is calculated from the data |
axes |
a length 2 vector specifying the components of coord.simul that are taken into account |
level.conf |
confidence level used to construct the ellipses. By default, 0.95 |
npoint |
number of points used to draw the ellipses |
bary |
boolean, if bary = TRUE, the coordinates of the ellipse around the barycentre of individuals are calculated |
Value
res |
a data frame with (npoint times the number of ellipses) rows and three columns. The first column is the factor of coord.simul, the two others columns give the coordinates of the ellipses on the two dimensions chosen. |
call |
the parameters of the function chosen |
Author(s)
Jeremy Mazet
See Also
Examples
data(decathlon)
res.pca <- PCA(decathlon, quanti.sup = 11:12, quali.sup = 13,graph=FALSE)
aa <- cbind.data.frame(decathlon[,13],res.pca$ind$coord)
bb <- coord.ellipse(aa,bary=TRUE)
plot(res.pca,habillage=13,ellipse=bb)
## To automatically draw ellipses around the barycentres of all the categorical variables
plotellipses(res.pca)