Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

getWeights

Optimize weights for model averaging.


Description

Function to constructed an optimal vector of weights for model averaging of Linear Mixed Models based on the proposal of Zhang et al. (2014) of using Stein's Formular to derive a suitable criterion based on the conditional Akaike Information Criterion as proposed by Greven and Kneib. The underlying optimization used is a customized version of the Augmented Lagrangian Method.

Usage

getWeights(models)

Arguments

models

An list object containing all considered candidate models fitted by lmer of the lme4-package or of class lme.

Value

An updated object containing a vector of weights for the underlying candidate models, value of the object given said weights as well as the time needed.

WARNINGS

For models called via gamm4 or gamm no weight determination via this function is currently possible.

Author(s)

Benjamin Saefken & Rene-Marcel Kruse

References

Greven, S. and Kneib T. (2010) On the behaviour of marginal and conditional AIC in linear mixed models. Biometrika 97(4), 773-789.

Zhang, X., Zou, G., & Liang, H. (2014). Model averaging and weight choice in linear mixed-effects models. Biometrika, 101(1), 205-218.

Nocedal, J., & Wright, S. (2006). Numerical optimization. Springer Science & Business Media.

See Also

Examples

data(Orthodont, package = "nlme")
models <- list(
    model1 <- lmer(formula = distance ~ age + Sex + (1 | Subject) + age:Sex,
               data = Orthodont),
    model2 <- lmer(formula = distance ~ age + Sex + (1 | Subject),
               data = Orthodont),
    model3 <- lmer(formula = distance ~ age + (1 | Subject),
                 data = Orthodont),
    model4 <- lmer(formula = distance ~ Sex + (1 | Subject),
                data = Orthodont))

foo <- getWeights(models = models)
foo

cAIC4

Conditional Akaike Information Criterion for 'lme4' and 'nlme'

v0.9
GPL (>= 2)
Authors
Benjamin Saefken, David Ruegamer, Philipp Baumann and Rene-Marcel Kruse, with contributions from Sonja Greven and Thomas Kneib
Initial release
2019-12-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.