cm: Handling "'cm'" and "'cmList'" objects

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
getNthModel(object, index)
getFirstModel(object)

summaryTable(object, index, ...)

## S3 method for class 'cmList'
summary(object, ...)

## S3 method for class 'summary.cmList'
print(x, ...)

## S3 method for class 'cm'
formula(x, ...)

## S3 method for class 'cm'
IC(object)

## S3 method for class 'cm'
summary(object, ...)

## S3 method for class 'summary.cm'
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.

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.

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

Author(s)

Nicholas Lange, Tom Fletcher, Kristen Zygmunt

See Also

FindMinIC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
     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]]))

FindMinIC documentation built on May 30, 2017, 3:15 a.m.