modelaverageFun: Uses model avaraging to return fixed-effects parameter...

Description Usage Arguments Details Value Examples

Description

Uses model avaraging to return fixed-effects parameter estimates.

Usage

1
modelaverageFun(model, threshold, fixed = NULL, r2glmm = F)

Arguments

model

A merMod object from lme4. Most complicated model to evaluate.

threshold

Character. "C95", "D2", "D4", "D6", "D8"

fixed

optional, either a single sided formula or a character vector giving names of terms to be included in all models

r2glmm

Logical. Compute R2c and R2m for (g)lmm models using r.squaredGLMM

Details

Uses the dredge function which takes the full (i.e. most complex, including all terms of interest and interactions) model and automatically builds all combinations of simpler models from the provided terms. For each model, AIC values are computed. An average model is built model.avg using the subset of best models determined by the threshold argument. "C95" will select the models whose cumulative AICw ≤ 0.95. "D2", "D4", "D6", "D8" will select models with ΔAIC ≤ 2, ΔAIC ≤ 4, ΔAIC ≤ 6 and ΔAIC ≤ 8 respectively. If only a single model meets the threshold, it will be returned instead of the averaged model.

Value

"$all.models" Object of class dredge

"$best.models" Object of class model.avg

Examples

1
2
3
4
5
6
7
8
require(lme4)
d1<-cbpp
d1$period<-as.numeric(as.character(cbpp$period))
d1$response<-d1$incidence/d1$size
gm1 <- glmer(cbind(incidence, size - incidence) ~ period+size + (1 | herd), data = cbpp, family = binomial)
mm1 <- modelaverageFun(model=gm1, threshold="D2")
mm1$all.models
summary(mm1$best.models)

p-schaefer/psUtilities documentation built on May 24, 2019, 5:56 p.m.