Lasso Cox Regression (Penalised Variable Selection) calculator
Fit an L1-penalised (lasso) Cox proportional-hazards model with lambda chosen by cross-validation — the survival model that selects its own covariates, verified against glmnet.
What it does
Cox regression with an L1 (lasso) penalty, which shrinks weak coefficients to EXACTLY zero — so the fit chooses which candidate covariates to keep. The penalty strength is chosen by cross-validation (the 1-SE rule), not by you. Fitted on the Breslow partial likelihood, as glmnet does, and checked against it.
When to use it
You have more candidate covariates than the number of events can support, and the question is which ones matter for predicting the hazard — not what the hazard ratio is for a set you fixed in advance.
Alternatives
- the ordinary Cox model — the covariates were specified before looking at the data and you need hazard ratios with intervals and p-values
- a stratified Cox model — a nuisance variable must be adjusted for without being estimated, or violates proportional hazards
- an interaction in the ordinary Cox model — the question is whether one covariate's effect depends on another
How to read the output
- Kept and dropped
- A coefficient of exactly zero means the penalty dropped that candidate at the chosen λ; a non-zero one means it was kept. The kept set is the finding. Dropped is not 'no effect'. A candidate correlated with a kept one is often dropped despite mattering, and at small event counts the kept set can change with a few rows — selection is for prediction and parsimony, not a verdict on causal importance.
- Coefficient and hazard ratio per SD
- Candidates are standardised before fitting, so each hazard ratio is per ONE STANDARD DEVIATION of that covariate (or for a dummy, per its standardised 0/1 column), and each is shrunk towards 1. Shrinkage is deliberate: these are smaller than the unpenalised hazard ratios would be. Do not quote them as effect sizes; quote the ordinary Cox model's — on fresh data, or with the caveat that they follow selection.
- Why there are no p-values, intervals or Schoenfeld test
- The model selected its own covariates from this outcome. The usual standard errors assume the covariates were fixed in advance, which is exactly what did not happen. Reporting them after selection overstates certainty, so they are omitted rather than shown with a caveat. The 'fit the kept covariates' button refits the ordinary model for convenience; its p-values are optimistic and should be labelled as post-selection.
- λ used and λ minimising deviance
- Two are reported: the λ that minimises the cross-validated partial-likelihood deviance, and the larger '1-SE' λ actually used — the most penalised model whose deviance is within one standard error of the best. The 1-SE rule prefers the simpler model when the data cannot tell it from the best one, which is the conventional choice for selection. The curve shows how flat that region is; a very flat curve means the kept set is not well determined.
How this calculator is validated · Which statistical test should I use?