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
)
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.
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 |
Tables can be converted to data frames with asDF
or as.data.frame
. For example:
results$modelSummary$asDF
as.data.frame(results$modelSummary)