Compute model weights using bootstrap.

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.

Value

A numeric vector of model weights.

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.

References

Dormann, C. et al. 2018 Model averaging in ecology: a review of Bayesian, information-theoretic, and tactical approaches for predictive inference. Ecological Monographs 88, 485–504.

See also

Author

Kamil Bartoń, Carsten Dormann

Examples

# 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)
#> Fixed term is "(Intercept)"
am <- model.avg(fml)

Weights(am) <- bootWeights(am, data = Beetle, R = 25)
#> Warning: extra arguments ignored

summary(am)
#> 
#> Call:
#> model.avg(object = fml)
#> 
#> Component model call: 
#> glm(formula = Prop ~ <4 unique rhs>, family = binomial, data = Beetle, 
#>      na.action = na.fail, x = TRUE)
#> 
#> Component models: 
#>        df bootstrap weight
#> 1       2              0.6
#> 2       2              0.4
#> 12      3              0.0
#> (Null)  1              0.0
#> 
#> Term codes: 
#>      dose mortality 
#>         1         2 
#> 
#> Model-averaged coefficients:  
#> (full average) 
#>             Estimate Std. Error Adjusted SE z value Pr(>|z|)
#> (Intercept)  -9.8098     5.9282      5.9769   1.641    0.101
#> dose          0.1473     0.1214      0.1221   1.207    0.227
#> mortality     2.2711     2.7966      2.8049   0.810    0.418
#>  
#> (conditional average) 
#>             Estimate Std. Error Adjusted SE z value Pr(>|z|)    
#> (Intercept) -9.80980    5.92817     5.97691   1.641    0.101    
#> dose         0.24554    0.02149     0.02683   9.150   <2e-16 ***
#> mortality    5.67779    0.45764     0.57134   9.938   <2e-16 ***
#> ---
#> Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
#>