Skip to contents

Return variable contributions

Usage

pca_var_contrib(var_cos2, eigs, weighted_col = rep(1, ncol(var_cos2)))

Arguments

var_cos2

variable coordinates

eigs

eigs computed by get_eigen or get_weighted_eigen

weighted_col

column weights

Examples

library(FactoMineR2)

eigs <- iris[, -5] |>
  standardize_norm() |>
  get_weighted_eigen()

eigs |>
  pca_var_coords() |>
  pca_var_cos2() |>
  pca_var_contrib(eigs) |>
  head()
#>                  Dim.1       Dim.2     Dim.3     Dim.4
#> Sepal.Length 27.150969 14.24440565 51.777574  6.827052
#> Sepal.Width   7.254804 85.24748749  5.972245  1.525463
#> Petal.Length 33.687936  0.05998389  2.019990 64.232089
#> Petal.Width  31.906291  0.44812296 40.230191 27.415396