mgpca | R Documentation |
Performs a Multigroup PCA analysis in the given multigroup data matrix. Show mgpca graphical output.
mgpca(
mat.to.diag,
mat.x,
cls,
Plot = TRUE,
ncomp = 2,
center = TRUE,
scale = TRUE
)
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. |
If simplify == TRUE class values.
If simplify == FALSE, the result is a list of length
nsim
data.tables.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.