add1summary: Summaries of models when adding a predictor in (generalized)...

View source: R/add1summary.R

add1summaryR Documentation

Summaries of models when adding a predictor in (generalized) linear models

Description

Offers summaries of prospective models as every available predictor in the scope is added to the model.

Usage

add1summary(fit, scope, alpha = 0.05, adjust.method = "fdr", sort.by = "p-value")

Arguments

fit

an lm or glm object representing a model.

scope

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.

alpha

Significance level. Default value is 0.05.

adjust.method

Correction for multiple testing accumulation of error. See p.adjust.

sort.by

The criterion to use to sort the table of prospective models. Must be one of criterion = "AIC", criterion = "BIC", criterion = "r-adj" (adjusted r-square), criterion = "PRESS", and criterion = "p-value" are available. Default is p-value.

Details

max_pvalue indicates the maximum p-value from the multiple t-tests for each predictor.

Value

a table with the possible inclusions and the metrics of the prospective models: AIC, BIC, adj.rsq, PRESS, max_pvalue, max.VIF, and whether it passed the chosen p-value correction.

Author(s)

Jongwook Kim <jongwook226@gmail.com>

Adriano Zanin Zambom <adriano.zambom@gmail.com>

References

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

See Also

SignifReg, add1SignifReg, drop1summary, drop1SignifReg

Examples

##mtcars data is used as an example.
	
data(mtcars)

nullmodel = lm(mpg~1, mtcars)
fullmodel = lm(mpg~., mtcars)
scope = list(lower=formula(nullmodel),upper=formula(fullmodel))
fit1 <- lm(mpg~1, mtcars)
add1summary(fit1, scope = scope)

fit2 <- lm(mpg~disp+cyl+wt+qsec+cyl, data = mtcars)
add1summary(fit2, scope = scope)

SignifReg documentation built on March 22, 2022, 9:05 a.m.