AICc: Comparison of Models using Akaike Information Criterion

Description Usage Arguments Value Examples

View source: R/AICc.R

Description

Compares a collection of statistical models using AIC.

Usage

1
AICc(fitlist, corr = TRUE)

Arguments

fitlist

A list of model fits to compare, e.g., lm, glm, aov, nls objects.

corr

A logical indicating whether the AIC should be corrected for small sample size, default TRUE.

Value

Data frame with a row for each model being compared, ordered by either the uncorrected AIC (corr=FALSE) or the AIC corrected for small sample size (corr=TRUE). Columns include the number of observations (n), the number of parameters including the variance (p), the root mean squared error (rmse), the uncorrected AIC (aic), the AIC corrected for small sample size (aicc), the delta AIC (daic or daicc), and the weights of evidence (aicw or aiccw).

Examples

1
2
3
4
5
fit1 <- lm(hp ~ mpg + disp + wt, data=mtcars)
fit2 <- lm(hp ~ mpg + disp, data=mtcars)
fit3 <- lm(hp ~ mpg + wt, data=mtcars)
fit4 <- lm(hp ~ disp + wt, data=mtcars)
AICc(list(fit1, fit2, fit3, fit4))

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.