07.02.2014 Views

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

Introduction to Stata 8 - (GRIPS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

tabi<br />

[R] tabulate<br />

tabi is an 'immediate' command (see section 15.5) enabling you <strong>to</strong> analyse a table without<br />

first creating a data set. Just enter the cell contents, delimiting the rows by \ (backslash):<br />

. tabi 10 20 \ 17 9 , chi exact<br />

| col<br />

row | 1 2 | Total<br />

-----------+----------------------+----------<br />

1 | 10 20 | 30<br />

2 | 17 9 | 26<br />

-----------+----------------------+----------<br />

Total | 27 29 | 56<br />

Pearson chi2(1) = 5.7308 Pr = 0.017<br />

Fisher's exact = 0.031<br />

1-sided Fisher's exact = 0.016<br />

epitab<br />

The commands in the epitab family perform stratified analysis. Here I show cc.<br />

. cc case exposed , by(age) woolf<br />

[ST] epitab<br />

Maternal age | OR [95% Conf. Interval] M-H Weight<br />

----------------+-------------------------------------------------<br />

chi2 = 0.7105<br />

Test that combined OR = 1:<br />

Mantel-Haenszel chi2(1) = 5.81<br />

Pr>chi2 = 0.0159<br />

All procedures perform stratified analysis (Mantel-Haenszel). cc gives odds ratios for each<br />

stratum and the Mantel-Haenszel estimate of the common odds ratio. The test of homogeneity<br />

tests whether the odds ratio estimates could reflect a common odds ratio.<br />

Command Measure of association Immediate command<br />

ir Incidence rate ratio, incidence rate difference iri<br />

cs Cohort studies: Risk ratio, risk difference csi<br />

cc Case-control studies: Odds ratio cci<br />

tabodds<br />

mhodds<br />

Odds ratio, several exposure levels. Trend test<br />

Odds ratio, several exposure levels. Trend test<br />

mcc Odds ratio (matched case-control data) mcci<br />

If you want <strong>to</strong> stratify by more than one variable, the following command is useful:<br />

egen racesex=group(race sex)<br />

cc case exposed , by(racesex)<br />

The immediate commands do not perform stratified analysis; an example with cci. Just<br />

enter the four cells (a b c d) of the 2×2 table:<br />

cci 10 20 17 9 , woolf<br />

29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!