Learn R Programming

MultiGroupO (version 0.4.0)

mgpca: Performs a Multigroup PCA analysis in the given multigroup data matrix. Show mgpca graphical output.

Description

Performs a Multigroup PCA analysis in the given multigroup data matrix. Show mgpca graphical output.

Usage

mgpca(
  mat.to.diag,
  mat.x,
  cls,
  Plot = TRUE,
  ncomp = 2,
  center = TRUE,
  scale = TRUE
)

Value

If simplify == TRUE class values.

If simplify == FALSE, the result is a list of length

nsim data.tables.

Arguments

mat.to.diag

is a matrix with the data

mat.x

is a vector of classes

cls

group

Plot

grafics output of mgpca

ncomp

number of component

center

is a logical vector where TRUE is center (whether the variables should be shifted to be zero centered), if is FALSE, is original data.

scale

is a logical vector where TRUE is scale (indicating whether the variables should be scaled), if is FALSE, is original data.

Examples

Run this code
library(plsgenomics)
data(SRBCT)
mydata<-SRBCT$X
mydata<-mydata[1:50,1:5]
groups<-as.factor(SRBCT$Y)[1:50]
mat.to.diag1<-new.cov(x=mydata,cls=groups,A=diag(ncol(mydata)))
mgpca(mat.to.diag=mat.to.diag1,mat.x=as.matrix(mydata),
cls=groups,Plot=TRUE,ncomp=2,center = TRUE,scale = TRUE)

Run the code above in your browser using DataLab