pca: Principal Components Analysis

Description Usage Arguments Value Author(s) References See Also Examples

Description

Computes a principal components analysis based on the singular value decomposition.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pca(object, ...)

## S4 method for signature 'data.frame'
pca(
  object,
  center = TRUE,
  scale = TRUE,
  rank = NULL,
  sup_row = NULL,
  sup_col = NULL,
  weight_row = NULL,
  weight_col = NULL
)

## S4 method for signature 'matrix'
pca(
  object,
  center = TRUE,
  scale = TRUE,
  rank = NULL,
  sup_row = NULL,
  sup_col = NULL,
  weight_row = NULL,
  weight_col = NULL
)

Arguments

object

A m x p numeric matrix or a data.frame.

...

Currently not used.

center

A logical scalar: should the variables be shifted to be zero centered?

scale

A logical scalar: should the variables be scaled to unit variance?

rank

An integer value specifying the maximal number of components to be kept in the results. If NULL (the default), p - 1 components will be returned.

sup_row

A numeric or logical vector specifying the indices of the supplementary rows (individuals).

sup_col

A numeric or logical vector specifying the indices of the supplementary columns (variables).

weight_row

A numeric vector specifying the active row (individual) weights. If NULL (the default), no weights are used.

weight_col

A numeric vector specifying the active column (variable) weights. If NULL (the default), no weights are used.

Value

A PCA object.

Author(s)

N. Frerebeau

References

Lebart, L., Piron, M. and Morineau, A. Statistique exploratoire multidimensionnelle: visualisation et inférence en fouille de données. Paris: Dunod, 2006.

See Also

get_*(), stats::predict(), svd()

Other multivariate analysis: ca(), predict()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Load data
data("compiegne", package = "folio")

## Compute principal components analysis
X <- pca(compiegne, scale = TRUE, sup_col = 7:10)

## Get row coordinates
get_coordinates(X, margin = 1)

## Get column coordinates
get_coordinates(X, margin = 2)

## Get row contributions
get_contributions(X, margin = 1)

## Get correlations between variables and dimensions
get_correlations(X)

## Get eigenvalues
get_eigenvalues(X)

dimensio documentation built on Sept. 18, 2021, 5:06 p.m.