. do athens . ************************************************************************** . * * . * athens.do * . * * . * PURPOSE: analysis of Tzonou et al. (1998) data investigating * . * CHD and iron consumption * . * * . * DATE: 11 April 2002 * . * * . ************************************************************************** . . *** . *** read the data and format . *** . . infile female age iron case count using athens.dat (80 observations read) . . label define fnames 0 "male" 1 "female" . label values female fnames . . label define anames 1 "<= 49" 2 "50-59" 3 "60-69" 4 ">= 70" . label values age anames . . label define inames 1 "<= 250mg/month" 2 "251-300 mg/month" 3 "301-350 mg/month" 4 "351-400 mg/month" 5 "> 400 mg/month" . label values iron inames . . label define ynames 0 "control" 1 "case" . label values case ynames . . . *** . *** create a single record per subject . *** . . drop if count==0 (5 observations deleted) . expand count (833 observations created) . . . *** . *** recode Iron . *** . . generate newiron=iron . recode newiron 1/3=0 4/5=1 (908 changes made) . label define nnames 0 "<=350 mg/month" 1 "> 350 mg/month" . label values newiron nnames . . . ***************************************************************************** . *** *** . *** univariate and bivariate distributions *** . *** *** . ***************************************************************************** . . table case ---------------------- case | Freq. ----------+----------- control | 570 case | 338 ---------------------- . table newiron --------------------------- newiron | Freq. ---------------+----------- <=350 mg/month | 638 > 350 mg/month | 270 --------------------------- . table age ---------------------- age | Freq. ----------+----------- <= 49 | 216 50-59 | 291 60-69 | 302 >= 70 | 99 ---------------------- . table female ---------------------- female | Freq. ----------+----------- male | 617 female | 291 ---------------------- . . ***** Note: we use column summaries since it's a case-control study . . tabulate newiron case, col | case newiron | control case | Total ---------------+----------------------+---------- <=350 mg/month | 418 220 | 638 | 73.33 65.09 | 70.26 ---------------+----------------------+---------- > 350 mg/month | 152 118 | 270 | 26.67 34.91 | 29.74 ---------------+----------------------+---------- Total | 570 338 | 908 | 100.00 100.00 | 100.00 . tabulate age case, col | case age | control case | Total -----------+----------------------+---------- <= 49 | 155 61 | 216 | 27.19 18.05 | 23.79 -----------+----------------------+---------- 50-59 | 176 115 | 291 | 30.88 34.02 | 32.05 -----------+----------------------+---------- 60-69 | 164 138 | 302 | 28.77 40.83 | 33.26 -----------+----------------------+---------- >= 70 | 75 24 | 99 | 13.16 7.10 | 10.90 -----------+----------------------+---------- Total | 570 338 | 908 | 100.00 100.00 | 100.00 . tabulate female case, col | case female | control case | Total -----------+----------------------+---------- male | 324 293 | 617 | 56.84 86.69 | 67.95 -----------+----------------------+---------- female | 246 45 | 291 | 43.16 13.31 | 32.05 -----------+----------------------+---------- Total | 570 338 | 908 | 100.00 100.00 | 100.00 . . tabulate newiron female, row | female newiron | male female | Total ---------------+----------------------+---------- <=350 mg/month | 388 250 | 638 | 60.82 39.18 | 100.00 ---------------+----------------------+---------- > 350 mg/month | 229 41 | 270 | 84.81 15.19 | 100.00 ---------------+----------------------+---------- Total | 617 291 | 908 | 67.95 32.05 | 100.00 . tabulate newiron age, row | age newiron | <= 49 50-59 60-69 >= 70 | Total ---------------+--------------------------------------------+---------- <=350 mg/month | 142 203 215 78 | 638 | 22.26 31.82 33.70 12.23 | 100.00 ---------------+--------------------------------------------+---------- > 350 mg/month | 74 88 87 21 | 270 | 27.41 32.59 32.22 7.78 | 100.00 ---------------+--------------------------------------------+---------- Total | 216 291 302 99 | 908 | 23.79 32.05 33.26 10.90 | 100.00 . . . ***************************************************************************** . *** *** . *** crude analysis (using logistic regression) *** . *** *** . ***************************************************************************** . . logistic case newiron Logit estimates Number of obs = 908 LR chi2(1) = 6.83 Prob > chi2 = 0.0090 Log likelihood = -595.99383 Pseudo R2 = 0.0057 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | 1.475 .2187347 2.62 0.009 1.102969 1.972517 ------------------------------------------------------------------------------ . logit Logit estimates Number of obs = 908 LR chi2(1) = 6.83 Prob > chi2 = 0.0090 Log likelihood = -595.99383 Pseudo R2 = 0.0057 ------------------------------------------------------------------------------ case | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | .388658 .1482947 2.62 0.009 .0980057 .6793102 _cons | -.6418539 .0832934 -7.71 0.000 -.805106 -.4786017 ------------------------------------------------------------------------------ . . . ***************************************************************************** . *** *** . *** adjusted analysis (we can compare Mantel-Haenszel and logistic regn) *** . *** *** . ***************************************************************************** . . mhodds case newiron age female Mantel-Haenszel estimate of the odds ratio Comparing newiron==1 vs. newiron==0, controlling for age and female ---------------------------------------------------------------- Odds Ratio chi2(1) P>chi2 [95% Conf. Interval] ---------------------------------------------------------------- 1.104245 0.39 0.5316 0.809221 1.506829 ---------------------------------------------------------------- . . xi: logistic case newiron female i.age i.age _Iage_1-4 (naturally coded; _Iage_1 omitted) Logit estimates Number of obs = 908 LR chi2(5) = 120.58 Prob > chi2 = 0.0000 Log likelihood = -539.11767 Pseudo R2 = 0.1006 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | 1.093978 .1743566 0.56 0.573 .8004709 1.495106 female | .1993713 .0372928 -8.62 0.000 .1381796 .2876613 _Iage_2 | 1.983848 .4025051 3.38 0.001 1.332929 2.952634 _Iage_3 | 2.360769 .470569 4.31 0.000 1.597293 3.489172 _Iage_4 | .9857626 .2874531 -0.05 0.961 .5566188 1.745769 ------------------------------------------------------------------------------ . logit Logit estimates Number of obs = 908 LR chi2(5) = 120.58 Prob > chi2 = 0.0000 Log likelihood = -539.11767 Pseudo R2 = 0.1006 ------------------------------------------------------------------------------ case | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | .0898209 .1593785 0.56 0.573 -.2225551 .402197 female | -1.612586 .1870517 -8.62 0.000 -1.979201 -1.245972 _Iage_2 | .6850382 .2028911 3.38 0.001 .2873789 1.082698 _Iage_3 | .8589874 .1993287 4.31 0.000 .4683103 1.249664 _Iage_4 | -.0143397 .2916048 -0.05 0.961 -.5858747 .5571953 _cons | -.6455109 .1712649 -3.77 0.000 -.9811841 -.3098378 ------------------------------------------------------------------------------ . . ***** save logL2 so that we can use this for 1(i) . lrtest, saving(2) . . ***** let's get STATA to calculate the comparison in 1(h) . lincom _Iage_4 - _Iage_3, or ( 1) - _Iage_3 + _Iage_4 = 0.0 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | .41756 .1144447 -3.19 0.001 .2440179 .7145226 ------------------------------------------------------------------------------ . . . ***** likelihood ratio test of newiron . . xi: logistic case female i.age i.age _Iage_1-4 (naturally coded; _Iage_1 omitted) Logit estimates Number of obs = 908 LR chi2(4) = 120.26 Prob > chi2 = 0.0000 Log likelihood = -539.27623 Pseudo R2 = 0.1003 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- female | .1955012 .035945 -8.88 0.000 .1363475 .2803186 _Iage_2 | 1.977409 .400921 3.36 0.001 1.328969 2.942241 _Iage_3 | 2.348184 .4673042 4.29 0.000 1.589781 3.468382 _Iage_4 | .9774394 .284536 -0.08 0.938 .5524616 1.729329 ------------------------------------------------------------------------------ . logit Logit estimates Number of obs = 908 LR chi2(4) = 120.26 Prob > chi2 = 0.0000 Log likelihood = -539.27623 Pseudo R2 = 0.1003 ------------------------------------------------------------------------------ case | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- female | -1.632189 .1838605 -8.88 0.000 -1.992549 -1.271829 _Iage_2 | .6817876 .2027506 3.36 0.001 .2844036 1.079172 _Iage_3 | .8536424 .1990066 4.29 0.000 .4635965 1.243688 _Iage_4 | -.022819 .2911035 -0.08 0.938 -.5933713 .5477333 _cons | -.6085052 .1579415 -3.85 0.000 -.9180648 -.2989455 ------------------------------------------------------------------------------ . lrtest, saving(1) . . lrtest, using(2) model(1) Logistic: likelihood-ratio test chi2(1) = 0.32 Prob > chi2 = 0.5733 . . ***************************************************************************** . *** *** . *** What is impact of age adjustment on the newiron OR? Let's fit w/o *** . *** age and assess the change in the newiron coef (or OR) as compared *** . *** to the model that does include age (fit above as first model). *** . *** *** . *** *** . ***************************************************************************** . . logistic case newiron female Logit estimates Number of obs = 908 LR chi2(2) = 94.59 Prob > chi2 = 0.0000 Log likelihood = -552.11388 Pseudo R2 = 0.0789 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | 1.074358 .168407 0.46 0.647 .7901731 1.46075 female | .2056106 .0379308 -8.57 0.000 .1432244 .2951713 ------------------------------------------------------------------------------ . logit Logit estimates Number of obs = 908 LR chi2(2) = 94.59 Prob > chi2 = 0.0000 Log likelihood = -552.11388 Pseudo R2 = 0.0789 ------------------------------------------------------------------------------ case | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | .0717235 .1567512 0.46 0.647 -.2355032 .3789502 female | -1.581771 .1844787 -8.57 0.000 -1.943343 -1.2202 _cons | -.1272195 .0994988 -1.28 0.201 -.3222335 .0677946 ------------------------------------------------------------------------------ . . . ***************************************************************************** . *** *** . *** Now analysis that evaluates the interaction between gender and iron *** . *** *** . ***************************************************************************** . . generate ironXgen = newiron * female . . xi: logistic case newiron female i.age ironXgen i.age _Iage_1-4 (naturally coded; _Iage_1 omitted) Logit estimates Number of obs = 908 LR chi2(6) = 121.53 Prob > chi2 = 0.0000 Log likelihood = -538.64497 Pseudo R2 = 0.1014 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | 1.031242 .1753462 0.18 0.856 .7389706 1.439109 female | .1826622 .0382674 -8.12 0.000 .1211501 .2754062 _Iage_2 | 1.969728 .3997007 3.34 0.001 1.323363 2.931795 _Iage_3 | 2.362038 .4708577 4.31 0.000 1.598104 3.491151 _Iage_4 | .9909091 .2893378 -0.03 0.975 .5591001 1.756217 ironXgen | 1.570638 .7147825 0.99 0.321 .6437277 3.832215 ------------------------------------------------------------------------------ . logit Logit estimates Number of obs = 908 LR chi2(6) = 121.53 Prob > chi2 = 0.0000 Log likelihood = -538.64497 Pseudo R2 = 0.1014 ------------------------------------------------------------------------------ case | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | .0307635 .1700341 0.18 0.856 -.3024972 .3640242 female | -1.700117 .209498 -8.12 0.000 -2.110725 -1.289508 _Iage_2 | .6778957 .2029217 3.34 0.001 .2801764 1.075615 _Iage_3 | .8595246 .1993439 4.31 0.000 .4688179 1.250231 _Iage_4 | -.0091324 .2919923 -0.03 0.975 -.5814268 .5631619 ironXgen | .4514818 .4550906 0.99 0.321 -.4404794 1.343443 _cons | -.6219969 .1726622 -3.60 0.000 -.9604087 -.2835851 ------------------------------------------------------------------------------ . . . ***** here is the estimated odds ratio comparing newiron=1 to newiron=0 . ***** for female=0 . . lincom newiron, or ( 1) newiron = 0.0 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.031242 .1753462 0.18 0.856 .7389706 1.439109 ------------------------------------------------------------------------------ . . . ***** here is the estimated odds ratio comparing newiron=1 to newiron=0 . ***** for female=1 . . lincom newiron + ironXgen, or ( 1) newiron + ironXgen = 0.0 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 1.619707 .6840986 1.14 0.254 .707821 3.706376 ------------------------------------------------------------------------------ . . . ***** notice these are similar to what M-H gave us (but not the same) . . mhodds case newiron age, by(female) Mantel-Haenszel estimate of the odds ratio Comparing newiron==1 vs. newiron==0, controlling for age by female ------------------------------------------------------------------------------- female | Odds Ratio chi2(1) P>chi2 [95% Conf. Interval] ----------+-------------------------------------------------------------------- male | 1.024825 0.02 0.8859 0.733069 1.432698 female | 1.896966 2.20 0.1382 0.802011 4.486823 ------------------------------------------------------------------------------- Mantel-Haenszel estimate controlling for age and female ---------------------------------------------------------------- Odds Ratio chi2(1) P>chi2 [95% Conf. Interval] ---------------------------------------------------------------- 1.104245 0.39 0.5316 0.809221 1.506829 ---------------------------------------------------------------- Test of homogeneity of ORs (approx): chi2(1) = 1.75 Pr>chi2 = 0.1864 . . ***** here are separate logistic regressions for MALEs and FEMALEs . . xi: logistic case newiron i.age if female==0 i.age _Iage_1-4 (naturally coded; _Iage_1 omitted) Logit estimates Number of obs = 617 LR chi2(4) = 23.89 Prob > chi2 = 0.0001 Log likelihood = -414.94961 Pseudo R2 = 0.0280 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | 1.024823 .1746161 0.14 0.886 .7338644 1.431141 _Iage_2 | 2.062983 .4573794 3.27 0.001 1.335911 3.185764 _Iage_3 | 2.137185 .4604983 3.52 0.000 1.400987 3.260244 _Iage_4 | .7289661 .2428395 -0.95 0.343 .3794441 1.400448 ------------------------------------------------------------------------------ . . xi: logistic case newiron i.age if female==1 i.age _Iage_1-4 (naturally coded; _Iage_1 omitted) Logit estimates Number of obs = 291 LR chi2(4) = 9.97 Prob > chi2 = 0.0410 Log likelihood = -120.34214 Pseudo R2 = 0.0398 ------------------------------------------------------------------------------ case | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- newiron | 1.894384 .8215262 1.47 0.141 .8097156 4.432038 _Iage_2 | 2.087206 1.24012 1.24 0.216 .6513599 6.688204 _Iage_3 | 4.265295 2.473971 2.50 0.012 1.368461 13.29431 _Iage_4 | 3.082304 2.062106 1.68 0.092 .8306332 11.43778 ------------------------------------------------------------------------------ . . . . end of do-file