Announcement

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

  • Three-level multilevel model-Stata is running a random slope for something constant

    I'm currently working with panel data with five waves of data. Persons are nested within teams, so I'm treating team as level 3, person as level 2, and survey submission as level 1.
    A person's race is constant, so in theory, Stata shouldn't let me ask for race to have a random slope at the person level. However, it does and the variance is quite large. In contrast the variance at the team level is pretty much nil. Here is the output. ExternalReference is the unique id of each person. Could someone explain what Stata is doing here? Also, what should I be doing to run this if I want to see if the effect of race varies at the team level? Should I enter it as a series of dummies and put the variable names after "team:" with/without an R or i prefix?

    Code:
    . mixed aghiw i.raceB || team: R.raceB || ExternalReference: R.raceB,  residuals(ar 1, t(wave))
    Note: time gaps exist in the estimation data
    
    Computing standard errors:
    
    Mixed-effects ML regression                     Number of obs     =        391
    
    -------------------------------------------------------------
                    |     No. of       Observations per Group
     Group Variable |     Groups    Minimum    Average    Maximum
    ----------------+--------------------------------------------
               team |         14         18       27.9         40
       ExternalRe~e |         85          2        4.6          5
    -------------------------------------------------------------
    
                                                    Wald chi2(6)      =       2.60
    Log likelihood = -350.29526                     Prob > chi2       =     0.8569
    
    ------------------------------------------------------------------------------
           aghiw |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           raceB |
       Hispanic  |   .0525582   .2350682     0.22   0.823    -.4081669    .5132833
          Black  |  -.0869336   .3276859    -0.27   0.791    -.7291862    .5553189
          Asian  |   .1653421   .1415124     1.17   0.243     -.112017    .4427012
    Asian-White  |   .0855664   .2103184     0.41   0.684    -.3266502    .4977829
     M. Eastern  |   .2873001   .2822071     1.02   0.309    -.2658156    .8404158
          Other  |  -.1040551   .3185585    -0.33   0.744    -.7284184    .5203081
                 |
           _cons |   3.566309   .0871464    40.92   0.000     3.395505    3.737113
    ------------------------------------------------------------------------------
    
    ------------------------------------------------------------------------------
      Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
    -----------------------------+------------------------------------------------
    team: Identity               |
                    var(R.raceB) |   1.34e-12   3.29e-12      1.09e-14    1.66e-10
    -----------------------------+------------------------------------------------
    ExternalRe~e: Identity       |
                    var(R.raceB) |   .1950636    .048428      .1199086    .3173233
    -----------------------------+------------------------------------------------
    Residual: AR(1)              |
                             rho |   .2612881   .0875236       .083185    .4232158
                          var(e) |   .2894514   .0331079      .2313204    .3621908
    ------------------------------------------------------------------------------
    LR test vs. linear model: chi2(3) = 127.98                Prob > chi2 = 0.0000
    
    Note: LR test is conservative and provided only for reference.

  • #2
    You'll need to create indicator variable you want to get a random slope

    Comment


    • #3
      I tried that but I have a similar problem. For example, I have a dummy variable for whether a participant is Asian (1) or non-Asian (0). and I can run this:

      Code:
      mixed cow  i.asian || team: asian || ExternalReference: asian ,  covar(unstr) residuals(ar 1, t(wave))
      And I have verified the value is constant for each participant:

      Code:
      sort ExternalRef asian
      by ExternalRef: assert asian[1]==asian[_N]
      However, I get a slope variance of 0.25 at the person level:

      Code:
      ------------------------------------------------------------------------------
        Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
      -----------------------------+------------------------------------------------
      team: Independent            |
                        var(asian) |    .000748   .0659587      6.55e-79    8.54e+71
                        var(_cons) |   .0192739   .0224364      .0019683    .1887296
      -----------------------------+------------------------------------------------
      ExternalRe~e: Unstructured   |
                        var(asian) |   .2589852   16.66825      4.27e-56    1.57e+54
                        var(_cons) |   .1414273   .0442256      .0766222     .261043
                  cov(asian,_cons) |  -.1297135   8.333547     -16.46317    16.20374
      -----------------------------+------------------------------------------------
      Residual: AR(1)              |
                               rho |   .2100246   .0888534      .0310015    .3759913
                            var(e) |   .2532596   .0276065      .2045413    .3135818
      ------------------------------------------------------------------------------

      Comment


      • #4
        This whole thread is premised on a misunderstanding.
        A person's race is constant, so in theory, Stata shouldn't let me ask for race to have a random slope at the person level.
        That's simply not true. Even though a person's race is constant, it is entirely possible that the effect of race on cow differs from one person to the next. And that is what the random slope is about. A random slope can also be thought of as a cross-level interaction. What you are modeling here is an interaction between person and race, the notion that the effect of race differs among people. There is no reason you shouldn't be allowed to model that.

        Comment


        • #5
          I think I misstated the problem. Stata is estimating something at the within-person level. I have several waves of data so cow varies across waves within persons. However, race doesn't vary within persons, so at that level Stata can't say the race-cow slope is say 1.2 for person #1 and 1.4 for person #2.

          But maybe I'm missing something here.

          Comment


          • #6
            But no, -mixed- does not provide estimates of within-person effects. First, an underlying assumption of these models is that the between-person and within-person slopes are the same. And the estimate produced for any slope is a mixture of the estimates you would get from purely within-person and purely between-person estimates. Since your data provides no information about the within-person effect of race (since race doesn't change within person), what you would get without a random effect at the person level, would be a purely between-person estimate of the race effect (which, by assumption, is the same as the within-person effect). Now when you add in the random slope, what Stata is doing is finding a value of the random intercept at the person level, and a value of a coefficient for the race indicator for each person that maximizes the likelihood of the data. This model would seem to be unidentifiable: you should be able to trade off one with the other in infinitely many ways. But it is not unidentifiable because the model's constraint that the random intercepts and random slopes are normally distributed is an identifying constraint. It may not be a meaningful way to identify the model, and I would not blame you for questioning how, if at all, these results can be interpreted. But then if you are aware of this problem, I can only ask why you included a random slope in the model in the first place. Why not just omit it from the model?

            Comment


            • #7
              It was a way of kicking the tires, I suppose. Thank you for that explanation. I now understand why I don't get an error. I originally learned modeling in HLM7, which wouldn't let you add a random slope for invariant variables.

              Comment

              Working...
              X