Learn R Programming

mixOmics (version 4.1-4)

tune.multilevel: Tuning functions for multilevel analyses

Description

These functions were implemented to help tuning the variable selection parameters in the multilevel analyses.

Usage

tune.multilevel(X, Y = NULL, 
                    cond = NULL,
                    sample, 
                    ncomp=1,
                    test.keepX=c(5, 10, 15), 
                    test.keepY=NULL, 
                    already.tested.X = NULL, 
                    already.tested.Y = NULL, 
                    method = NULL, 
                    dist)

Arguments

X
numeric matrix of predictors. NAs are allowed.
Y
if(method = 'spls') numeric vector or matrix of continuous responses (for multi-response models) NAs are allowed.
cond
a factor or a class vector for one-factor discrete outcome, a numeric matrix of 2 columns for two-factor discrete outcome. See Details
sample
a vector indicating the repeated measured on each individual.
ncomp
the number of components to include in the model.
test.keepX
numeric vector for the different number of variables to test from the $X$ data set
test.keepY
If method = 'spls', numeric vector for the different number of variables to test from the $Y$ data set
already.tested.X
if ncomp > 1 numeric vector indicating the number of variables to select rom the $X$ data set on the previous ncomp-1 components
already.tested.Y
if method = 'spls' and if(ncomp > 1) numeric vector indicating the number of variables to select rom the $Y$ data set on the previous ncomp-1 components
method
character string. Which multivariate method and type of analysis to choose, matching one of 'splsda' (Discriminant Analysis) or 'spls' (unsupervised integrative analysis). See Details.
dist
distance metric to use for splsda to estimate the classification error rate, should be a subset of "centroids.dist", "mahalanobis.dist" or "max.dist" (see Details).

Value

  • Depending on the type of analysis performed, a list that contains:
  • errorleave-one-out cross-validation is performed for one-factor sPLS-DA analysis.
  • cor.valuecompute the correlation between latent variables for two-factor sPLS-DA analysis or sPLS.

encoding

latin1

Details

This tuning function should be used to tune the parameters in the multilevel function.

If method = 'splsda', a distance metric must be used, see help(predict.splsda) for details about the distances.

For a sPLS-DA one-factor analysis, leave-one-out cross-validation is performed, internally the training data is decomposed into within-subject variation.

For a sPLS-DA two-factor analysis, the correlation between components from the within-subject variation of X and the cond matrix is computed on the whole data set.

For a sPLS-DA two-factor analysis, the correlation between components from the within-subject variation of X and Y is computed on the whole data set.

References

On multilevel analysis: Liquet, B., Lê Cao, K.-A., Hocini, H. and Thiebaut, R. A novel approach for biomarker selection and the integration of repeated measures experiments from two platforms. Submitted.

Westerhuis, J. A., van Velzen, E. J., Hoefsloot, H. C., and Smilde, A. K. (2010). Multivariate paired data analysis: multilevel PLSDA versus OPLSDA. Metabolomics, 6(1), 119-128.

See Also

multilevel and http://www.math.univ-toulouse.fr/~biostat/mixOmics/ for more details..

Examples

Run this code
## First example: one-factor analysis with sPLS-DA
data(data.simu) # simulated data
result.ex1 = tune.multilevel(data.simu$X,
                               cond = data.simu$stimu,
                               sample = data.simu$sample, 
                               ncomp=2,
                               test.keepX=c(5, 10, 15), 
                               already.tested.X = c(50),
                               method = 'splsda',
                               dist = 'mahalanobis.dist') 

result.ex1

## Second example: two-factor analysis with sPLS-DA
data(liver.toxicity)
dose = liver.toxicity$treatment$Dose.Group
time = liver.toxicity$treatment$Time.Group
dose.time = cbind(dose, time)
repeat.indiv = c(1,2, 1,  2,  1,  2,  1,  2,  3,  3,  4,  3,  4,  3,  4,  4,  5,  6,  5,  5,  6,  5,  6,  7,  7,  8,  6,  7,  8,  7,  8,  8,  9, 10,  9, 10, 11, 9,  9, 10, 11, 12, 12, 10, 11, 12, 11, 12, 13, 14, 13, 14, 13, 14, 13, 14, 15, 16, 15, 16, 15, 16, 15, 16)


result.ex2 = tune.multilevel (liver.toxicity$gene,
                               cond = dose.time,
                               sample = repeat.indiv, 
                               ncomp=2,
                               test.keepX=c(5, 10, 15), 
                               already.tested.X = c(50),
                               method = 'splsda',
			       dist = 'mahalanobis.dist') 
result.ex2

## Third example: one-factor integrative analysis with sPLS
result.ex3 = tune.multilevel (liver.toxicity$gene, liver.toxicity$clinic, 
                               cond = dose,
                               sample = repeat.indiv, 
                               ncomp=2,
                               test.keepX=c(5, 10, 15), 
                               test.keepY=c(2,3), 
                               already.tested.X = c(50), already.tested.Y = c(5),
                               method = 'spls') 

result.ex3

Run the code above in your browser using DataLab