help mtab2 (User-written stata packages: mtab)

Title

mtab2 -- Store the results (frequencies and percentages) in matrix for two-way table

Syntax

mtab2
varlist
[if] [in]
[, options
]

Options
nolabel display numeric codes rather than value labels

missing treat missing values like other values

row report relative frequency within its row of each cell

col report relative frequency within its column of each cell

exact report Fisher's exact test

Description

Command mtab2 makes a two-way table and store the results (frequencies and percentages) in matrix.

Options

nolabel causes the numeric codes to be displayed rather than the value labels.

missing requests that missing values be treated like other values in calculations of counts, percentages.

row displays the relative frequency of each cell within its row in a two-way table.

col displays the relative frequency of each cell within its column in a two-way table.

exact displays p value from Fisher's exact test.

Examples

1. load an oneline data

.webuse lbw

2. makes an one-way table and store the results (frequencies and percentages)

.mtab2 smoke low

.mtab2 smoke low, row

.mtab2 smoke low, col

More examples

click on her

Author

Chunsen Wu, the University of Southern Denmark; Odense University Hospital, Denmark

cwu@health.sdu.dk

chunsen.wu@rsyd.dk

Also see

Help: mtab, mtab1, msum, mest, mmat, mexcel, and mobs