
Last chance! 50% off unlimited learning
Sale ends in
Creates a fourfold display of a 2 by 2 by
fourfoldplot(x, color = c("#99CCFF", "#6699CC"),
conf.level = 0.95,
std = c("margins", "ind.max", "all.max"),
margin = c(1, 2), space = 0.2, main = NULL,
mfrow = NULL, mfcol = NULL)
a 2 by 2 by
a vector of length 2 specifying the colors to use for the smaller and larger diagonals of each 2 by 2 table.
confidence level used for the confidence rings on the odds ratios. Must be a single nonnegative number less than 1; if set to 0, confidence rings are suppressed.
a character string specifying how to standardize the table.
Must match one of "margins"
, "ind.max"
, or
"all.max"
, and can be abbreviated to the initial letter.
If set to "margins"
, each 2 by 2 table is standardized to
equate the margins specified by margin
while preserving the
odds ratio. If "ind.max"
or "all.max"
, the tables are
either individually or simultaneously standardized to a maximal cell
frequency of 1.
a numeric vector with the margins to equate. Must be
one of 1
, 2
, or c(1, 2)
(the default), which
corresponds to standardizing the row, column, or both margins in
each 2 by 2 table.
Only used if std
equals "margins"
.
the amount of space (as a fraction of the maximal radius of the quarter circles) used for the row and column labels.
character string for the fourfold title.
a numeric vector of the form c(nr, nc)
, indicating
that the displays for the 2 by 2 tables should be arranged in an
nr
by nc
layout, filled by rows.
a numeric vector of the form c(nr, nc)
, indicating
that the displays for the 2 by 2 tables should be arranged in an
nr
by nc
layout, filled by columns.
The fourfold display is designed for the display of 2 by 2 by
Following suitable standardization, the cell frequencies
Typically, the number
Friendly, M. (1994).
A fourfold display for 2 by 2 by
# NOT RUN {
## Use the Berkeley admission data as in Friendly (1995).
x <- aperm(UCBAdmissions, c(2, 1, 3))
dimnames(x)[[2]] <- c("Yes", "No")
names(dimnames(x)) <- c("Sex", "Admit?", "Department")
stats::ftable(x)
## Fourfold display of data aggregated over departments, with
## frequencies standardized to equate the margins for admission
## and sex.
## Figure 1 in Friendly (1994).
fourfoldplot(margin.table(x, c(1, 2)))
## Fourfold display of x, with frequencies in each table
## standardized to equate the margins for admission and sex.
## Figure 2 in Friendly (1994).
fourfoldplot(x)
## Fourfold display of x, with frequencies in each table
## standardized to equate the margins for admission. but not
## for sex.
## Figure 3 in Friendly (1994).
fourfoldplot(x, margin = 2)
# }
Run the code above in your browser using DataLab