Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
"Reg Jordan" <drreg@earthlink.net> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: Question about ir |

Date |
Wed, 7 Nov 2012 10:03:31 -0500 |

Stata 12.1 updated, Win7 64-bit system I have a dataset from which I would like to determine the incidence rate of coronary heart disease (chd) by BMI class. ir var(cases) var(exposed) risk time, by(bmiclass) , should work, but I'm having problems with var(exposed). It should be the number of subjects in each bmiclass, but how do I express this as a variable? bmiclass | N ---------------+---------- 1. underweight | 57 2. normal | 1936 3. overweight | 1845 4. obese | 596 ---------------+---------- Total | 4434 -------------------------- I suppose I could use another variable, like sex1: Summary for variables: sex1 by categories of: bmiclass (BMI index) bmiclass | N ---------------+---------- 1. underweight | 57 2. normal | 1936 3. overweight | 1845 4. obese | 596 ---------------+---------- Total | 4434 -------------------------- But . ir chd sex1 time, by(bmiclass) yields BMI index | IRR [95% Conf. Interval] M-H Weight -----------------+------------------------------------------------- 1. underweight | . . . 0 2. normal | . . . 0 3. overweight | . . . 0 4. obese | . . . 0 -----------------+------------------------------------------------- Crude | . . . (exact) M-H combined | . . . ------------------------------------------------------------------- A brute force approach yields, for example . ir chd sex1 time if bmiclass == 1 | Sex, exam 1 | | Exposed Unexposed | Total -----------------+------------------------+------------ Incident Hosp MI | 6 0 | 6 Time [years] to | 1119.57 0 | 1119.57 -----------------+------------------------+------------ | | Incidence rate | .0053592 . | .0053592 | | | Point estimate | [95% Conf. Interval] |------------------------+------------------------ Inc. rate diff. | . | . . Inc. rate ratio | . | . . Attr. frac. ex. | 1 | . 1 Attr. frac. pop | 1 | +------------------------------------------------- (midp) Pr(k>=6) = 0.5000 (exact) (midp) 2*Pr(k>=6) = 1.0000 (exact) Thanks for your assistance. Reg Jordan * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/

- Prev by Date:
**Re: st: xtlogit, margins** - Next by Date:
**RE: st: conditional merging** - Previous by thread:
**st: Problems estimating margins with factor variables in cmp** - Next by thread:
**st: Need help weighting observations in a random-effects regression** - Index(es):