bootWeights: Bootstrap model weights

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/weights-boot.R

Description

Computes model weights using bootstrap.

Usage

1
bootWeights(object, ..., R, rank = c("AICc", "AIC", "BIC"))

Arguments

object, ...

two or more fitted glm objects, or a list of such, or an "averaging" object.

R

the number of replicates.

rank

a character string, specifying the information criterion to use for model ranking. Defaults to AICc.

Details

The models are fitted repeatedly to a resampled data set and ranked using AIC-type criterion. The model weights represent the proportion of replicates when a model has the lowest IC value.

Value

The function returns a numeric vector of model weights.

Author(s)

Kamil Bartoń, Carsten Dormann

See Also

Weights, model.avg

Other model.weights: BGWeights, cos2Weights, jackknifeWeights, stackingWeights

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# To speed up the bootstrap, use 'x = TRUE' so that model matrix is included
#     in the returned object
fm <- glm(Prop ~ mortality + dose, family = binomial, data = Beetle, 
   na.action = na.fail, x = TRUE)

fml <- lapply(dredge(fm, eval = FALSE), eval)
am <- model.avg(fml)

Weights(am) <- bootWeights(am, data = Beetle, R = 25)

summary(am)

MuMIn documentation built on April 17, 2020, 1:14 a.m.