* do-file for home assignment 3 of vhm 811, Fall semester 2007 * Henrik Stryhn version 10 use "a3.dta", clear * crude associations cc case aircirc [fw=n] tabulate case hsize [fw=n], chi2 expected * odds-ratios against baseline category cci 23 6 48 34 cci 20 6 29 34 cci 9 6 9 34 cci 58 6 13 34 * odds-ratios at a cutpoint gen hsize200=hsize>=2 gen hsize300=hsize>=3 gen hsize400=hsize>=4 gen hsize500=hsize>=5 cc case hsize200 [fw=n] cc case hsize300 [fw=n] cc case hsize400 [fw=n] cc case hsize500 [fw=n] * Mantel-Haenszel estimate for aircirc cc case aircirc [fw=n], by(hsize) * association with outcome among exposure-negative tabulate case hsize if aircirc==0 [fw=n], chi2 expected exact cc case hsize200 if aircirc==0 [fw=n] cc case hsize300 if aircirc==0 [fw=n] cc case hsize400 if aircirc==0 [fw=n] cc case hsize500 if aircirc==0 [fw=n] * association with exposure among controls tabulate aircirc hsize if case==0 [fw=n], chi2 expected * frequency distribution of farm size among cases tabulate case hsize [fw=n], row