Extract the best model (least sse) from a list of models

bestModel(models, digits = 6, orderOnly = FALSE, constrained = FALSE)

Arguments

models

the list of models

digits

the number of digits of sse that is considered significant

orderOnly

if FALSE, returns a reordered list of models. If TRUE, returns an integer vector representing the order of the models.

Value

an integer vector representing the order of the models if orderOnly is TRUE. A reordered list of models if orderOnly is FALSE (the default).

Note

The ordering process preserves the original order in the event of ties at the desired significance level.

This function relies upon the sse value being stored in an attribute of the model called naturalCoeffs.