fourfold | SAS/IML modules for four-fold display of 2 x 2 x k tables | fourfold |

York University

proc iml; %include iml(fourfold); *-- specify required parameters; dim = { ... }; *-- table dimensions; table = { ... }; *-- contingency table; vnames = { ... }; *-- variable names; lnames = { ... }; *-- level names; *-- specify desired global variables; config = {1}; run fourfold( dim, table, vnames, lnames );The

- dim
- A numeric vector containing the dimensions of the contingency table.
The first two elements must be
`{2 2}`. - table
- A numeric matrix containing
`dim[1]=2`columns and number of rows equal to the product of the remaining elements of`dim`. The table must be entered so that the first variable varies most quickly (row-major order), and the last variable varies most slowly, in accord with the conventions for multiway tables used by the SAS/IML routines`marg`and`ipf`. - vnames
- A 1 x
`ncol(dim)`character vector, containing the names of the variables in the order corresponding to`dim`. - lnames
- A character matrix containing the names of the categories
(levels) of the variables, whose rows correspond to
`dim`and`vnames`. Any short rows must be filled in with blank character strings, because matrices in SAS/IML must have the same number of elements in each row. For example, for the*2 x 2 x 6*table for the Berkeley data, the`dim`,`vnames`and`lnames`may be entered as follows:dim = {2 2 6}; vnames = {'Admit?' 'Sex' 'Department'}; lnames = {'Yes' 'No' ' ' ' ' ' ' ' ', 'Male' 'Female' ' ' ' ' ' ' ' ', 'A' 'B' 'C' 'D' 'E' 'F'};

- std
- Specifies how the
*2 x 2*tables are standardized. [Default:`std='MARG'`.- MARG
- standardizes each
*2 x 2*table to equal margins, keeping the odds ratio fixed. The`config`variable determines which margins are equated. - MAX
- standardizes each table to a maximum cell frequency of 100. This has the effect of equating the totals in each table.
- MAXALL
- standardizes
*all*tables so that the maximum cell entry is 100.

- config
- specifies the margins to standardize, when
`std='MARG'`.`config={1 2}`equates both the row and column variable in each table;`config={1}`equates the margin only for the column variable in each table;`config={2}`equates only the row variable. - down
- Specifies the number of fourfold panels down each page
- across
- Specifies the number of panels across each page
- sangle
- The angle for side labels (0 | 90).
[Default:
`sangle=90`]. - colors
- The names of two colors to use for the smaller and
larger diagonals of each 2x2 table. The positions of first color
indicate the direction of association.
[Default:
`colors={BLUE RED}`]. - patterns
- The names of two fill patterns. For grayscale, use
`patterns={SOLID SOLID}`and`colors={GRAYC0 GRAY80}`. [Default:`patterns={SOLID SOLID}`]. - alpha
- is the error rate used for confidence rings on the odds ratios.
Use
`alpha=0;`to suppress the confidence rings. - conf
- The type of confidence rings, either
`'Individual'`(for each*2 x 2*table) or`'Joint'`(for simultaneous confidence intervals covering all*k**2 x 2*tables). [Default:`conf='Individual'`]. - font
- A character string specifying the font used.
The default is Helvetica (
`font='hwpsl009'`) if a PostScript driver is being used,`SWISS`otherwise. - frame
- the line style for the boxed frame (0=none).

proc iml; %include iml(fourfold.sas); *-- Berkeley Admissions data; dim = {2 2 6}; vnames = {'Admit?' 'Sex' 'Department'}; lnames = {'Yes' 'No' ' ' ' ' ' ' ' ', 'Male' 'Female' ' ' ' ' ' ' ' ', 'A' 'B' 'C' 'D' 'E' 'F'}; table = { 512 313, 89 19, 353 207, 17 8, 120 205, 202 391, 138 279, 131 244, 53 138, 94 299, 22 351, 24 317}; std='MARG'; /* IML4FOLD, fig 3 */ alpha=.01; patterns={solid solid}; htext = 2.4; filltype={hls hls}; run fourfold(dim, table, vnames, lnames);

mosaic Macro interface for mosaic displays

mosaics SAS/IML programs for mosaic displays

mosmat Macro interface for mosaic matrices

sieve Sieve diagrams for two-way tables