Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Song, Lin" <Lin.Song@kingcounty.gov> |
To | "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu> |
Subject | st: xtmelogit and confidence interval for the random effect |
Date | Tue, 17 Sep 2013 15:12:11 +0000 |
Dear Statalisters, I have a question on how to calculate the confidence interval for the random effect after xtmelogit. Using the BRSS data at the individual level for King County, my model is: -xtmelogit obese var1 var2 || area: Var1 is individual level data such age and race Var2 is area level data such as poverty Area: is the 48 health reporting areas in King County After the model, I created the following post estimation variables and my purpose is to obtain the rate of obese and 95% CI at the area level: -predict mu1, mu -predict area_xb, xb -predict area_re_m1, reffects level(area) -predict area_re_s1, reses level(area) -gen mu2 = 1 /(1+exp(-1*(area_xb + area_re_m1))) -gen se2 = 1 /(1+exp(-1*(area_re_s1))) -sort area -by area: gen dup=_n -by area: egen arearate1=mean(mu1) -by area: egen arearate2=mean(mu2) *Here I was able to confirm that arearate1=arearate2. *I then selected one record per area and calculate the confidence interval below: -keep if dup==1 gen area_lo=arearate1-1.96*se2 gen area_hi=arearate1+1.96*se2 However, the confidence interval results seem to be incorrect (too wide). Could someone tell me what I did wrong and what is the correct way to calculate the SE and confidence interval? Thanks a lot. Lin Lin Song Epidemiologist Public Health - Seattle & King County (206) 263-8773 * * 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/