Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • interpreting results of group x time interaction in linear mixed effects model when there are multiple categories in group

    Hello. I am comparing rate of change of variable called score among 6 groups.
    In the group#visit_number output, I am not clear on what the values under the group#visit_number signify.
    Do they signify which groups are being compared?
    If so, I see that there is comparison of 3 to 2, 6 to 5 and so on, but how can I see the result of a given group compared to REFERENCE (group 1).

    I want to compare 2 to 1, 3 to 1, 4 to 1, 5 to 1 and 6 to 1.
    But I am not seeing that result. Please let me know what i am missing.

    To make it simple to answer my question: what row would you look at if you wanted to see how group 6 changes compared to group 1, over time?


    . mixed score i.group##visit_number || patno : visit_number, mle

    Performing EM optimization ...

    Performing gradient-based optimization:
    Iteration 0: Log likelihood = 580.94655
    Iteration 1: Log likelihood = 586.30183
    Iteration 2: Log likelihood = 586.51282
    Iteration 3: Log likelihood = 586.51328
    Iteration 4: Log likelihood = 586.51328

    Computing standard errors ...

    Mixed-effects ML regression Number of obs = 1,328
    Group variable: patno Number of groups = 375
    Obs per group:
    min = 2
    avg = 3.5
    max = 4
    Wald chi2(23) = 500.77
    Log likelihood = 586.51328 Prob > chi2 = 0.0000

    ---------------------------------------------------------------------------------------
    score | Coefficient Std. err. z P>|z| [95% conf. interval]
    ----------------------+----------------------------------------------------------------
    group |
    2 | .019064 .0581787 0.33 0.743 -.0949641 .1330921
    3 | -.0892064 .051162 -1.74 0.081 -.189482 .0110692
    4 | -.0585491 .0510619 -1.15 0.252 -.1586287 .0415304
    5 | -.0210644 .0526452 -0.40 0.689 -.1242472 .0821183
    6 | -.1391837 .0473668 -2.94 0.003 -.2320208 -.0463465
    |
    visit_number |
    2 | -.0014286 .0356258 -0.04 0.968 -.0712539 .0683967
    3 | -.0696863 .0369183 -1.89 0.059 -.1420448 .0026721
    4 | -.1670379 .0434714 -3.84 0.000 -.2522402 -.0818356
    |
    group#visit_number |
    2 2 | -.1461576 .046779 -3.12 0.002 -.2378427 -.0544725
    2 3 | -.1152624 .0485434 -2.37 0.018 -.2104056 -.0201192
    2 4 | -.0765087 .0580277 -1.32 0.187 -.190241 .0372236
    3 2 | -.0806349 .0411371 -1.96 0.050 -.1612622 -7.60e-06
    3 3 | .0194695 .0429981 0.45 0.651 -.0648052 .1037441
    3 4 | .0116841 .0497456 0.23 0.814 -.0858155 .1091837
    4 2 | -.0757589 .0410567 -1.85 0.065 -.1562286 .0047108
    4 3 | -.0594215 .04254 -1.40 0.162 -.1427984 .0239553
    4 4 | -.0139802 .0494889 -0.28 0.778 -.1109766 .0830162
    5 2 | -.1026891 .0423298 -2.43 0.015 -.1856539 -.0197242
    5 3 | -.0660205 .0438798 -1.50 0.132 -.1520233 .0199823
    5 4 | -.0394902 .0513101 -0.77 0.442 -.1400562 .0610757
    6 2 | -.0782993 .0380856 -2.06 0.040 -.1529457 -.0036529
    6 3 | -.0699047 .0394152 -1.77 0.076 -.1471572 .0073477
    6 4 | -.0419134 .0461162 -0.91 0.363 -.1322995 .0484726
    |
    _cons | .7371429 .0443076 16.64 0.000 .6503016 .8239841
    ---------------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    Random-effects parameters | Estimate Std. err. [95% conf. interval]
    -----------------------------+------------------------------------------------
    patno: Independent |
    var(visit_number) | 2.71e-14 3.66e-11 0 .
    var(_cons) | .0278998 .0023422 .0236669 .0328896
    -----------------------------+------------------------------------------------
    var(Residual) | .0133266 .0006116 .0121802 .0145808
    ------------------------------------------------------------------------------
    LR test vs. linear model: chi2(2) = 687.69 Prob > chi2 = 0.0000


  • #2
    Do they signify which groups are being compared?
    No. So when you have, for example the row headed by 4 3 under group#visit_number, this represents a difference in differences:
    A. There is the difference between group 4 and group 1 (the reference, omitted, group) at time 3.
    B. There is the difference between group 4 and group 1 at visit 1 (the reference time).
    The coefficient is the difference between A and B.

    ... but how can I see the result of a given group compared to REFERENCE (group 1).
    You can't, because in an interaction model you are stipulating that there is no such thing as the difference between any two groups. There are several differences between a given group and group 1: one for each visit number. But there is no single difference between the groups that applies at all times.

    what row would you look at if you wanted to see how group 6 changes compared to group 1, over time?
    Again, there is no where to look for that, because it does not exist. What you can do is look at:
    Group 6 compared to group 1 at time 1: the 6 row under group (not under group#visit_num).
    Group 6 compared to group 1 at time 2: the coefficient in the 6 row under group PLUS the coefficient in the 6 2 row of group#visit_num
    Group 6 compared to group 1 at time 3: the coefficient in the 6 row under group PLUS the coefficient in the 6 3 row of group#visit_num
    Group 6 compared to group 1 at time 4: the coefficient in the 6 row under group PLUS the coefficient in the 6 4 row of group#visit_num.

    Now, this is all rather inconvenient. What you should do to simplify this is, after the -mixed- command run
    Code:
    margins group#visit_num
    This will give you 24 rows of output, one for each of the 24 combinations of 6 groups and 4 time periods, and in each row you will see the expected value of score in each of those combinations (along with standard errors, CIs and test statistics).

    Now, given that there are 24 combinations, I doubt you want to compare them all with each other, as that would be 276 different comparisons, and I don't think anybody would be able to wrap his or her head around that.

    If you want to calculate an average difference between each of groups 2 through 6 and group 1, averaged over all the time periods, you can do that with:
    Code:
    margins, dydx(group)
    If you want to contrast group average differences between all pairs of groups, you can run
    Code:
    margins, dydx(group) pwcompare

    Comment


    • #3
      Thanks very much, this is so helpful, I really appreciate your time.

      Comment

      Working...
      X