Skip to contents

An S4 class to store the results of a principal components analysis.

Slots

center

A numeric vector giving the column mean of the initial dataset (active individuals only).

scale

A numeric vector giving the column standard deviations of the initial dataset (active individuals only).

Note

This class inherits from MultivariateAnalysis.

Author

N. Frerebeau

Examples

## Load data
data("iris")

## Compute principal components analysis
X <- pca(iris, scale = TRUE, sup_row = sample(150, 10), sup_col = 2)
#> 1 qualitative variable was removed: Species.

## Get row coordinates
head(get_coordinates(X, margin = 1))
#>          F1          F2  .sup
#> 1 -2.102753  0.29577407 FALSE
#> 2 -2.239215  0.09681356 FALSE
#> 3 -2.409533 -0.08736186 FALSE
#> 4 -2.410051 -0.21641231 FALSE
#> 5 -2.170984  0.19629381 FALSE
#> 6 -1.643809  0.41330353 FALSE

## Get column coordinates
head(get_coordinates(X, margin = 2))
#>                      F1         F2  .sup
#> Sepal.Length  0.9279900  0.3715504 FALSE
#> Petal.Length  0.9836838 -0.1179661 FALSE
#> Petal.Width   0.9650810 -0.2370306 FALSE
#> Sepal.Width  -0.2984049  0.4680449  TRUE

## Get correlations between variables and dimensions
head(get_correlations(X))
#>                      F1         F2  .sup
#> Sepal.Length  0.9279900  0.3715504 FALSE
#> Petal.Length  0.9836838 -0.1179661 FALSE
#> Petal.Width   0.9650810 -0.2370306 FALSE
#> Sepal.Width  -0.2984049  0.4680449  TRUE

## Get eigenvalues
get_eigenvalues(X)
#>    eigenvalues  variance cumulative
#> F1   2.7601808 92.987665   92.98767
#> F2   0.2081492  7.012335  100.00000