Model Comparison

DESCRIPTION:

Combines comparable models into a fit.models object.

USAGE:

fit.models(model.list, formula=NULL, ...)

REQUIRED ARGUMENTS:

model.list
either a list of calls or a list of function names. This is not required when coercing one or more already fitted models into a fit.models object.

OPTIONAL ARGUMENTS:

formula
when model.list is a list of function names the second argument is often a formula. This saves you the trouble of having to name it explicitly when calling fit.models.
...
other arguments to be passed to the functions specified in model.list.

VALUE:

a fit.models object. The fit.models object is a list where each element is a fitted model. It has two attributes: model.list and virtual.class. The model.list is a list containing the calls that generated the models in the fit.models object. The virtual.class is the class of the functions that are used for the generic print, summary, plot, etc. methods.

DETAILS:

To be comparable the specified models must all belong to one of the supported classes in fit.models. The supported classes of models in this release of the Robust Library are (1) ANOVA models {"aov", "aovRob"}, (2) Asymmetric Distribution Models {"gammaMLE", "gammaRob", "lognormMLE", "lognormRob", "weibullMLE", "weibullRob"}, (3) Covariance/Correlation Models {"cov", "covRob"}, (4) Discriminant Analysis Models {"disrcim", "discRob"}, (5) Generalized Linear Models {"glm", "glmRob"}, (6) Linear Models {"lm", "lmRob"}, and (7) Principal Components Models {"princomp", "princompRob"}. The class information is stored in the virtual.class attribute and is used to dispatch the correct method for generic function calls.

SEE ALSO:

, .

EXAMPLES:

# The following three examples are equivalent.
# Using fit.models with a list of calls
my.models <- list(Robust=call("lmRob", formula=substitute(Loss ~ .),
     data=substitute(stack.dat)),
     LS=call("lm", formula=substitute(Loss ~ .), data=substitute(stack.dat)))
stack.fm <- fit.models(my.models)
stack.fm

# Using fit.models with a list of function names
stack.fm <- fit.models(list(Robust="lmRob", LS="lm"), Loss ~ ., data =
     stack.dat)
stack.fm

# Using fit.models to coerce already fitted models into a fit.models object
Robust <- lmRob(Loss ~ ., data=stack.dat)
LS <- lm(Loss ~ ., data=stack.dat)
stack.fm <- fit.models(Robust, LS)
stack.fm