Announcement

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

  • Unexpected results after estimating mixed with weights

    Dear all,

    I have longitudinal data and a binary treatment indicator. I would like to match my sample on one outcome variable at t1 to study whether the trajectories of the two groups differ, accounting for initial group differences. I generate a matching weight using entropy balancing. This works fine. When I test the balancing with a simple OLS regression on the outcome at t1 using the weights, the group difference is virtually zero. However, when I estimate the mixed model with all panel waves, I see large group differences, even at t1. The command is like follows:

    Code:
    mixed outcome i.wave##i.group [pweight=mygenweight] || id:
    I proceed to create a marginsplot which looks as follows:
    Click image for larger version

Name:	test.png
Views:	1
Size:	88.2 KB
ID:	1748002

    as you can see, the groups are always different, even at t1, where the weights should force them to be equal. When I estimate the same model with regress, it works as intended. I am a bit surprised by this huge differences I see between the two models. From a statistical point of view, mixed is superior to regress as the data is panel. I wonder what causes this behaviour. Am I making a mistake here or is mixed not the right way? Any suggestions?

    Best wishes
    Last edited by Felix Bittmann; 27 Mar 2024, 06:03.
    Best wishes

    (Stata 16.1 MP)

  • #2
    I think I have found the solution. Since mixed usually includes at least 2 levels, the handling of weights is different. For level 2 weights, as in this case, the option pweight() should be specified.
    Best wishes

    (Stata 16.1 MP)

    Comment


    • #3
      I think you might want to revise your understanding on this issue. See help mixed##options.

      There it states that both frequency and sampling weights can be specified at level 1 or at higher levels. For lower level weights, you use the syntax you have in the first post:
      Code:
      mixed outcome i.wave##i.group [pweight=mygenweight] || id:
      But to specify the weights at level 2, you use the following syntax:
      Code:
      mixed outcome i.wave##i.group || id:, pweight(mygenweight)

      Comment


      • #4
        Thanks for the reply. I think your second syntax is what I need to apply since the generated weights are on level 2 (since they vary only between individuals but are constant within one person). My data are observations (L1) nested within individuals (L2).
        Best wishes

        (Stata 16.1 MP)

        Comment

        Working...
        X