# st: Group mean comparison with CI's from empty fe model

 From Torben Højmark Sørensen To statalist@hsphsun2.harvard.edu Subject st: Group mean comparison with CI's from empty fe model Date Tue, 14 Aug 2007 16:28:03 +0200

```Hi,
I'm a health economist and I'm trying to compare mean values af length of
stay for a specific patient group between 8 hospital departments by
calculating CI's. I'm not an econometrics expert and I hope someone can
help me with understanding a suggested (from a friend) program-code for
creating CI's of the fixed effect department means (deviation from total
mean):

The suggested fixed effect regression equation without any regressors:
yij = c + uj + eij,
where c is the total mean of length of stay for all patients and uj is the
deviation from c for department j=1-8.

*******************************************************
xtreg length_of_stay, i(hosp) fe
predict hosp_res, u
bysort hosp:tabstat hosp_res
collapse (mean) hosp_res, by(hosp)
gen sigma_e=2.6950446 // from the fe results

* patients pr. hospital department
gen pt=50
replace pt=23 if hosp==1501
replace pt=27 if hosp==3000
replace pt=45 if hosp==4202
replace pt=47 if hosp==6007
replace pt=34 if hosp==7026
replace pt=25 if hosp==7601
replace pt=22 if hosp==8001
gen se_hosp_res=(sigma_e/sqrt(pt))
gen L = hosp_res - 1.96*se_hosp_res
gen H = hosp_res + 1.96*se_hosp_res
********************************************************

My question is, that I don't understand the SD for the department specific
means "sigma_e/sqrt(pt)"? Is it calculated? Why is sigma_e used and not the

Cheers, Torben

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```