Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

arm.glm

Adaptive Regression by Mixing


Description

Combine all-subsets GLMs using the ARM algorithm. Calculate ARM weights for a set of models.

Usage

arm.glm(object, R = 250, weight.by = c("aic", "loglik"), trace = FALSE)

armWeights(object, ..., data, weight.by = c("aic", "loglik"), R = 1000)

Arguments

object

for arm.glm, a fitted “global” glm object. For armWeights, a fitted glm object, or a list of such, or an "averaging" object.

...

more fitted model objects.

R

number of permutations.

weight.by

indicates whether model weights should be calculated with AIC or log-likelihood.

trace

if TRUE, information is printed during the running of arm.glm.

data

a data frame in which to look for variables for use with prediction. If omitted, the fitted linear predictors are used.

Details

For each of all-subsets of the “global” model, parameters are estimated using randomly sampled half of the data. Log-likelihood given the remaining half of the data is used to calculate AIC weights. This is repeated R times and mean of the weights is used to average all-subsets parameters estimated using complete data.

Value

arm.glm returns an object of class "averaging" contaning only “full” averaged coefficients. See model.avg for object description.

armWeights returns a numeric vector of model weights.

Note

Number of parameters is limited to floor(nobs(object) / 2) - 1. All-subsets respect marginality constraints.

Author(s)

Kamil Bartoń

References

Yang Y. (2001) Adaptive Regression by Mixing. Journal of the American Statistical Association 96: 574–588.

Yang Y. (2003) Regression with multiple candidate models: selecting or mixing? Statistica Sinica 13: 783–810.

See Also

Weights for assigning new model weights to an "averaging" object.

Other implementation of ARM algorithm: arms in (archived) package MMIX.

Examples

fm <- glm(y ~ X1 + X2 + X3 + X4, data = Cement)

summary(am1 <- arm.glm(fm, R = 15))

mst <- dredge(fm)

am2 <- model.avg(mst, fit = TRUE)

Weights(am2) <- armWeights(am2, data = Cement, R = 15)

# differences are due to small R:
coef(am1, full = TRUE)
coef(am2, full = TRUE)

MuMIn

Multi-Model Inference

v1.43.17
GPL-2
Authors
Kamil Bartoń
Initial release
2020-04-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.