Learn R Programming

MVar (version 2.0.4)

PCA: Principal Components Analysis (PCA).

Description

Performs principal component analysis (PCA) in a data set.

Usage

PCA(Data, Type = 1)

Arguments

Data

Data to be analyzed.

Type

1 for analysis using the covariance matrix (default), 2 for analysis using the correlation matrix.

Value

MatrixMC

Matrix of covariance or correlation according to "Type".

MatrixAutoVlr

Matrix of eigenvalues (variances) with the proportions and proportions accumulated.

MatrixAutoVec

Matrix of eigenvectors - principal components.

MatrixVCP

Matrix of covariance of the principal components with the original variables.

MatrixCCP

Matrix of correlation of the principal components with the original variables.

MatrixEsc

Matrix with scores of the principal components.

References

HOTELLING, H. Analysis of a complex of statistical variables into principal components. Journal of Educational Psychology, Arlington, v. 24, p. 417-441, Sept. 1933.

MINGOTI, S. A. Analise de dados atraves de metodos de estatistica multivariada: uma abordagem aplicada. Belo Horizonte: UFMG, 2005. 297 p.

FERREIRA, D. F. Estatistica Multivariada. 2a ed. revisada e ampliada. Lavras: Editora UFLA, 2011. 676 p.

RENCHER, A. C. Methods of Multivariate Analysis. 2th. ed. New York: J.Wiley, 2002. 708 p.

See Also

Plot.PCA

Examples

Run this code
# NOT RUN {
data(DataQuan) # set of quantitative data

Data <- DataQuan[,2:8]

rownames(Data) <- DataQuan[1:nrow(DataQuan),1]

PC <- PCA(Data, 2) # performs the PCA

print("Covariance matrix / Correlation:"); round(PC$MatrixMC,2)

print("Principal Components:"); round(PC$MatrixAutoVec,2)

print("Principal Component Variances:"); round(PC$MatrixAutoVlr,2)

print("Covariance of the Principal Components:"); round(PC$MatrixVCP,2)

print("Correlation of the Principal Components:"); round(PC$MatrixCCP,2)

print("Scores of the Principal Components:"); round(PC$MatrixEsc,2)
# }

Run the code above in your browser using DataLab