Performs Y-permutation tests to assess the robustness of OPLS models by comparing model performance statistics on real vs. permuted response labels.
Details
Each permutation shuffles the response labels and fits a new OPLS model. The function captures model statistics (R2, Q2, AUC) to compare against the non-permuted model. This helps determine whether the original model performance is better than expected by chance.
References
Wiklund, S. et al. (2008). A Tool for Improved Validation of OPLS Models. Journal of Chemometrics, 22(11–12), 594–600.
Examples
data(covid)
X <- covid$X
an <- covid$an
model <- opls(X, Y = an$type)
#> Performing discriminant analysis.
#> Reducing k to 5 due to small group size (min n = 5).
#> An O-PLS-DA model with 1 predictive and 1 orthogonal components was fitted.
perm_results <- opls_perm(model, n = 10)
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.
#> Warning: Deprecated use a matrix as predictor. Unexpected results may be produced, please pass a numeric vector.