selMod {pgirmess}R Documentation

Model selection according to information theoretic methods

Description

Handles lm, glm and list of e.g. lm, glm, nls, lme and nlme objects and provides parameters to compare models according to Anderson et al. (2001)

Usage

    selMod(aModel, Order = "AICc", ...)

    ## S3 method for class 'lm'
selMod(aModel, Order = "AICc", dropNull = FALSE, selconv=TRUE, ...)
    ## S3 method for class 'list'
selMod(aModel, Order = "AICc", ...)

Arguments

aModel

a lm or glm model or a list of relevant models (see details)

dropNull

if TRUE, drops the simplest model (e.g. y~1)

Order

if set to "AICc" (default) sort the models on this parameter, otherwise "AIC" is allowed

selconv

if TRUE (default) keep the models for which convergence is obtained (glm object only) and with no anova singularity (lm and glm)

...

other parameters to be passed as arguments (not used here)

Details

This function provides parameters used in the information theoretic methods for model comparisons.

Value

A dataframe including:

The models examined from first to last are stored as attribute

Author(s)

Patrick Giraudoux and David Pleydell: pgiraudo@univ-fcomte.fr, david.pleydell@inra.fr

References

See Also

AIC,logLik, aictab

Examples

 if(require(MASS)){
 anorex.1 <- lm(Postwt ~ Prewt*Treat, data = anorexia)
 selMod(anorex.1)
 anorex.2 <- glm(Postwt ~ Prewt*Treat, family=gaussian,data = anorexia)
 selMod(anorex.2)
 anorex.3<-lm(Postwt ~ Prewt+Treat, data = anorexia)
 mycomp<-selMod(list(anorex.1,anorex.2,anorex.3))
 mycomp
 attributes(mycomp)$models
 }

[Package pgirmess version 2.0.3 Index]