Skip to contents

Perform data standardization for multivariate exploratory data analysis.

Usage

standardize_norm(X, center = TRUE, scale = TRUE)

standardize(X, scale = TRUE, weighted_row = rep(1, nrow(X))/nrow(X))

Arguments

X

matrix

center

centering by the mean

scale

scaling by the standard deviation

weighted_row

row weights

Details

Standardization depends on what you need to perform factor analysis. Two methods are implemented:

  • standardize: standardization is performed by centering the data matrix and dividing by the square root of the sum of squares of the weights. This is the same method used in FactoMineR::PCA().

  • standardize_norm: standardization is performed by centering and scaling the data matrix. (X - µ) / σ, where µ is the mean and σ is the standard deviation.

Examples

library(FactoMineR2)

iris[, -5] |>
  standardize_norm() |>
  head()
#>      Sepal.Length Sepal.Width Petal.Length Petal.Width
#> [1,]   -0.8976739  1.01560199    -1.335752   -1.311052
#> [2,]   -1.1392005 -0.13153881    -1.335752   -1.311052
#> [3,]   -1.3807271  0.32731751    -1.392399   -1.311052
#> [4,]   -1.5014904  0.09788935    -1.279104   -1.311052
#> [5,]   -1.0184372  1.24503015    -1.335752   -1.311052
#> [6,]   -0.5353840  1.93331463    -1.165809   -1.048667