perm_test: Permutation test for PLS and PLS-DA models

View source: R/perm_test.R

perm_testR Documentation

Permutation test for PLS and PLS-DA models

Description

Permutation test for PLS and PLS-DA models. The Y variable is permutated and a model is then fitted. From this model the R2Ycum and Q2cum are calculated.

Usage

perm_test(pls_model, perm = 200, scale = FALSE)

Arguments

pls_model

The PLS or PLS-DA model created by the pls package

perm

number of permutations (default = 200)

scale

should scaling be used. Use the same settings as used in the original model (see details).

Details

The scaling for the PLS / PLS-DA model has to be given to the function. At the moment this can not be retrieved from the original model. The function sample() is used to randomize the Y variable. With set.seed() the random generator is seeded based on the current date time.

Value

Output is a plot showing the results.

Author(s)

Rico Derks


ricoderks/Rcpm documentation built on May 18, 2022, 7:49 a.m.