Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# Re: st: standard errors after xtmixed, predit.., fitted

 From Steve Samuels To statalist@hsphsun2.harvard.edu Subject Re: st: standard errors after xtmixed, predit.., fitted Date Sat, 17 Dec 2011 12:08:05 -0500

```Sorry, I hit the send button too soon: "week" should have been squared.
The corrected version is below.

Maybe something like:
*******************************************
set more off
webuse pig, clear
xtmixed weight week || id: week, reml
matrix list e(b)
scalar sd_err  = exp([lnsig_e]_cons )
scalar sd_week = exp([lns1_1_1]_cons)
scalar sd_pig  = exp([lns1_1_2]_cons)
scalar dir
predict se_fix,  stdp

gen se_fitted =  ///
sqrt(se_fix^2 +sd_pig^2 + (week*sd_week)^2 +sd_err^2)
*******************************************************

Steve
sjsamuels@gmail.com

On Dec 16, 2011, at 11:34 AM, Jennyfer Wolf wrote:

Dear Statalist,

sorry for asking the question again, but we are a bit desperate so it
would be great if anybody has a solution for my question:

Is it possible to get standard errors for the fitted values of a
multilevel-model (three levels, random slope and intercept) after

xtmixed dep_var indep_var || region1: || region2: || country :year_cat
predict var, fitted

?

We would like to present the estimated values with a confidence interval?
If it is not possible to get the standard errors for the predicted
values from Stata, is it possible to calculate these values from the
Standard Errors from the individual estimates?

Thank you very very much.
With kind regards,
Jennyfer
*
*   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/

*
*   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/
```