impCoef: Plot Variable Importance.

Description Usage Arguments Value References Examples

Description

Builds a plot of importance based on Silber, Rosenbaum and Ross's (1995) idea of importance as the variance of the predicted model terms.

Usage

1
impCoef(obj, pct = FALSE, names = NULL, orderSize = TRUE)

Arguments

obj

Any objct that permits prediction of model terms using the predict(obj, type="terms") syntax.

pct

Logical indicating whether the entries should be percentagized by the total sum of squares in the predictions.

names

An optional vector of names for the coefficients.

orderSize

Logical indicating whether the terms are ordered by importance in the graph.

Value

Returns an initialized ggplot, but geometries need to be added to produce meaningful output (see examples).

References

Silber, JH, PR Rosenbaum and RN Ross (1995) Comparing the Contributions of Groups of Predictors: Which Outcomes Vay with Hospital Rather than Patient Characteristics? JASS 90, 7-18.

Examples

1
2
3
4
5
6
data(aclp)
library(ggplot2)
mod <- glm(democ ~ log(gdpw) + popg +  year, data=aclp, family=binomial)	
impCoef(mod, pct=TRUE, names=c("GDP", "Population", "Year")) + 
geom_point(size=2)  +
labs(x="Importance", y="")

DAMisc documentation built on Jan. 12, 2022, 1:07 a.m.