Learn R Programming

MuMIn (version 1.42.1)

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.

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.

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.

References

Yang Y. (2001) Adaptive Regression by Mixing. Journal of the American Statistical Association 96: 574<U+2013>588.

Yang Y. (2003) Regression with multiple candidate models: selecting or mixing? Statistica Sinica 13: 783<U+2013>810.

See Also

model.avg, par.avg

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

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

Other kinds of model weights: BGWeights, bootWeights, cos2Weights, jackknifeWeights, stackingWeights.

Examples

Run this code
# NOT RUN {
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)


# }

Run the code above in your browser using DataLab