
nested(x, indices = c("none", "numeric", "rownames"), rank = NULL)
"model.selection"
object (result of dredge
or
model.sel
)."none"
then the function checks if, for
each model, there are any higher ranked models nested within it.
If "numeric"
or "rownames"
, indices or names of all nested
models are returned. See indices
is
"none"
.indices = "none"
(the default), it is a vector of logical
values where i-th element is TRUE
if any model(s) higher up in
the table are nested within it (i.e. if simpler models have lower IC pointed
by rank
).
For indices
other than "none"
, the function returns a list of
vectors of numeric indices or names of models nested within each
i-th model.This function can be useful in a model selection approach suggested by Richards (2008), in which more complex variants of any model with a lower IC value are excluded from the candidate set.
Richards, S. A (2008) Dealing with overdispersed count data in applied ecology. Journal of Applied Ecology 45: 218–227
dredge
, model.sel
fm <- lm(y ~ X1 + X2 + X3 + X4, data = Cement, na.action = na.fail)
ms <- dredge(fm)
# filter out overly complex models according to the
# "nesting selection rule":
subset(ms, !nested(.)) # dot represents the ms table object
# print model "4" and all models nested within it
nst <- nested(ms, indices = "row")
ms[c("4", nst[["4"]])]
ms$nested <- sapply(nst, paste, collapse = ",")
ms
Run the code above in your browser using DataLab