% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_opls_model_perm.R
\name{opls_perm}
\alias{opls_perm}
\title{OPLS Model Validation via Y-Permutation}
\usage{
opls_perm(smod, n = 10, plot = TRUE, mc = FALSE)
}
\arguments{
\item{smod}{An OPLS model object of class \code{OPLS_metabom8}.}

\item{n}{Integer. Number of permutations to perform.}

\item{plot}{Logical. If \code{TRUE}, generates a visual summary of permutation statistics.}

\item{mc}{Logical. If \code{TRUE}, enables multicore processing (currently not implemented).}
}
\value{
A \code{data.frame} with model metrics (e.g., R2, Q2, AUROC) from both permuted and original models.
}
\description{
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. \emph{Journal of Chemometrics}, 22(11–12), 594–600.
}
\seealso{
Other model_validation: 
\code{\link{cv_anova}()},
\code{\link{dmodx}()}
}
\concept{model_validation}
