Statalist


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

Re: st: xtmixed & PROC MIXED


From   Scott Baldwin <[email protected]>
To   [email protected]
Subject   Re: st: xtmixed & PROC MIXED
Date   Tue, 15 Dec 2009 08:15:24 -0700

It looks like one potential thing that may be causing the difference
between PROC MIXED and xtmixed is that in PROC MIXED you use the
repeated statement (which deals with the within-subject residuals --
with subject being whatever you define it as -- PTNO in this case) and
in xtmixed you used random effects (identical to the RANDOM statement
in MIXED). So the xtmixed analysis estimates one more parameter than
the PROC MIXED analysis.

To replicate PROC MIXED as you have it, you'll need Stata 11. The
xtmixed code should look something like this:

xi: xtmixed Change1 i.visit Male EQ5D1 || PTNO: , noconstant
residuals(unstructured, t(visit)) variance

The t(visit) provides an id for the repeated measures within PTNO.
Specifying PTNO with noconstant will leave the random effects empty
but will provide the "subject" for the repeated measures (i.e., saying
that the repeated measures are within PTNO). In any case, this should
get you the same answer as you PROC MIXED code.

You could replicate your xtmixed code in SAS if you changed the
repeated statement to random (I'm pretty sure you don't have to change
anything else.)

Which one you do depends on your research question.

Hope that helps.
Best,
Scott


On Tue, Dec 15, 2009 at 7:33 AM, Lucas Goossens <[email protected]> wrote:
>
> Scott,
>
> This is my PROC MIXED code:
>
> proc mixed data=work.dataeq5d ORDER=DATA;
> class visit PTNO male;
> model change1=visit male eq5d1 /s;
> repeated visit/type=un subject=PTNO;
> run;
>
> And this is my xtmixed code:
>
>
> tabulate visit, generate(visit_)
> xi: xtmixed Change1 i.visit Male EQ5D1 ||PTNO: visit_* ,
> covariance(unstructured)  ///
> noconstant nostderr nolrtest variance
>
>
> (In my previous posting I referred to Joseph Coveney's answer on 6 Jan 2009.
> I must have done something wrong, because my question did not appear in the
> same thread.)
>
>
> Best,
> Lucas
>
>
>
> Date: Fri, 11 Dec 2009 09:14:25 -0700
> From: Scott Baldwin <[email protected]>
> Subject: Re: st: xtmixed & PROC MIXED
>
> I think I could help you figure out what is going on here but would
> need to see both the PROC MIXED code and xtmixed code you used. So if
> you could post that information, I can give you some more help.
>
> Best,
> Scott
>
>
>
>
>
>
> --
> Lucas Goossens, MSc
> institute for Medical Technology Assessment (iMTA)
> institute for Health Policy and Management (iBMG)
> Health Economics and Health Technology Assessment section
>
> Erasmus University L3-092, Woudestein Campus
> Burg. Oudlaan 50, 3062 PA Rotterdam
> P.O. Box 1738, 3000 DR Rotterdam
> The Netherlands
>
> T +31 10 408 8582
> F +31 10 408 9081
> E [email protected]
> I www.imta.nl
> I www.bmg.eur.nl
>
>
>
> --
> Lucas Goossens, MSc
> institute for Medical Technology Assessment (iMTA)
> institute for Health Policy and Management (iBMG)
> Health Economics and Health Technology Assessment section
>
> Erasmus University L3-092, Woudestein Campus
> Burg. Oudlaan 50, 3062 PA Rotterdam
> P.O. Box 1738, 3000 DR Rotterdam
> The Netherlands
>
> T +31 10 408 8582
> F +31 10 408 9081
> E [email protected]
> I www.imta.nl
> I www.bmg.eur.nl
>
>
>
> *
> *   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index