Learn R Programming

EcoMetrics (version 0.1.1)

select_optimal_model: Choosing Best Model Based on AIC, BIC and Adjusted R Squared

Description

Choosing Best Model Based on AIC, BIC and Adjusted R Squared

Usage

select_optimal_model(models, criterion = "AIC")

Value

list of the results and best model

Arguments

models

a list of models

criterion

The criterion to select optimal model. Default AIC

Author

Mutua Kilai

Examples

Run this code
data(eduperform)
model1 <- lm(pi ~ hs, data = eduperform)
model2 <- lm(pi ~ hs + ps, data = eduperform)
model3 <- lm(pi ~ hs + ps + sh, data = eduperform)
models <- list(model1, model2, model3)

select_optimal_model(models, criterion= "AIC")

Run the code above in your browser using DataLab