% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparse_pcreg.R
\name{sparse_pcreg}
\alias{sparse_pcreg}
\title{Sparse Principal Component Regression (Sparse PCR)}
\usage{
sparse_pcreg(data, y, K = NULL, threshold = 0.9, verbose = FALSE)
}
\arguments{
\item{data}{A data frame or matrix}

\item{y}{Response variable name (character)}

\item{K}{Number of components (optional)}

\item{threshold}{Variance threshold for automatic K selection}

\item{verbose}{Logical; print messages and summaries}
}
\value{
A list containing model outputs and PCA results
}
\description{
Performs Sparse PCA followed by regression with automatic selection
of number of components. Includes PCA suitability tests, loadings,
regression models, scree plot, and biplot.
}
\examples{
data(mtcars)
Result <- sparse_pcreg(mtcars, y = "mpg")
}
