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

# st: margins and xtmixed

 From Ricardo Ovaldia <[email protected]> To Statalist <[email protected]> Subject st: margins and xtmixed Date Wed, 14 Mar 2012 06:24:14 -0700 (PDT)

```I am using –margins- and –test- after –xtmixed- to test if “groups” differ at specific times. Time is discrete in this study.
I am concerned with the small SE that margin reports (delta-method adjusted). Small differences are found significant.Any help would be appreciated

Here is an example:

I fit the following -xtmixed- model:
. xtmixed ft i.group##month || id: group, cov(unstructured) mle

And I am interested in comparing the group effect at certain time, 3 months for example, I used –margins, post- and then –test-:

. margins, over(group month) post

Predictive margins                                Number of obs   =        344

Expression   : Linear prediction, fixed portion, predict()
over         : group month

------------------------------------------------------------------------------
|            Delta-method
|     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
group#month |
1  3  |   6.382194   .0760204    83.95   0.000     6.233196    6.531191
1  6  |   7.693377   .0819562    93.87   0.000     7.532746    7.854008
1  9  |   8.709543   .1006514    86.53   0.000      8.51227    8.906816
1 12  |   9.167792   .1323406    69.27   0.000     8.908409    9.427175
2  3  |   6.053284   .0700887    86.37   0.000     5.915913    6.190655
2  6  |   7.900573   .0777758   101.58   0.000     7.748135    8.053011
2  9  |   9.124052   .1023024    89.19   0.000     8.923543    9.324561
2 12  |   10.04959   .1374368    73.12   0.000     9.780223    10.31897
3  3  |   6.074073   .0780239    77.85   0.000     5.921149    6.226997
3  6  |   7.949809   .0856802    92.78   0.000     7.781879    8.117739
3  9  |   9.337498   .1128377    82.75   0.000      9.11634    9.558655
3 12  |   10.14703   .1480792    68.52   0.000     9.856798    10.43726
------------------------------------------------------------------------------

. test 1.group#3.month= 2.group#3.month= 3.group#3.month

( 1)  1bn.group#3bn.month - 2.group#3bn.month = 0
( 2)  1bn.group#3bn.month - 3.group#3bn.month = 0

chi2(  2) =   12.22
Prob > chi2 =    0.0022

Is this correct?

Thank you,
Ricardo

Ricardo Ovaldia, MS
Statistician
Oklahoma City, OK

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