Learn R Programming

MuMIn (version 1.43.17)

nested: Identify nested models

Description

Find models that are ‘nested’ within each model in the model selection table.

Usage

nested(x, indices = c("none", "numeric", "rownames"), rank = NULL)

Arguments

x

a "model.selection" object (result of dredge or model.sel).

indices

if omitted or "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 “Value”.

rank

the name of the column with the ranking values (defaults to the one before “delta”). Only used if indices is "none".

Value

A vector of length equal to the number of models (table rows).

If 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.

Details

In model comparison, a model is said to be “nested” within another model if it contains a subset of parameters of the latter model, but does not include other parameters (e.g. model ‘A+B’ is nested within ‘A+B+C’ but not ‘A+C+D’).

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.

References

Richards, S. A., Whittingham, M. J., Stephens, P. A (2011). Model selection and model averaging in behavioural ecology: the utility of the IT-AIC framework. Behavioral Ecology and Sociobiology, 65: 77-89

Richards, S. A (2008) Dealing with overdispersed count data in applied ecology. Journal of Applied Ecology 45: 218<U+2013>227

See Also

dredge, model.sel

Examples

Run this code
# NOT RUN {
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