Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

PCA

Principal Component Analysis (PCA)


Description

Performs Principal Component Analysis (PCA) with supplementary individuals, supplementary quantitative variables and supplementary categorical variables. Missing values are replaced by the column mean.

Usage

PCA(
  d,
  scale.unit = TRUE,
  ncp = ncol(d) - length(quanti.sup) - length(quali.sup),
  ind.sup = NULL,
  quanti.sup = NULL,
  quali.sup = NULL,
  row.w = NULL,
  col.w = NULL
)

Arguments

d

A data frame with n rows (individuals) and p columns (numeric variables).

scale.unit

A boolean, if TRUE (value set by default) then data are scaled to unit variance.

ncp

The number of dimensions kept in the results (by default 5).

ind.sup

A vector indicating the indexes of the supplementary individuals.

quanti.sup

A vector indicating the indexes of the quantitative supplementary variables.

quali.sup

A vector indicating the indexes of the categorical supplementary variables.

row.w

An optional row weights (by default, a vector of 1 for uniform row weights); the weights are given only for the active individuals.

col.w

An optional column weights (by default, uniform column weights); the weights are given only for the active variables.

Value

The PCA on the dataset.

See Also

Examples

require (datasets)
data (iris)
PCA (iris, quali.sup = 5)

fdm2id

Data Mining and R Programming for Beginners

v0.9.5
GPL-3
Authors
Alexandre Blansché [aut, cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.