Skip to contents

Perform data standardization for multivariate exploratory data analysis.

Usage

ca_standardize(X, weighted_row = rep(1, nrow(X)))

ca_standardize_sup(X, type = c("row", "col"), weighted_row = rep(1, nrow(X)))

Arguments

X

Active or supplementary datasets

weighted_row

row weights

type

standardization for supplementary rows or cols

Examples

library(FactoMineR2)

mtcars[, c(2, 8:11)] |>
  ca_standardize()
#> $CA_scaled
#>                             cyl        vs         am         gear        carb
#> Mazda RX4           -0.12525253 -1.000000  1.2205128 -0.021468927  0.28296296
#> Mazda RX4 Wag       -0.12525253 -1.000000  1.2205128 -0.021468927  0.28296296
#> Datsun 710          -0.20477502  1.811688  2.0279720  0.334360555 -0.56262626
#> Hornet 4 Drive       0.19283747  1.811688 -1.0000000  0.000770416 -0.56262626
#> Hornet Sportabout    0.34576535 -1.000000 -1.0000000 -0.153194263 -0.25982906
#> Valiant              0.19283747  1.811688 -1.0000000  0.000770416 -0.56262626
#> Duster 360           0.16632997 -1.000000 -1.0000000 -0.266101695  0.28296296
#> Merc 240D           -0.20477502  1.811688 -1.0000000  0.334360555 -0.12525253
#> Merc 230            -0.20477502  1.811688 -1.0000000  0.334360555 -0.12525253
#> Merc 280            -0.12525253  1.061905 -1.0000000 -0.021468927  0.28296296
#> Merc 280C           -0.12525253  1.061905 -1.0000000 -0.021468927  0.28296296
#> Merc 450SE           0.24963925 -1.000000 -1.0000000 -0.213680387  0.03095238
#> Merc 450SL           0.24963925 -1.000000 -1.0000000 -0.213680387  0.03095238
#> Merc 450SLC          0.24963925 -1.000000 -1.0000000 -0.213680387  0.03095238
#> Cadillac Fleetwood   0.16632997 -1.000000 -1.0000000 -0.266101695  0.28296296
#> Lincoln Continental  0.16632997 -1.000000 -1.0000000 -0.266101695  0.28296296
#> Chrysler Imperial    0.16632997 -1.000000 -1.0000000 -0.266101695  0.28296296
#> Fiat 128            -0.20477502  1.811688  2.0279720  0.334360555 -0.56262626
#> Honda Civic         -0.27104377  1.577381  1.7756410  0.223163842 -0.19814815
#> Toyota Corolla      -0.20477502  1.811688  2.0279720  0.334360555 -0.56262626
#> Toyota Corona       -0.02805836  2.436508 -1.0000000  0.223163842 -0.46543210
#> Dodge Challenger     0.34576535 -1.000000 -1.0000000 -0.153194263 -0.25982906
#> AMC Javelin          0.34576535 -1.000000 -1.0000000 -0.153194263 -0.25982906
#> Camaro Z28           0.16632997 -1.000000 -1.0000000 -0.266101695  0.28296296
#> Pontiac Firebird     0.34576535 -1.000000 -1.0000000 -0.153194263 -0.25982906
#> Fiat X1-9           -0.20477502  1.811688  2.0279720  0.334360555 -0.56262626
#> Porsche 914-2       -0.27104377 -1.000000  1.7756410  0.528954802 -0.19814815
#> Lotus Europa        -0.32711733  1.379121  1.5621302  0.411342894 -0.25982906
#> Ford Pantera L      -0.02805836 -1.000000  0.8504274  0.019303202  0.06913580
#> Ferrari Dino        -0.27104377 -1.000000  0.8504274  0.019303202  0.60370370
#> Maserati Bora       -0.20477502 -1.000000  0.5139860 -0.166024653  0.74949495
#> Volvo 142E          -0.27104377  1.577381  1.7756410  0.223163842 -0.19814815
#> 
#> $weighted_row
#>           Mazda RX4       Mazda RX4 Wag          Datsun 710      Hornet 4 Drive 
#>          0.03464203          0.03464203          0.02540416          0.02540416 
#>   Hornet Sportabout             Valiant          Duster 360           Merc 240D 
#>          0.03002309          0.02540416          0.03464203          0.02540416 
#>            Merc 230            Merc 280           Merc 280C          Merc 450SE 
#>          0.02540416          0.03464203          0.03464203          0.03233256 
#>          Merc 450SL         Merc 450SLC  Cadillac Fleetwood Lincoln Continental 
#>          0.03233256          0.03233256          0.03464203          0.03464203 
#>   Chrysler Imperial            Fiat 128         Honda Civic      Toyota Corolla 
#>          0.03464203          0.02540416          0.02771363          0.02540416 
#>       Toyota Corona    Dodge Challenger         AMC Javelin          Camaro Z28 
#>          0.02078522          0.03002309          0.03002309          0.03464203 
#>    Pontiac Firebird           Fiat X1-9       Porsche 914-2        Lotus Europa 
#>          0.03002309          0.02540416          0.02771363          0.03002309 
#>      Ford Pantera L        Ferrari Dino       Maserati Bora          Volvo 142E 
#>          0.04157044          0.04157044          0.05080831          0.02771363 
#> 
#> $weighted_col
#>        cyl         vs         am       gear       carb 
#> 0.45727483 0.03233256 0.03002309 0.27251732 0.20785219 
#>