tableplot.colldiag: Tableplot for Collinearity Diagnostics

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Produces a tableplot of collinearity diagnostics for a linear regression model (Friendly & Kwan, 2009), showing condition indices and variance proportions for the quantitative predictors. The goal is to highlight the variables involved in one or more nearly collinear relations among the predictors.

The default scheme is to show the column of condition indices at the left, using color to indicate danger (red), warning (yellow) and OK (green) with colors designed to reproduce as ordered in B/W. The variance proportions for the predictors are shown in a block at the right, using white, pink, red for small, medium and large values.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'colldiag'
tableplot(values, cell.specs, 
	prop.col = c("white", "pink", "red"), 
	cond.col = c("#A8F48D", "#DDAB3E", "red"), 
	cond.max = 100, 
	prop.breaks = c(0, 20, 50, 100), 
	cond.breaks = c(0, 5, 10, 1000), 
	show.rows = nvar:1, ...)

Arguments

values

A colldiag object, such as calculated by colldiag

cell.specs

Specifications for cellgram arguments, used only to override those calculated internally from the following arguments.

prop.col

A vector of colors used to display the values of the variance proportions.

cond.col

A vector of colors used to display the values of the condition indices

cond.max

Maximum value for a condition index displayed.

prop.breaks

Breaks for the variance proportions.

cond.breaks

Breaks for the condition indices

show.rows

Vector of indices of the rows of the colldiag object to be displayed in the tableplot. By default, all rows are shown, in reverse order, with the highest condition indices at the top.

...

Other arguments to pass down to tableplot.default

Details

The values of variance proportions are multiplied by 100 and rounded.

Value

None. Used for its side-effect.

Author(s)

Michael Friendly

References

Friendly, M. & Kwan, E. (2009). Where's Waldo: Visualizing Collinearity Diagnostics The American Statistician, 63(1), 56-65.

See Also

colldiag for calculation of collinearity diagnostics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Baseball data example, from Friendly & Kwan (2009)
if (require(vcd) && require(perturb)) {
	# model, with transformed variables
	Baseball$logsal <- log(Baseball$sal87)
	Baseball$years7 <- pmin(Baseball$years,7)

	base.mod <- lm(logsal ~ years+atbat+hits+homeruns+runs+rbi+walks, data=Baseball)
	if (require(car)) {
		# examine variance inflation factors
		vif(base.mod)
	}
	# corresponds to SAS: / collinoint option
	cd <- colldiag(base.mod, add.intercept=FALSE, center=TRUE)
	# simplified display
	print(cd, fuzz=.3)

	tableplot(cd)
	}

friendly/tableplot documentation built on May 16, 2019, 3:30 p.m.