Learn R Programming

iNZightRegression (version 1.3.5)

compare_models: Compare regression models using AIC and BIC.

Description

Obtain a quick model comparison matrix for a selection of models

Usage

compare_models(x, ...)

# S3 method for default compare_models(x, ...)

# S3 method for svyglm compare_models(x, ...)

Value

an `inzmodelcomp` object containing model comparison statistics

Arguments

x

a regression model (lm, glm, svyglm, ...)

...

other models

Methods (by class)

  • compare_models(default): default method

  • compare_models(svyglm): method for survey GLMs

Author

Tom Elliott

Examples

Run this code
m0 <- lm(Sepal.Length ~ 1, data = iris)
m1 <- lm(Sepal.Length ~ Sepal.Width, data = iris)
m2 <- lm(Sepal.Length ~ Sepal.Width + Species, data = iris)
compare_models(m0, m1, m2)

Run the code above in your browser using DataLab