Learn R Programming

vcd (version 0.9-0)

struc_assoc: Panel-generating Function for Association Plots

Description

Panel-generating function for strucplot returning a function producing association plots.

Usage

struc_assoc(compress = TRUE, xlim = NULL, ylim = NULL,
  yspace = unit(0.5, "lines"), xscale = 0.9)

Arguments

compress
logical; if FALSE, the space between the rows (columns) are chosen such that the total heights (widths) of the rows (column) are all equal. If TRUE, the space between the rows and columns is fixed and hence
xlim
either a $2 \times k$ matrix of doubles, $k$ the number of total columns of the plot, or a recycled vector from which such a matrix will be constructed. The columns of xlim correspond to the columns of the association plot, th
ylim
either a $2 \times k$ matrix of doubles, $k$ the number of total rows of the plot, or a recycled vector from which such a matrix will be constructed. The columns of ylim correspond to the rows of the association plot, the rows
xscale
scale factor resizing the tile's width, thus adding additional space between the tiles.
yspace
object of class "unit" specifying additional space separating the rows.

Value

  • A function with arguments:
  • residualstable of residuals.
  • observednot used by struc_assoc.
  • expectedtable of expected frequencies.
  • spacingobject of class "unit" specifying the space between the tiles.
  • gplist of gpar objects used for the drawing the tiles.
  • split_verticalvector of logicals indicating, for each dimension of the table, the split direction.

example

## UCB Admissions data(UCBAdmissions) ucb <- aperm(UCBAdmissions)

## association plot for conditional independence strucplot(ucb, expected = ~ Dept * (Admit + Gender), panel = struc_assoc(ylim = c(-4, 4)), labeling_args = list(abbreviate = c(Admit = 3)))

Details

This function is usually called by strucplot (typically when called by assoc) and returns a function used by strucplot to produce association plots.

References

Cohen, A. (1980), On the graphical display of the significant components in a two-way contingency table. Communications in Statistics---Theory and Methods, A9, 1025--1041.

Friendly, M. (1992), Graphical methods for categorical data. SAS User Group International Conference Proceedings, 17, 190--200. http://www.math.yorku.ca/SCS/sugi/sugi17-paper.html

See Also

assoc, strucplot, structable