Description Usage Arguments Details Value Examples
Uses model avaraging to return fixed-effects parameter estimates.
1 | modelaverageFun(model, threshold, fixed = NULL, r2glmm = F)
|
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 |
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.
"$all.models" Object of class dredge
"$best.models" Object of class model.avg
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.