Learn R Programming

dLagM (version 0.0.8)

sortScore: Sort ACI and BIC scores

Description

A function that displays sorted AIC and BIC scores.

Usage

sortScore(x, score = c("bic", "aic"))

Arguments

x

A vector of AIC or BIC values.

score

The type of scores to be sorted.

Details

This function sorts the AIC or BIC scores to display the smallest one at the top of a bunch of AIC or BIC scores.

Examples

Run this code
# NOT RUN {
data(warming)
model.poly1 = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
                     q = 2 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)
model.poly2 = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
                      q = 3 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)
model.poly3 = polyDlm(x = warming$NoMotorVehicles , y = warming$Warming , 
                      q = 4 , k = 2 , show.beta = TRUE ,  show.summary = TRUE)

aic = AIC(model.poly1$model, model.poly2$model, model.poly3$model)
bic = BIC(model.poly1$model, model.poly2$model, model.poly3$model)
sortScore(aic,score = "aic")
sortScore(bic,score = "bic")

# }

Run the code above in your browser using DataLab