Learn R Programming

MuMIn (version 1.9.5)

importance: Relative variable importance

Description

Sum of Akaike weights over all models including the explanatory variable.

Usage

importance(x)

Arguments

x
Either a list of fitted model objects, or a "model.selection" or "averaging" object.

Value

  • a numeric vector of relative importance values, named as the predictor variables.

encoding

utf-8

See Also

Weights

dredge, model.avg, mod.sel

Examples

Run this code
# Generate some models
data(Cement)
fm1 <- lm(y ~ ., data = Cement)
ms1 <- dredge(fm1)

# Importance can be calculated/extracted from various objects:
importance(ms1)
importance(subset(mod.sel(ms1), delta <= 4))
importance(model.avg(ms1, subset = delta <= 4))
importance(subset(ms1, delta <= 4))
importance(get.models(ms1, delta <= 4))

# Re-evaluate the importances according to BIC
# note that re-ranking involves fitting the models again

# 'nobs' is not used here for backwards compatibility
lognobs <- log(length(resid(fm1)))

importance(subset(mod.sel(ms1, rank = AIC, rank.args = list(k = lognobs)),
    cumsum(weight) <= .95))

# This gives a different result than previous command, because 'subset' is
# applied to the original selection table that is ranked with 'AICc'
importance(model.avg(ms1, rank = AIC, rank.args = list(k = lognobs),
    subset = cumsum(weight) <= .95))

Run the code above in your browser using DataLab