






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Comments are in bold blue and begin with an asterisk Commands to are in bold black
. set more off . * Use drop down menu (FILE > OPEN) to open data . use "/Users/carolbigelow/Desktop/week5_2009.dta" . * Use command DESCRIBE to look at variable names . describe
Contains data from /Users/carolbigelow/Desktop/week5_2009.dta obs: 28 vars: 5 28 Apr 2006 16: size: 364 (99.9% of memory free)
storage display value variable name type format label variable label
cigs byte %16.0g cigsf Cigarettes per day coffee byte %8.0g coffee per day micase byte %8.0g heart attack case tally int %8.0g wgt float %9.0g
. * Solution for Question # . * Preliminary is to use the command SORT to sort the data by cigs . sort cigs . * Use command MHODDS to obtain an Mantel Haenszel stratified analysis of rates . * Obtain Mantel Haenszel OR and Test of Homogeneity . mhodds micase coffee [freq=tally], by(cigs)
Maximum likelihood estimate of the odds ratio Comparing coffee==1 vs. coffee== by cigs
cigs | Odds Ratio chi2(1) P>chi2 [95% Conf. Interval] ----------+-------------------------------------------------------------------- 1=never | 10.752493 44.90 0.0000 4.504986 25. 2=former | 2.177778 2.42 0.1197 0.796941 5. 3=1-14 c | 0.097222 19.81 0.0000 0.027168. 4=15-24 | 1.737374 4.78 0.0288 1.052085 2. 5=25-34 | 1.558333 1.80 0.1798 0.810685 2. 6=35-44 | 1.186364 0.25 0.6139 0.610313 2. 7=45+ ci | 0.882353 0.09 0.7693 0.382028 2.
STATA command is the same.
. * Obtain Mantel Haenszel OR . mhodds micase coffee [freq=tally], by(cigs)
Test of homogeneity of ORs (approx): chi2(6) = 63. Pr>chi2 = 0.
SAS command is the same.
You will find in the output
Cochran-Mantel-Haenszel Statistics (Based on Table Scores)
Statistic Alternative Hypothesis DF Value Prob ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ 1 Nonzero Correlation 1 3.4153 0. 2 Row Mean Scores Differ 1 3.4153 0. 3 General Association 1 3.4153 0.
Breslow-Day Test for Homogeneity of the Odds Ratios ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ Chi-Square 63. DF 6 Pr > ChiSq <.