Measures how consistently each predictor is selected across perturbation iterations. The definition depends on the modeling backend:
Arguments
- diag_obj
A
reprostatobject fromrun_diagnostics.
Details
"lm","glm","rlm"Sign consistency: the proportion of perturbation iterations in which the estimated coefficient has the same sign as in the base fit. A value of 1 means the direction of the effect is perfectly stable; 0.5 means the sign is random. Returns
NAfor a predictor whose base-fit coefficient is exactly zero."glmnet"Non-zero selection frequency: the proportion of perturbation iterations in which the coefficient is non-zero (i.e. the variable survives the regularisation penalty).
The intercept is always excluded.
Examples
set.seed(1)
d <- run_diagnostics(mpg ~ wt + hp, data = mtcars, B = 50)
selection_stability(d)
#> wt hp
#> 1 1