PCA {lpda}R Documentation

Principal Component Analysis

Description

Computes a Principal Component Analysis when both when p>n and when p<=n.

Usage

PCA(X)

Arguments

X

Matrix or data.frame with variables in columns and observations in rows.

Value

eigen

A eigen class object with eigenvalues and eigenvectors of the analysis.

var.exp

A matrix containing the explained variance for each component and the cumulative variance.

scores

Scores of the PCA analysis.

loadings

Loadings of the PCA analysis.

Author(s)

Maria Jose Nueda, mj.nueda@ua.es

Examples

## Simulate data matrix with 500 variables and 10 observations
datasim = matrix(sample(0:100, 5000, replace = TRUE), nrow = 10)
## PCA
myPCA = PCA(datasim)
## Extracting the variance explained by each principal component
myPCA$var.exp

[Package lpda version 1.0.1 Index]