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

# st: RE: Random slope model in xtmixed

 From Nicola Man To "statalist@hsphsun2.harvard.edu" Subject st: RE: Random slope model in xtmixed Date Tue, 17 Apr 2012 03:08:02 +0000

```Dear David and Daniel,

Thanks for the replies.  Sorry, I actually cut and paste a command that issued a different set of results in my attempt to keep the posted outputs as brief as possible.

And yes, the cov(uns) solved the problem and makes more sense as a model.

Regards,
Nicola
-------------------------
I think this is due to not modeling the covariance of level and slope. The covariance changes depending on where the year (slope) is centered. The estimation appears to be coming up with different values of the other random effects in an attempt to compensate for the un-modeled covariance, which is different in each case. I believe that difference in random effects then drive the differences in fixed effects, as well as account for the overall LL differences.

You can quickly see if I am on the right track by specifying "cov(unstructured)" and running the models again.

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nicola Man
Sent: Tuesday, April 03, 2012 11:09 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: Random slope model in xtmixed

Hi,

I have a question about fitting random slopes in mixed models that I can't make sense of.  The random slope variable is year which ranges from 2004 to 2009.  As an illustrative example, I fitted two models which are exactly the same except:

Model 1) year, y2009, is recalculated so that 2009 gets a value of 0 to 2004 which gets a value of -5 (i.e. y2009=2009-Year)

Model 2) year, y2007, is recalculated so that 2009 gets a value of 2 to 2004 which gets a value of -3 (i.e. y2007=2007-Year)

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