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
outcomeconsidered 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$todo | a html | ||||
results$modelSummary | a table | ||||
results$coefficients | a table | ||||
results$performance | a table | ||||
results$cv_plot | an image | ||||
results$coef_plot | an image | ||||
results$survival_plot | an image | ||||
results$riskScore | an output | ||||
results$lassoExplanation | a html | ||||
results$methodologyNotes | a html | ||||
results$clinicalGuidance | a html | ||||
results$variableImportance | a table | ||||
results$modelComparison | a table | ||||
results$regularizationPathExplanation | a html | ||||
results$crossValidationExplanation | a html | ||||
results$riskScoreExplanation | a html |
Tables can be converted to data frames with asDF or as.data.frame. For example:
results$modelSummary$asDF
as.data.frame(results$modelSummary)