mgPCA: Multigroup Principal Component Analysis

Description Usage Arguments Value References See Also Examples

View source: R/mgPCA.R

Description

Multigroup PCA algorithm (NIPALS for Multigroup PCA)

Usage

1
mgPCA(Data, Group, ncomp = NULL, Scale = FALSE, graph = FALSE)

Arguments

Data

a numeric matrix or data frame

Group

a vector of factors associated with group structure

ncomp

number of components, if NULL number of components is equal to 2

Scale

scaling variables, by defalt is FALSE. By default data are centered within groups

graph

should loading and component be plotted

Value

list with the following results:

Data

Original data

Con.Data

Concatenated centered data

split.Data

Group centered data

Group

Group as a factor vector

loadings.group

Loadings associated with each group

score.group

Scores associated with each group

loadings.common

Matrix of common loadings

score.Global

Global scores

cumper.inertigroup

Cumulative percentage of group components inertia

cumper.inertiglobal

Cumulative percentage of global component inertia

noncumper.inertiglobal

Percentage of global component inertia

lambda

The specific variances of groups

exp.var

Percentages of total variance recovered associated with each dimension

Similarity.Common.Group.load

Cumulative similarity between group and common loadings

Similarity.noncum.Common.Group.load

NonCumulative similarity between group and common loadings

References

A. Eslami, E. M. Qannari, A. Kohler and S. Bougeard (2013). General overview of methods of analysis of multi-group datasets, Revue des Nouvelles Technologies de l'Information, 25, 108-123.

A. Eslami, E. M. Qannari, A. Kohler and S. Bougeard (2013). Analyses factorielles de donnces structurces en groupes d'individus, Journal de la Societe Francaise de Statistique, 154(3), 44-57.

See Also

BGC, FCPCA, DCCSWA, DSTATIS, DGPA, summarize, TBWvariance, loadingsplot, scoreplot, iris

Examples

 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
26
Data = iris[,-5]
Group = iris[,5]
res.mgPCA = mgPCA (Data, Group)
barplot(res.mgPCA$noncumper.inertiglobal)
#----------------
#Similarity index: group loadings are compared to the common structure (first dimension)
Xzero = rep(0, 3)
MIN = min(res.mgPCA$Similarity.noncum.Common.Group.load[[1]][-1, 1])-0.0005
XLAB = paste("Dim1, %",res.mgPCA$noncumper.inertiglobal[1])
plot(Xzero, res.mgPCA$Similarity.noncum.Common.Group.load[[1]][-1, 1], pch=15, ylim=c(MIN, 1), 
main="Similarity between groups and common structure", xlab=XLAB, ylab="", xaxt="n")
abline(v=0)
abline(h=seq(MIN, 1, by=0.05), col="black", lty=3)
XX=res.mgPCA$Similarity.noncum.Common.Group.load[[1]][-1, 1, drop=FALSE]
text(Xzero, XX, labels=rownames(XX), pos=4)
#----------------
# Similarity index: group loadings are compared to the common structure (dimensions 1 and 2)
XX1=res.mgPCA$Similarity.noncum.Common.Group.load[[1]][-1, 1]
XX2=res.mgPCA$Similarity.noncum.Common.Group.load[[2]][-1, 1]
simil <- cbind(XX1, XX2)
YLAB = paste("Dim1, %",res.mgPCA$noncumper.inertiglobal[2])
plot(simil, xlab=XLAB, ylab=YLAB, main="Similarity between groups and common structure", pch=20)
text(simil, labels=rownames(simil), cex=1, font.lab=1, pos=3)
#------------------
loadingsplot(res.mgPCA, axes=c(1,2), INERTIE=res.mgPCA$noncumper.inertiglobal)
scoreplot(res.mgPCA, axes=c(1,2))

Example output



multigroup documentation built on March 26, 2020, 5:50 p.m.

Related to mgPCA in multigroup...