coxEN {Coxmos}R Documentation

coxEN

Description

This function performs a cox elastic net model (based on glmnet R package). The function returns a Coxmos model with the attribute model as "coxEN".

Usage

coxEN(
  X,
  Y,
  EN.alpha = 0.5,
  max.variables = 15,
  x.center = TRUE,
  x.scale = FALSE,
  remove_near_zero_variance = TRUE,
  remove_zero_variance = FALSE,
  toKeep.zv = NULL,
  remove_non_significant = FALSE,
  alpha = 0.05,
  MIN_EPV = 5,
  returnData = TRUE,
  verbose = FALSE
)

Arguments

X

Numeric matrix or data.frame. Explanatory variables. Qualitative variables must be transform into binary variables.

Y

Numeric matrix or data.frame. Response variables. Object must have two columns named as "time" and "event". For event column, accepted values are: 0/1 or FALSE/TRUE for censored and event observations.

EN.alpha

Numeric. Elastic net mixing parameter. If EN.alpha = 1 is the lasso penalty, and EN.alpha = 0 the ridge penalty (default: 0.5). NOTE: When ridge penalty is used, EVP and max.variables will not be used.

max.variables

Numeric. Maximum number of variables you want to keep in the cox model. If MIN_EPV is not meet, the value will be change automatically (default: 20).

x.center

Logical. If x.center = TRUE, X matrix is centered to zero means (default: TRUE).

x.scale

Logical. If x.scale = TRUE, X matrix is scaled to unit variances (default: FALSE).

remove_near_zero_variance

Logical. If remove_near_zero_variance = TRUE, near zero variance variables will be removed (default: TRUE).

remove_zero_variance

Logical. If remove_zero_variance = TRUE, zero variance variables will be removed (default: TRUE).

toKeep.zv

Character vector. Name of variables in X to not be deleted by (near) zero variance filtering (default: NULL).

remove_non_significant

Logical. If remove_non_significant = TRUE, non-significant variables/components in final cox model will be removed until all variables are significant by forward selection (default: FALSE).

alpha

Numeric. Numerical values are regarded as significant if they fall below the threshold (default: 0.05).

MIN_EPV

Numeric. Minimum number of Events Per Variable (EPV) you want reach for the final cox model. Used to restrict the number of variables/components can be computed in final cox models. If the minimum is not meet, the model cannot be computed (default: 5).

returnData

Logical. Return original and normalized X and Y matrices (default: TRUE).

verbose

Logical. If verbose = TRUE, extra messages could be displayed (default: FALSE).

Details

The coxEN function is designed to handle survival data using the elastic net regularization. The function is particularly useful when dealing with high-dimensional datasets where the number of predictors exceeds the number of observations. The elastic net regularization combines the strengths of both lasso and ridge regression. The EN.alpha parameter controls the balance between lasso and ridge penalties. It's important to note that when using the ridge penalty (EN.alpha = 0), the EVP and max.variables parameters will not be considered.

Value

Instance of class "Coxmos" and model "coxEN". The class contains the following elements: X: List of normalized X data information.

Y: List of normalized Y data information.

survival_model: List of survival model information.

opt.lambda: Optimal lambda computed by the model with maximum % Var from glmnet function.

EN.alpha: EN.alpha selected

n.var: Number of variables selected

call: call function

X_input: X input matrix

Y_input: Y input matrix

convergence_issue: If any convergence issue has been found.

alpha: alpha value selected

selected_variables_cox: Variables selected to enter the cox model.

nsv: Variables removed by cox alpha cutoff.

removed_variables_correlation: Variables removed by being high correlated with other variables.

nzv: Variables removed by remove_near_zero_variance or remove_zero_variance.

nz_coeffvar: Variables removed by coefficient variation near zero.

class: Model class.

time: time consumed for running the cox analysis.

Author(s)

Pedro Salguero Garcia. Maintainer: pedsalga@upv.edu.es

References

Simon N, Friedman JH, Friedman JH, Hastie T, Tibshirani R (2011). “Regularization Paths for Cox's Proportional Hazards Model via Coordinate Descent.” Journal of Statistical Software. doi:10.18637/jss.v039.i05, https://pubmed.ncbi.nlm.nih.gov/27065756/.

Examples

data("X_proteomic")
data("Y_proteomic")
X <- X_proteomic[,1:50]
Y <- Y_proteomic
coxEN(X, Y, EN.alpha = 0.75, x.center = TRUE, x.scale = TRUE, remove_non_significant = TRUE)

[Package Coxmos version 1.0.2 Index]