mosaicpairs {vcd} | R Documentation |
Plots matrices of mosaics.
## Default S3 method: mosaicpairs(x, main = deparse(substitute(x)), xlab = NULL, ylab = NULL, labels, ..., type = c("pairwise", "total", "conditional", "joint"), shade = TRUE, oma = NULL, cex.labels = NULL, label.pos = 0.5, font.labels = 1, gap = 1) ## S3 method for class 'formula': mosaicpairs(formula, data = NULL, ..., main, subset)
x |
a contingency table in array form, with optional category
labels specified in the dimnames(x) attribute. The table is
best created by the table() command. |
main |
character string for the mosaic title. |
xlab,ylab |
x- and y-axis labels used for the plot; by default,
the first and second element of names(dimnames(X)) (i.e., the
name of the first and second variable in X ). |
labels |
the names of the variables. |
... |
further parameters (currently not used). |
type |
a character string indicating the type of mosaic matrix, see details for more information. |
shade |
a logical indicating whether to produce extended mosaic
plots, or a numeric vector of at most 5 distinct positive numbers
giving the absolute values of the cut points for the residuals. By
default, shade is TRUE . Using shade = TRUE cuts absolute values at 2 and
4. |
oma |
A vector of the form c(bottom, left, top, right) giving the size of the outer margins in lines of text. |
cex.labels, font.labels |
graphics parameters for the text panel. |
label.pos |
y position of labels in the text panel. |
gap |
distance between subplots, in margin lines. |
formula |
a formula, such as y ~ x . |
data |
a data.frame (or list), or a contingency table from which
the variables in formula should be taken. |
subset |
an optional vector specifying a subset of observations to be used for plotting. |
mosaicpairs()
plots a matrix of pairwise mosaic plots, four
independence types are distinguished:
"pairwise"
, "total"
, "conditional"
and "joint"
.
The pairwise mosaic matrix shows bivariate marginal relations, collapsed over
all other variables. The total independence mosaic matrix shows mosaic plots
for mutual independence, i.e. for marginal and conditional independence
among all pairs of variables. The conditional independence mosaic matrix shows
mosaic plots for marginal independence given all other variables. The
joint independence mosaic matrix shows mosaic plots for joint independence of all pairs of
variables from the others.
M. Friendly (2000), Visualizing Categorical Data. SAS Institute, Cary, NC.
data(UCBAdmissions) data(PreSex) mosaicpairs(PreSex, shade = TRUE) mosaicpairs(UCBAdmissions, shade = TRUE) mosaicpairs(UCBAdmissions, shade = TRUE, type="conditional")