% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/stats_model_helpers.R
\name{.prepareY}
\alias{.prepareY}
\title{Prepare Response Vector for OPLS/OPLS-DA}
\usage{
.prepareY(Y)
}
\arguments{
\item{Y}{A numeric, factor, or character vector.}
}
\value{
A list with:
\describe{
\item{\code{[[1]]}}{Numeric matrix of processed response.}
\item{\code{[[2]]}}{Data frame mapping class labels to encoding (empty for numeric input).}
}
}
\description{
Converts a response vector \code{Y} into a numeric matrix suitable for regression or classification models.
\itemize{
\item Numeric input is returned as a column matrix.
\item Factor or character input:
\itemize{
\item If binary (2 levels): returns a single numeric column (values 1 and 2).
\item If multiclass (>2 levels): returns a dummy matrix with 1 for presence and -1 for absence.
Also returns a mapping between original labels and numeric values (only for categorical input).
}
}
}
\keyword{internal}
