drop1SignifReg removes from the model the predictor, out of the current predictors, which minimizes the criterion (AIC, BIC, r-ajd, PRESS, max p-value) when a) the p-values of the predictors in the current model do not pass the multiple testing correction (Bonferroni, FDR, None, etc) or b) when the p-values of both current and prospective models pass the correction but the criterion of the prospective model is smaller.
max_pvalue
indicates the maximum p-value from the multiple t-tests for each predictor. More specifically, the algorithm computes the prospective models with each predictor included, and all p-values of this prospective model. Then, the predictor selected to be added to the model is the one whose generating model has the smallest p-values, in fact, the minimum of the maximum p-values in each prospective model.
drop1SignifReg(fit, scope, alpha = 0.05, criterion = "p-value",
adjust.method = "fdr", override = FALSE, print.step = FALSE)
an lm or glm object representing a model.
defines the range of models examined in the stepwise search. This should be either a single formula, or a list containing components upper and lower, both formulae. See the details for how to specify the formulae and how they are used.
Significance level. Default value is 0.05.
Criterion to select predictor variables. criterion = "AIC"
,
criterion = "BIC"
, criterion = "r-adj"
(adjusted r-square), criterion = "PRESS"
, and criterion = "p-value"
are available. Default is p-value.
Correction for multiple testing accumulation of error. See p.adjust
.
If override = TRUE
, it returns a new lm
or glm
object that adds a new variable according to criterion even if the new model does not pass the multiple testing p-value correction.
If true, information is printed for each step of variable selection.
Default is FALSE
.
drop1SifnifReg returns an object of the class lm
or glm
for a generalized regression model with the additional component steps.info
, which shows the steps taken during the variable selection and model metrics: Deviance, Resid.Df, Resid.Dev, AIC, BIC, adj.rsq, PRESS, max_pvalue, max.VIF, and whether it passed the chosen p-value correction.
Zambom A Z, Kim J. Consistent significance controlled variable selection in high-dimensional regression. Stat.2018;7:e210. https://doi.org/10.1002/sta4.210
# NOT RUN {
##mtcars data is used as an example.
data(mtcars)
fit <- lm(mpg~., mtcars)
drop1SignifReg(fit, print.step = TRUE)
# }
Run the code above in your browser using DataLab