Skip to contents

Performs Lasso-penalized Cox regression for variable selection in survival analysis.

Usage

lassocox(
  data,
  elapsedtime,
  outcome,
  outcomeLevel,
  explanatory,
  lambda = "lambda.1se",
  nfolds = 10,
  standardize = TRUE,
  cv_plot = TRUE,
  coef_plot = TRUE,
  survival_plot = TRUE,
  showExplanations = FALSE,
  showMethodologyNotes = FALSE,
  includeClinicalGuidance = FALSE,
  showVariableImportance = FALSE,
  showModelComparison = FALSE
)

Arguments

data

The data as a data frame.

elapsedtime

The numeric variable representing follow-up time until the event or last observation.

outcome

The outcome variable. Typically indicates event status (e.g., death, recurrence).

outcomeLevel

The level of outcome considered as the event.

explanatory

Variables to be considered for selection in the Lasso-Cox regression.

lambda

Method for selecting the optimal lambda parameter from cross-validation.

nfolds

Number of folds for cross-validation.

standardize

Whether to standardize predictor variables before fitting.

cv_plot

Whether to show the cross-validation plot.

coef_plot

Whether to show the coefficient path plot.

survival_plot

Whether to show survival curves by risk groups.

showExplanations

Display detailed explanations of LASSO Cox regression methodology, including regularization concepts and interpretation guidance.

showMethodologyNotes

Show comprehensive technical notes about LASSO regularization, cross-validation, and variable selection process.

includeClinicalGuidance

Include guidance for clinical interpretation of LASSO Cox regression results, risk scores, and variable selection outcomes.

showVariableImportance

Display analysis of variable importance rankings and selection patterns across different lambda values.

showModelComparison

Compare LASSO Cox results with standard Cox regression to demonstrate the benefits of regularization and variable selection.

Value

A results object containing:

results$todoa html
results$modelSummarya table
results$coefficientsa table
results$performancea table
results$cv_plotan image
results$coef_plotan image
results$survival_plotan image
results$riskScorean output
results$lassoExplanationa html
results$methodologyNotesa html
results$clinicalGuidancea html
results$variableImportancea table
results$modelComparisona table
results$regularizationPathExplanationa html
results$crossValidationExplanationa html
results$riskScoreExplanationa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$modelSummary$asDF

as.data.frame(results$modelSummary)

Examples

# \donttest{
# example will be added
# }