Obtain a quick model comparison matrix for a selection of models

compare_models(x, ...)

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

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

Arguments

x

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

...

other models

Value

an `inzmodelcomp` object containing model comparison statistics

Methods (by class)

  • compare_models(default): default method

  • compare_models(svyglm): method for survey GLMs

Author

Tom Elliott

Examples

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)
#>  Model      AIC      BIC
#>     m0 372.0795 378.1008
#>     m1 371.9917 381.0236
#>     m2 183.9366 198.9898