Learn R Programming

FindMinIC (version 1.6)

cm: Handling “cm” and “cmList” objects

Description

Methods for working with candidate model (“cm”) and candidate model list (“cmList”) objects.

Usage

getNthModel(object, index) getFirstModel(object)
summaryTable(object, index, ...)
"summary"(object, ...)
"print"(x, ...)
"formula"(x, ...)
"IC"(object)
"summary"(object, ...)
"print"(x, ...)

Arguments

object
a list of candidate models of class "cmList" that was returned from a call to fmi or FindMinIC.
index
an index into the cmList, for instance, using index = 4 in getNthModel will return the 4th best candidate model from the list as ranked by IC.
x
a candidate model of class "cm"
...
some generic methods such as print and summary can take additional arguments, these are passed in to those methods appropriately.

Value

a cmList is a list containing the following components:
results
a list of candidate models of class "cm".
data
the data passed in including any changes made for groupedData.
best
the best candidate model
modeltype
the model type provided to the FindMinIC call
a cm object is a candidate model containing the following components:
call
the call to lm or lme that generated the candidate model
IC
the IC of the model fit
formula
the formula of the model fit

Details

Since FindMinIC returns a potentially large list of candidate models, functions such as getNthModel, getFirstModel, summaryTable and summary can be used to either return specific models or summarize the list of models. Once a particular candidate model (cm) has been extracted, functions such as IC, formula, and summary can be used to further understand that particular model.

See Also

FindMinIC

Examples

Run this code
     data(iris)

     coly="Sepal.Length"
     fixed="Sepal.Width"
     candidates=c("Species","-1","Sepal.Width:Species")

     results.lm = FindMinIC(coly, candidates, fixed, iris)

     print(summary(results.lm))

     # best model:
     print(summary(getFirstModel(results.lm)))
     print(summaryTable(results.lm, 1))
     print(summary(results.lm$results[[1]]))

     # 4th best model:
     print(summary(getNthModel(results.lm, 4)))
     print(summary(results.lm$results[[4]]))

Run the code above in your browser using DataLab