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.061855  0.29138817 FALSE
#> 2 -2.198033  0.09377921 FALSE
#> 3 -2.367672 -0.08953188 FALSE
#> 4 -2.368839 -0.21693207 FALSE
#> 5 -2.129944  0.19258369 FALSE
#> 6 -1.603889  0.40602302 FALSE

## Get column coordinates
head(get_coordinates(X, margin = 2))
#>                      F1         F2  .sup
#> Sepal.Length  0.9317843  0.3618863 FALSE
#> Petal.Length  0.9846774 -0.1126117 FALSE
#> Petal.Width   0.9661434 -0.2342445 FALSE
#> Sepal.Width  -0.3250032  0.4569390  TRUE

## Get correlations between variables and dimensions
head(get_correlations(X))
#>                      F1         F2  .sup
#> Sepal.Length  0.9317843  0.3618863 FALSE
#> Petal.Length  0.9846774 -0.1126117 FALSE
#> Petal.Width   0.9661434 -0.2342445 FALSE
#> Sepal.Width  -0.3250032  0.4569390  TRUE

## Get eigenvalues
get_eigenvalues(X)
#>    eigenvalues  variance cumulative
#> F1   2.7712448 93.315497    93.3155
#> F2   0.1985136  6.684503   100.0000