Akaike weights represent the relative likelihood of a model. It can be used in model averaging and selection.
akaike_weights(object)
A data frame containing the coefficients:
the delta overall change in the coefficients
the relative log-likelihood
the Akaike weights
Wagenmakers E. J. & Farrell S. (2004). Psychonomic Bulletin and Review, 11(1), 192–196. doi:10.3758/BF03206482
data("airquality")
# try three model approaches
mod1 = glm(Temp ~ 1,
data = airquality,
family = poisson())
mod2 = glm(Temp ~ Ozone,
data = airquality,
family = poisson())
mod3 = glm(Temp ~ Ozone + Solar.R,
data = airquality,
family = poisson())
# models AICs together in a single vector
models = c(mod1 = AIC(mod1),
mod2 = AIC(mod2),
mod3 = AIC(mod3))
# calculate akaike weights
aw = akaike_weights(models)
# the higher the better
names(models[which.max(aw$akaike_weights)])