Announcement

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

  • meologit to esttab changing var(_con) - what is happening?

    Hello,

    I ran a meologit command and then reported it with esttab, and I jut noticed that something is happening to the var(cons). Why is this value changing?


    Code:
    melogit move_n  i.event  i.wave || code:, or
    
    Fitting fixed-effects model:
    
    Iteration 0:   log likelihood = -180.46719  
    Iteration 1:   log likelihood = -180.26975  
    Iteration 2:   log likelihood = -180.26964  
    Iteration 3:   log likelihood = -180.26964  
    
    Refining starting values:
    
    Grid node 0:   log likelihood = -178.75979
    
    Fitting full model:
    
    Iteration 0:   log likelihood = -178.75979  
    Iteration 1:   log likelihood = -177.60135  
    Iteration 2:   log likelihood = -177.51383  
    Iteration 3:   log likelihood = -177.51367  
    Iteration 4:   log likelihood = -177.51366  
    
    Mixed-effects logistic regression               Number of obs     =        295
    Group variable:                 code                 Number of groups  =        225
    
                                                    Obs per group:
                                                                  min =          1
                                                                  avg =        1.3
                                                                  max =          2
    
    Integration method: mvaghermite                 Integration pts.  =          7
    
                                                    Wald chi2(4)      =      12.53
    Log likelihood = -177.51366                     Prob > chi2       =     0.0138
    ------------------------------------------------------------------------------
          move_n | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           event |
              1  |    2.35908   1.074402     1.88   0.059     .9662234    5.759804
              2  |    4.34694   4.935034     1.29   0.196     .4697036    40.22939
              3  |   7.296179   6.435996     2.25   0.024      1.29493    41.10973
                 |
          2.wave |   .1546896    .093249    -3.10   0.002     .0474619    .5041701
           _cons |   .3569965   .1362679    -2.70   0.007     .1689487    .7543503
    -------------+----------------------------------------------------------------
    code      |
       var(_cons)|   3.025472   2.253229                      .7028428    13.02351
    ------------------------------------------------------------------------------
    Note: Estimates are transformed only in the first equation.
    Note: _cons estimates baseline odds (conditional on zero random effects).
    LR test vs. logistic model: chibar2(01) = 5.51        Prob >= chibar2 = 0.0094
    
    . estat ic
    
    Akaike's information criterion and Bayesian information criterion
    
    -----------------------------------------------------------------------------
           Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
    -------------+---------------------------------------------------------------
               . |        295         .  -177.5137       6    367.0273   389.1492
    -----------------------------------------------------------------------------
                   Note: N=Obs used in calculating BIC; see [R] BIC note.
    
    . estimates store move1
    
    . 
    . esttab move1 , star(* 0.1 ** 0.05 *** 0.01) eform constant b(a2) compress ci aic bic
    
    -----------------------
                     (1)   
                  move_n   
    -----------------------
    move_n                 
    0b.event           .   
               _skip(10)   
    
    1.event         2.36*  
               [0.97,5.76]   
    
    2.event         4.35   
               [0.47,40.2]   
    
    3.event         7.30** 
               [1.29,41.1]   
    
    1b.wave            .   
               _skip(10)   
    
    2.wave          0.15***
               [0.047,0.50]   
    
    _cons           0.36***
               [0.17,0.75]   
    -----------------------
    /                      
    var(_con~)      20.6   
               [0.25,1705.7]   
    -----------------------
    N                295   
    AIC            367.0   
    BIC            389.1   
    -----------------------
    Exponentiated coefficients; 95% confidence intervals in brackets
    * p<0.1, ** p<0.05, *** p<0.01
    
    . 
    . 
    end of do-file

  • #2
    -esttab- is doing you a favor. Look closely at the -melogit- output. Immediately below the table you will see a note that says "Note: Estimates are transformed only in the first equation.
    var(_cons) is the second equation and the coefficient you see there, 3.025472 is untransformed--it is not the variance component estimate, it is its logarithm. To get the actual variance estimate, as opposed to the coefficient, you need to exponentiate that number. When you do that, you will get exactly the result shown by -esttab-. So your -esttab- output has everything in its natural metric (odds ratios and variance components).

    Comment


    • #3
      Ohhh, that makes sense. Is it a problem that it's so big?

      Comment


      • #4
        There is no absolute standard of "big" for variance components. The full potential range of such a parameter is, in principle, from 0 to infinity. Without knowing the context of your research and the meaning of your variables nobody can say whether this is implausibly large. And even if I knew them, unless you are working in my field, epidemiology, there's a good chance I wouldn't know. If you post back with information about your project, I'll give an opinion if I can, and if I can't, perhaps somebody else will.

        Comment


        • #5
          Love to hear your opinion if you can: looking at moving outcomes after experiencing a certain number of events; the variance should be related to the codes, which group people who responded to multiple surveys.

          Comment


          • #6
            Well, one way to look at it is this. You can imagine the population of codes (which I understand from #5 are some kind of groups of people) from which this sample was derived as having a normal distribution for some latent propensity to move, all else equal. The random intercept variance of that distribution is 20.6, which means its standard deviation is the square root of that, which is a bit over 4.5 So if you have two codes whose propensity to move are one standard deviation apart, all else equal, their log odds ratios will differ by 4.5, hence the odds ratio comparing those two codes, all else equal, is very high, at 93.6. In particular, if one of the codes is at the mean propensity to move, the regression says they have an odds of about 0.36 of moving, which corresponds to a move probability of around 26%. If the second code is one standard deviation above the mean propensity to move, that code's odds of moving will be 93.6 times as high, which is an odds of about 33.7, corresponding to a probability of 97% of moving.

            As I have no idea what these codes are or how you sampled them or what these events are, I really cannot offer an opinion whether this degree of variation in propensity to move seems unreasonably high or not. But presumably this is your area and you can make a judgment about that.

            Another way of looking at it is that the proportion of unexplained variance (intraclass correlation) in moving probability attributable to the code is 58%. Again, I have no intuitions as to whether that seems reasonable or not in this area.

            Comment


            • #7
              Hi Clyde, thanks again for that explanation! Honestly, that sounds pretty reasonable, even though it's high. I have a couple question on where you got some of the numbers: specifically, how did you translate from odds of 0.36 of moving to a probability of 26%? And how did you get the moving probability attributable to the code (58%)? Thanks again!

              Comment


              • #8
                odds = prob/(1-prob). If you solve that equation for prob, you get prob = 1/(1+1/odds). Plug in odds = 0.36 and you get prob = 0.26 after rounding.

                I did not say 58% of moving probability is attributable to the code. I said 58% of the unexplained variance in moving probability is attributable to the code. (I'm a stickler for careful use of language and can be pedantic about it, but sloppy language leads to sloppy thinking.) This comes from calculating the intraclass correlation coefficient. Let me be clear what that means: after accounting for the event and wave variables, there is unexplained variance: observations with the same values for event and wave can still have different outcomes. That variance can then be partitioned into two pieces: one is due to the differences between the different codes, and the rest is idiosyncratic differences that arise within the same code. The intraclass correlation is the ratio of the between-code differences to the total of between-code differences and within code differences. (It's kind of like an R2 for the code variable--but that is a very loose analogy, don't take it too seriously. I'm just trying to present a concept that is familiar and has some similarities conceptually.) Now, how do we calculate that? The between code variances are quantified by the variance component at the code level, which we have already identified as 20.6. The within-code variance in a (multi-level) logistic regression is always pi2/3. So we calculated 20.6/(20.6 + pi2/3) and I came out with 0.58 (again with some rounding). You could get that figure yourself more easily by running -estat icc- after the -melogit- command, by the way.

                Comment

                Working...
                X