Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: margins and xtmixed


From   Ricardo Ovaldia <ovaldia@yahoo.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: margins and xtmixed
Date   Wed, 14 Mar 2012 10:35:53 -0700 (PDT)

David Hoaglin asked:

>I am not sure that I understand the random-effects part of your model.
>For each id it specifies a random intercept.  Also, for each id it
>specifies a random coefficient for group.  Please say more about the
>structure of your data.  How is id related to group (and to time)?

Patients were randomly allocated to three treatment groups. Each patient was followed for a year and measurements made at baseline and every three months. Interest is on the effect of treatment. The model allows for a random intercept and I also allow for each treatment to have a different slope (i.e. the -||Id:group-  part of the syntax statement). I am also allowing for and interaction between time (month and group). 

Ricardo


--- On Wed, 3/14/12, Ricardo Ovaldia <ovaldia@yahoo.com> wrote:

> From: Ricardo Ovaldia <ovaldia@yahoo.com>
> Subject: st: margins and xtmixed
> To: "Statalist" <statalist@hsphsun2.harvard.edu>
> Date: Wednesday, March 14, 2012, 8:24 AM
> 
> 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/
> 

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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index