Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: How to apply and interpret lincom function as an additional analysis to xtmixed
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: How to apply and interpret lincom function as an additional analysis to xtmixed
Date
Sat, 4 Jan 2014 09:37:41 +0100
I would use the factor variable notation instead of the outdated -xi:-
prefix. This is simple, you replace
xi: xtmixed measurement i.time*i.group || id: ,mle
with
xtmixed measurement i.time##i.group || id: ,mle
After that you can use -contrast-, -pwcompare- and -margins- to get at
the kind of thing you are looking for. For more details see: -help
fvvarlist-, -help margins-, -help contrast-, -help pwcompare-, and
-help margins_pwcompare-.
Hope this helps,
Maarten
On Fri, Jan 3, 2014 at 5:02 PM, Jakob Nielsen <[email protected]> wrote:
> Im using tmixed and need to make a post estimation analysis (lincom) in
> addition to the information I get from the xtmixed analysis. However, I
> have doubt how to write the command correctly.
>
> I am using Stata 12.1 for windows.
>
> -----
>
> Firstly,
> my dataset consists of two groups performing two different
> interventions. There is an uneven number of measurement points between
> the groups (4 vs. 3), but the first three measurements have been
> performed at the same time between the groups.
>
> Group 1 Group 2
> id Trial 1 Trial 2 Trial 3 Trial 4 Id Trial 1 Trial 2 Trial 3
> FP1 x.xx x.xx x.xx x.xx FP13 x.xx x.xx x.xx
> Fp2 x.xx x.xx x.xx x.xx Fp14 x.xx x.xx x.xx
> FP3 x.xx x.xx x.xx x.xx FP15 x.xx x.xx x.xx
> FP4 x.xx x.xx x.xx x.xx FP16 x.xx x.xx x.xx
> FP5 x.xx x.xx x.xx x.xx FP19 x.xx x.xx x.xx
> FP6 x.xx x.xx x.xx x.xx FP20 x.xx x.xx x.xx
> FP7 x.xx x.xx x.xx x.xx FP21 x.xx x.xx x.xx
> FP9 x.xx x.xx x.xx x.xx
> FP10 x.xx x.xx x.xx x.xx
> FP11 x.xx x.xx x.xx x.xx
>
> When I compute the xtmixed analysis, I have the above data on the long format, and I get an output looking like this:
>
> ----
> . xi: xtmixed measurement i.time*i.group || id: ,mle
> i.time _Itime_1-4 (naturally coded; _Itime_1 omitted)
> i.group _Igroup_1-2 (naturally coded; _Igroup_1 omitted)
> i.time*i.group _ItimXgro_#_# (coded as above)
> note: _ItimXgro_4_2 omitted because of collinearity
>
> Performing EM optimization:
>
> Performing gradient-based optimization:
>
> Iteration 0: log likelihood = 68.201963
> Iteration 1: log likelihood = 68.202082
> Iteration 2: log likelihood = 68.202082
>
> Computing standard errors:
>
> Mixed-effects ML regression Number of obs = 60
> Group variable: id Number of groups = 17
>
> Obs per group: min = 3
> avg = 3.5
> max = 4
>
>
> Wald chi2(6) = 164.59
> Log likelihood = 68.202082 Prob> chi2 = 0.0000
>
> -------------------------------------------------------------------------------
> measurement | Coef. Std. Err. z P>|z| [95% Conf. Interval]
> --------------+----------------------------------------------------------------
> _Itime_2 | .3080587 .032767 9.40 0.000 .2438365 .3722809
> _Itime_3 | .257 .0317744 8.09 0.000 .1947233 .3192767
> _Itime_4 | .238 .0317744 7.49 0.000 .1757233 .3002767
> _Igroup_2 | .0041429 .0391134 0.11 0.916 -.0725181 .0808038
> _ItimXgro_2_2 | -.3109158 .0501596 -6.20 0.000 -.4092268 -.2126049
> _ItimXgro_3_2 | -.2541429 .0495169 -5.13 0.000 -.3511941 -.1570916
> _ItimXgro_4_2 | 0 (omitted)
> _cons | .103 .0250987 4.10 0.000 .0538075 .1521925
> -------------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
> -----------------------------+------------------------------------------------
> id: Identity |
> sd(_cons) | .0353746 .0129137 .0172964 .0723481
> -----------------------------+------------------------------------------------
> sd(Residual) | .0710498 .0075191 .0577405 .0874268
> ------------------------------------------------------------------------------
> LR test vs. linear regression: chibar2(01) = 3.15 Prob>= chibar2 = 0.0379
>
> .----
>
> This
> is all fine. However in addition to this, I would like to get a
> comparison within group comparison of the timepoints, which is not
> provided with the xtmixed analysis.
>
> That being:
>
> Group 1: time 2 and 3
> Group 1: time 2 and 4
> Group 1: time 3 and 4
>
> And
>
> Group 2: time 1 and 2
> Group 2: time 1 and 3
> Group 2: time 2 and 3
>
> I have been told that the command to use is the following lincom commands:
>
> Group 1:
>
> lincom _Itime_2 + _Itime_3
>
> ( 1) [measurement]_Itime_2 + [measurement]_Itime_3 = 0
>
> ------------------------------------------------------------------------------
> measurement | Coef. Std. Err. z P>|z| [95% Conf. Interval]
> -------------+----------------------------------------------------------------
> (1) | .5650587 .0556139 10.16 0.000 .4560574 .6740599
> ------------------------------------------------------------------------------
>
> This should compare time 2 with time 3 in group 1.
>
> Group 2:
>
> lincom _Itime_2 + _ItimXgro_3_2
>
> ( 1) [measurement]_Itime_2 + [measurement]_ItimXgro_3_2 = 0
>
> ------------------------------------------------------------------------------
> measurement | Coef. Std. Err. z P>|z| [95% Conf. Interval]
> -------------+----------------------------------------------------------------
> (1) | .0539158 .0501596 1.07 0.282 -.0443951 .1522268
> ------------------------------------------------------------------------------
>
> This should compare time 2 with time 3 in group 2.
>
> However,
> I am not entirely sure, whether I have setup the command correctly.
> Thus, the question is, whether the above lincom command is correct setup
> in regards to the purpose (within group comparisons of time 2 and 3)?
>
> Thanks in advance.
>
> Best, Jakob Nielsen
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
--
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/