PLS-DA分析R实现

install.packages("mixOmics")

library(mixOmics)

plsda函数

Usage

plsda(X,Y,ncomp = 2,
scale = TRUE,mode = c("regression", "canonical", "invariant", "classic"),tol = 1e-06,max.iter = 100,near.zero.var = FALSE,
logratio="none",  # one of "none", "CLR"

multilevel=NULL,all.outputs = TRUE)

Arguments
X    numeric matrix of predictors. NAs are allowed.

Y    a factor or a class vector for the discrete outcome.

ncomp    the number of components to include in the model. Default to 2.

scale    boleean. If scale = TRUE, each block is standardized to zero means and unit variances (default: TRUE)

mode    character string. What type of algorithm to use, (partially) matching one of "regression", "canonical", "invariant" or "classic". See Details.

tol    Convergence stopping value.

max.iter    integer, the maximum number of iterations.

near.zero.var    boolean, see the internal nearZeroVar function (should be set to TRUE in particular for data with many zero values). Setting this argument to FALSE (when appropriate) will speed up the computations. Default value is FALSE

logratio    one of ('none','CLR') specifies the log ratio transformation to deal with compositional values that may arise from specific normalisation in sequencing dadta. Default to 'none'

multilevel    sample information for multilevel decomposition for repeated measurements. A numeric matrix or data frame indicating the repeated measures on each individual, i.e. the individuals ID. See examples in ?splsda.

all.outputs    boolean. Computation can be faster when some specific (and non-essential) outputs are not calculated. Default = TRUE.

data(breast.tumors)
X <- breast.tumors$gene.exp
Y <- breast.tumors$sample$treatment

plsda.breast <- plsda(X, Y, ncomp = 2)
plotIndiv(plsda.breast, ind.names = TRUE, ellipse = TRUE, legend = TRUE)
PLS-DA分析R实现_第1张图片

 

你可能感兴趣的:(R语言)