View source: R/akaike_weights.R
akaike_weights | R Documentation |
Akaike weights represent the relative likelihood of a model. It can be used in model averaging and selection.
akaike_weights(object)
object |
a numerical vector with models goodness of fit coefficients |
A data frame containing the coefficients:
delta |
the delta overall change in the coefficients |
relative_logLik |
the relative log-likelihood |
akaike_weights |
the Akaike weights |
Kauê de Sousa and Jacob van Etten
Wagenmakers E. J. & Farrell S. (2004). Psychonomic Bulletin and Review, 11(1), 192–196. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/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)])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.