dregde
currently is known to work with lm
, glm
,
rlm
, polr
, multinom
, gam
, gls
, lme
,
lmer
, coxph
, glmmML
, sarlm
, spautolm
,
gamm
and gamm4
(the last two should be fitted via the
wrapper MuMIn::gamm
).Models are run one by one by repeated evaluation of modified calls to
global.model
(in a similar fashion to that of update
. This method,
while robust in that it can be applied to a variety of different model ofjects
is not very efficient, and may be time-intensive.
Note that the number of combinations grows exponentially with number of
predictor variables (latex{$2^{N}$}{2^N}). Because there is
potentially a large number of models to evaluate, to avoid memory overflow the
fitted model objects are not stored. To get (a subset of) the models, use
get.models
on the object returned by dredge
.
Handling interactions, dredge
respects marginality constraints, so
all possible combinations do not include models containing interactions
without their respective main effects. This behaviour can be altered by
marg.ex
argument. It can be used to allow for simple nested designs. For
example, with global model of form a / (x + z)
, use marg.ex = "a"
and fixed = "a"
.
rank
is found by a call to match.fun
and may be specified as a
function or a symbol (e.g. a back-quoted name) or a character string specifying
a function to be searched for from the environment of the call to dredge
.
Function rank
must be able to accept model as a first argument and must
always return a scalar. Typical choice for rank
would be "AIC", "QAIC" or
"BIC" (stats or nlme).
The argument subset
acts in a similar fashion to that in the function
subset
for data.frames
: the model terms can be referred to by name
as variables in the expression, with the difference that they are always logical
(i.e. TRUE
if a term exists in the model). The expression can contain
any of the global.model
terms (use getAllTerms(global.model)
to
list them). It can have a form of an unevaluated call
, expression
object, or a one sided formula
. See Examples.
Compound model terms (such as as-is expressions within I()
or
the smooths in gam
) should be treated as non-syntactic names and
enclosed in back-ticks (see Quotes). Mind the spacing, names
must match exactly the term names in model's formula. To simply keep certain
variables in all models, use of fixed
is preferred.
Use of na.action = na.omit
(R's default) in global.model
should
be avoided, as it results with sub-models fitted to different data sets, if
there are missing values. In versions >= 0.13.17 a warning is given in such a
case.