help cstable
-------------------------------------------------------------------------------

Tools for Epidemiology

cstable.ado, for Stata version 8.0 or higher Sept 2007

Univariate cohort analysis for each exposure, results are summarized into one table. One row, one exposure. Result file contains: ordering number of exposure(id), name of variable (exposure), total number of exposed, number of exposed cases, attack rate of exposed, total number of unexposed, number of unexposed cases, attack rate of unexposed, risk ratio, 95%CI interval, 95% p-value.

Collaborative work by Gilles Desve and Peter Makary. Special thanks to Alain Moren. In case of any question please contact us: g.desve@epiconcept.fr peter.makary@ktl.fi (Opinions, notices are welcome as well!)

Summary table for cohort study

Syntax

cstable [varlist] [if] [in] [, options]

options Description ------------------------------------------------------------------------- Main exact Calculate 2-sided Fisher's exact p-value (default is chi square test p-value) nosort Results are displayed in the same order of variables in the command line rr Sort result by risk ratio ar Sort result by attack rate pvalue Sort result by p-values (default) replace Replace the current dataset with the cstable result noabbreviate Display full exposure name (default fisrt 12 chars) ------------------------------------------------------------------------- by may not be used with cstable.

Description

cstable Calculate number of cases, attack rate among exposed and unexposed, relative risk, 95%CI interval, 95% p-value for each variable of varlist. The result table could be sorted by p-value, risk ratio, attack rates.

Result could be copied with "copy table" in order to be pasted in Excel. Alternatively, the replace option store results as a new dataset. Then, results can be exported or saved as a new dataset.

Options

+------+ ----+ Main +-------------------------------------------------------------

exact requests Fisher's exact p be calculated rather than the chi-squared and its significance level. Specifying exact is recommended whenever samples are small. A conservative rule of thumb for 2x2 tables is to specify exact when the least-frequent cell contains fewer than 1,000 cases. When the least-frequent cell contains 1,000 cases or more, there will be no appreciable difference between the exact significance level and the significance level based on the chi-squared, but the exact significance level will take considerably longer to calculate. Note that exact does not affect whether exact confidence intervals are calculated.

nosort Specifies that the order of the exposures will be the same in the result table as it was in the command.

rr Results will be sorted by risk ratio in descending order.

ar Results will be sorted by attack rate in descending order.

pvalue Results will be sorted by p-value in ascending order. If no other sorting option is used, results will be sorted by ascending p-value as default.

replace Specifies that the result table will replace the original dataset in the memory and it will appear in the browser window. It means that the original dataset will be deleted from the memory. preserve then restore may be used to get back the original dataset, or upload it again with the use command. replace is used to create dataset from the result table (e.g. to save it), or to solve "copy table" incompatibilities in certain cases.

noabbreviate Displays full exposure name (default 12 first chars).

Remarks As with the cs command, variables used with cstable must be coded as 0/1. Sorting results only available in version 9 For detailed information contact g.desve@epiconcept.fr or peter.makary@ktl.fi

Examples

. cstable ill mousse tiramisu beer sex agegrp

. cstable ill mousse tiramisu beer, rr The result table is sorted by decreasing risk ratio

Also see cctable, csinter, cs.

Manual:

Online: