
Last chance! 50% off unlimited learning
Sale ends in
Select the best elements to plot in a graph
selection(res, dim = 1:2, margin = 1, selec = "cos2", coef = 1)
the elements selected.
the criterion of selection (as a sentence).
an object of class PCA, CA or MCA.
a 2 dimensional numerical vector giving the factorial dimensions to use for the representation (by default the first plane).
an integer (by default 1). If equals 1, the function computes on the individuals (or rows). If equals 2, the function computes on the active variables (or columns). If equals 3, the function computes on the supplementary variables.
the elements to select ; see the details section.
a numerical coefficient to adjust the elements selection rule ; see the details section.
Simon Thuleau and Francois Husson
The selec
argument is used in order to select a part of the elements that are drawn and described. For example, you can use either :
- selec = 1:5
then the elements numbered 1 to 5 are drawn.
- selec = c("name1","name5")
then the elements named name1
and name5
are drawn.
- selec = "contrib 10"
then the 10 active or illustrative elements that have the highest contribution on the 2 dimensions of the plane are drawn.
- selec = "contrib"
then the optimal number of active or illustrative elements that have the highest contribution on the 2 dimensions of the plane are drawn.
- selec = "cos2 5"
then the 5 active or illustrative elements that have the highest cos2 on the 2 dimensions of the plane are drawn.
- selec = "cos2 0.8"
then the active or illustrative elements that have a cos2
higher to 0.8
on the plane are drawn.
- selec = "cos2"
then the optimal number of active or illustrative elements that have the highest cos2 on the 2 dimensions of the plane are drawn.
The coef
argument is used in order to adjust the selection of the elements when based on selec = "contrib"
or selec = "cos2"
. For example :
- if coef = 2
, the threshold is 2 times higher, and thus 2 times more restrictive.
- if coef = 0.5
, the threshold is 2 times lower, and thus 2 times less restrictive.
description
if (FALSE) {
require(FactoMineR)
data(decathlon)
res.pca = PCA(decathlon, quanti.sup = c(11:12), quali.sup = c(13), graph = FALSE)
selection(res.pca, margin = 1, selec = "contrib 10")
}
Run the code above in your browser using DataLab