Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Fitzmaurice, Ann E." <a.e.fitzmaurice@abdn.ac.uk> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: calcuating unadjusted and adjusted means |
Date | Sun, 15 May 2011 15:01:44 +0100 |
Hi I run a regression and want to calculate the unadjusted and adjusted means of the sample included in the regression I run the following where the variable bir_grp has four categories was entered in the regression as i.bir_grp2 (sample_mod5 has previously been calculated) Regress ............ predict xb rename xb pred_m5 mean pred_m5 if sample_mod5 ==1 , over (bir_grp2) adjust if sample_mod5==1, by (bir_grp2) after this command I get an error message " variable miscbirth not found" mean babywt2 if sample_mod5==1 ,over (bir_grp2) This gives means for the four groups which are identical between the two methods that work , but the confidence intervals are different, Can anyone advise how to calculate the group means before and after regression Thanks Ann Ann E Fitzmaurice The University of Aberdeen is a charity registered in Scotland, No SC013683. * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/