% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_opls_model_perm.R
\name{.permYmod}
\alias{.permYmod}
\title{OPLS Y-permutation Modeling}
\usage{
.permYmod(XcsTot, Y, cv, type, nc_o)
}
\arguments{
\item{XcsTot}{Numeric matrix. Input data matrix (samples x features).}

\item{Y}{Numeric matrix. Response variable (numeric or dummy-coded).}

\item{cv}{List. Cross-validation parameters, including \code{method} and \code{cv_sets}.}

\item{type}{Character. Model type: \code{"DA"}, \code{"R"}, possibly with \code{"-mY"} suffix for multi-column Y.}

\item{nc_o}{Integer. Number of orthogonal components to be fitted.}
}
\value{
List with elements:
\itemize{
\item \code{r2_comp}: Numeric, R2 statistic for test data.
\item \code{q2_comp}: Numeric, Q2 statistic from cross-validation.
\item \code{aucs_tr}: Numeric, AUROC on training data (for classification only).
\item \code{aucs_te}: Numeric, AUROC on test data (for classification only).
}
}
\description{
Performs OPLS modeling on permuted Y to estimate cross-validated model performance under the null hypothesis.
Extracts predictive performance (R2, Q2, AUROC) from cross-validation for either regression or classification.
}
\details{
When \code{nc_o > 1}, the function fits additional orthogonal components sequentially, updating the model object.
Classification performance is computed using AUROC (via \code{pROC}). Regression performance uses R2 and Q2.
}
\keyword{internal}
