% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/screener.R
\name{screen.elasticnet}
\alias{screen.elasticnet}
\title{Elastic Net Screening Algorithm}
\usage{
screen.elasticnet(
  time,
  event,
  X,
  obsWeights = NULL,
  alpha = 0.5,
  minscreen = 2,
  nfolds = 10,
  nlambda = 100,
  ...
)
}
\arguments{
\item{time}{Numeric vector of observed follow-up times.}

\item{event}{Numeric vector of event indicators (1 = event, 0 = censored).}

\item{X}{Training covariate data.frame or matrix.}

\item{obsWeights}{Numeric vector of observation weights.}

\item{alpha}{Numeric penalty exponent for \code{glmnet}. Defaults to 0.5 (Elastic Net).}

\item{minscreen}{Integer. Minimum number of covariates to return. Defaults to 2.}

\item{nfolds}{Integer. Number of folds for cross-validation. Defaults to 10.}

\item{nlambda}{Integer. Number of penalty parameters to search over. Defaults to 100.}

\item{...}{Additional arguments passed to \code{screen.glmnet}.}
}
\value{
A logical vector of the same length as the number of columns in \code{X},
indicating which variables passed the screening algorithm (\code{TRUE} to keep,
\code{FALSE} to drop).
}
\description{
This screening algorithm uses \code{\link[glmnet]{cv.glmnet}} to select covariates.
Unlike LASSO (\code{alpha = 1}), which drops correlated features, Elastic Net
(\code{alpha = 0.5} by default) shrinks correlated groups of features together,
making it ideal for selecting entire biological pathways.
}
\examples{
if (requireNamespace("glmnet", quietly = TRUE)) {
  data("metabric", package = "SuperSurv")
  dat <- metabric[1:40, ]
  x_cols <- grep("^x", names(dat))[1:5]
  X <- dat[, x_cols, drop = FALSE]

  screen.elasticnet(
    time = dat$duration,
    event = dat$event,
    X = X,
    alpha = 0.5,
    minscreen = 2,
    nfolds = 3,
    nlambda = 20
  )
}
}
