Announcement

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

  • Is this ramdom effect model useful

    Hello everybody,
    I investigating on the effect that the financial crisis had on investment choices, to do so I created an unbalanced panel and I carried out a ramdom effect, fixed effect and pooled logistic regression. While Hausman test suggests me to use ramdom effect model, its sigma and rho_u values seem to suggest that it is not a good model for my research. I wanted to use the ramdom effect model because it takes into account the differences between individual study effects, and it may capture the heterogeneity of the individuals since my data are taken from a survey.
    Should I just use the pooled logistic?

    Code:
    logistic hequity hhsex age age2 educ race logincome crisis
    Code:
    xtlogit hequity hhsex age age2 educ race logincome crisis, re
    Code:
    xtlogit hequity hhsex age age2 educ race logincome crisis, fe
    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input byte(hequity hhsex age) float age2 byte(educ race) float(logincome logsaving crisis)
    1 1 47 2209  9 1  11.84469  8.276157 0
    1 1 45 2025 13 3 14.321605         0 0
    1 1 47 2209  8 3  11.05272         0 0
    1 1 75 5625  9 1 11.228642   7.34437 1
    0 1 54 2916  6 1  9.948541         0 1
    0 2 71 5041 10 1  9.485262         0 1
    0 2 79 6241  8 1  9.227393  8.916195 0
    1 1 52 2704 13 1 12.878615         0 0
    1 1 56 3136 14 1  14.69328         0 0
    1 2 59 3481 12 1  10.55031 10.409096 1
    0 1 22  484 11 1  10.04385  6.938386 1
    0 1 20  400  8 3 10.011355         0 1
    1 1 47 2209 14 1 12.953252  7.211447 0
    1 1 56 3136 12 1 15.388215  12.22335 0
    1 1 50 2500  5 1 11.571064  7.970753 0
    0 2 94 8836  4 1  9.796537         0 1
    0 1 53 2809  8 1 10.904053         0 1
    1 1 30  900  9 1 11.629843  8.006368 1
    1 1 58 3364 14 1  15.26895         0 0
    1 1 60 3600 11 1 11.718127         0 0
    1 1 61 3721  9 1 12.176177  9.000373 0
    0 1 63 3969  9 1   11.4666  7.270262 1
    1 1 48 2304 14 1 11.956755  7.120708 1
    1 2 33 1089  8 3 10.657982  5.298317 1
    1 1 65 4225  8 1 10.606814  7.596709 0
    1 1 39 1521  8 3 10.863712         0 0
    0 1 26  676  5 3 10.414632  7.054462 0
    0 1 50 2500  9 1 11.341437  4.705313 1
    1 1 57 3249 12 1 11.463668         0 1
    1 1 41 1681 13 1   11.6477  8.935904 1
    1 1 47 2209 13 1 15.382746         0 0
    1 1 76 5776  6 1 13.049764         0 0
    1 1 62 3844 12 1 11.717156         0 0
    0 1 23  529  7 2  9.275241  5.929089 1
    1 2 63 3969  8 1 10.418545         0 1
    0 2 25  625  8 1  9.628363         0 1
    1 1 39 1521 13 1  15.56797         0 0
    0 1 63 3969  8 1 12.200226  8.246787 0
    1 1 79 6241 12 1 13.936782         0 0
    1 1 68 4624 13 1 12.337154  6.868636 1
    1 1 46 2116 14 1 11.996234  7.274858 1
    1 1 29  841 13 1 11.063447  9.740969 1
    0 1 79 6241  3 1 10.417573  7.211447 0
    0 1 35 1225  2 3  10.43293         0 0
    0 1 49 2401  8 1 11.582237  6.361315 0
    1 1 53 2809  8 1 10.391245  6.497073 1
    1 1 35 1225 12 1 10.904053  7.274858 1
    0 2 30  900  6 2  10.21615         0 1
    1 1 49 2401 12 1 12.537836  9.003206 0
    1 1 57 3249 14 1 15.026494         0 0
    1 1 65 4225 13 4  11.03367         0 0
    1 1 42 1764 12 1 11.393396  9.715948 1
    1 2 31  961  9 2 10.248646  5.798952 1
    1 1 21  441  9 1  9.753526  9.159047 1
    1 1 32 1024 11 1 11.583324  7.904594 0
    0 1 54 2916  9 1 11.333716  8.629779 0
    0 2 40 1600  2 1  9.855016         0 0
    1 2 72 5184 12 1  10.55031         0 1
    0 1 32 1024  4 1 10.690478         0 1
    0 2 48 2304 11 1 10.657982  6.802395 1
    1 1 68 4624 12 1 15.565552         0 0
    1 1 74 5476 12 1 13.422875  8.534469 0
    1 1 54 2916 13 1  15.65789         0 0
    1 1 67 4489 14 3 12.276222         0 1
    1 1 50 2500  8 1 11.625637         0 1
    1 1 62 3844  8 4  10.76833  7.313221 1
    0 1 47 2209  8 3 12.282944         0 0
    1 1 33 1089 13 1  10.43293    6.7915 0
    0 1 30  900  9 3 11.256814 2.4492924 0
    0 1 56 3136  8 1  10.91577  2.402728 1
    1 1 54 2916 13 1   11.5972 9.0425205 1
    0 2 83 6889 10 1  9.405219         0 1
    1 1 76 5776  9 1 13.822928         0 0
    1 1 72 5184 13 1 14.697233         0 0
    1 1 33 1089 12 1  11.76456  9.133904 0
    0 1 63 3969 12 1 10.579297  3.095875 1
    0 1 28  784  8 2  10.82401         0 1
    0 1 37 1369  6 1  8.529751         0 1
    0 1 56 3136 13 1  9.724425         0 0
    0 2 74 5476  8 2 10.352887         0 0
    1 1 77 5929  8 1 10.532414  7.524466 0
    1 2 50 2500 12 1  10.89515  5.803926 1
    1 1 49 2401 12 1 11.463668  7.931638 1
    1 1 45 2025 12 3 11.665245 10.434115 1
    1 1 41 1681 12 1  12.12232  7.904594 0
    0 1 27  729  9 1 10.310328         0 0
    0 1 62 3844  9 1  9.385013         0 0
    0 1 53 2809 12 1  9.264659         0 1
    1 1 68 4624 13 1 14.107424         0 1
    1 1 68 4624  8 1  11.48466 10.106428 1
    1 1 58 3364 11 1 12.363482  9.919497 0
    1 1 51 2601  9 1 11.364488  10.33865 0
    0 1 43 1849  8 1 10.301303   7.74761 0
    1 1 85 7225 12 1 12.034584         0 1
    0 1 76 5776 13 1 14.175375         0 1
    1 1 45 2025 12 4  13.79864 11.418614 1
    1 2 29  841 12 1  10.90308  6.295156 0
    0 1 30  900 12 3 10.936033         0 0
    0 1 49 2401  4 1 8.8741865         0 0
    0 2 87 7569  8 1  9.508856         0 1
    end
    Thank you in advance for your great help!

  • #2
    Your question is about interpreting the results of an analysis, but you do not show the results themselves. You allude to concerns about two non-existent statistics, rho_u and sigma (I assume you meant rho and sigma_u), but you don't even say what their values are. My first thought was to replicate the analysis in your example data to see for myself, but that is not possible because the example data lacks a panel identifier variable. Please repost showing the output that you are concerned with interpreting. (Be sure to place the output between code delimiters so that it aligns nicely--if you are not familiar with code delimiters, please read Forum FAQ #12 for instructions.)

    Comment


    • #3
      Yes, I am sorry, results are as follows
      1) POOLED
      Code:
       logit hequity hhsex age age2 educ race logincome crisis
      
      Iteration 0:   log likelihood = -21445.742  
      Iteration 1:   log likelihood =  -14679.74  
      Iteration 2:   log likelihood = -14063.885  
      Iteration 3:   log likelihood = -14050.375  
      Iteration 4:   log likelihood = -14050.356  
      Iteration 5:   log likelihood = -14050.356  
      
      Logistic regression                               Number of obs   =      31879
                                                        LR chi2(7)      =   14790.77
                                                        Prob > chi2     =     0.0000
      Log likelihood = -14050.356                       Pseudo R2       =     0.3448
      
      ------------------------------------------------------------------------------
           hequity |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             hhsex |   -.059407    .035975    -1.65   0.099    -.1299166    .0111027
               age |   .0321019   .0052896     6.07   0.000     .0217345    .0424692
              age2 |   -.000256   .0000498    -5.14   0.000    -.0003536   -.0001585
              educ |   .2042289   .0062746    32.55   0.000      .191931    .2165269
              race |  -.3215373   .0179039   -17.96   0.000    -.3566284   -.2864463
         logincome |   1.137076   .0206597    55.04   0.000     1.096584    1.177568
            crisis |  -.0873179   .0303421    -2.88   0.004    -.1467872   -.0278485
             _cons |  -14.46458   .2479954   -58.33   0.000    -14.95064   -13.97852
      ------------------------------------------------------------------------------

      2) FIXED EFFECTS
      Code:
      xtlogit hequity hhsex age age2 educ race logincome crisis, fe
      note: multiple positive outcomes within groups encountered.
      note: 1118 groups (3324 obs) dropped because of all positive or
            all negative outcomes.
      
      Iteration 0:   log likelihood =  -6431.405  
      Iteration 1:   log likelihood = -6429.4227  
      Iteration 2:   log likelihood =  -6429.422  
      Iteration 3:   log likelihood =  -6429.422  
      
      Conditional fixed-effects logistic regression   Number of obs      =     28555
      Group variable: YY1                             Number of groups   =      5433
      
                                                      Obs per group: min =         2
                                                                     avg =       5.3
                                                                     max =         6
      
                                                      LR chi2(7)         =  11076.02
      Log likelihood  =  -6429.422                    Prob > chi2        =    0.0000
      
      ------------------------------------------------------------------------------
           hequity |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             hhsex |  -.0724301   .0429013    -1.69   0.091    -.1565151    .0116549
               age |   .0282951   .0063177     4.48   0.000     .0159126    .0406776
              age2 |   -.000223   .0000595    -3.75   0.000    -.0003396   -.0001064
              educ |    .205215    .007497    27.37   0.000     .1905212    .2199089
              race |  -.3341243   .0216402   -15.44   0.000    -.3765383   -.2917103
         logincome |   1.099536    .024134    45.56   0.000     1.052234    1.146838
            crisis |  -.0722258   .0342163    -2.11   0.035    -.1392885    -.005163
      ------------------------------------------------------------------------------
      3) RANDOM EFFECT

      Code:
      xtlogit hequity hhsex age age2 educ race logincome crisis, re
      
      Fitting comparison model:
      
      Iteration 0:   log likelihood = -21445.742  
      Iteration 1:   log likelihood =  -14679.74  
      Iteration 2:   log likelihood = -14063.885  
      Iteration 3:   log likelihood = -14050.375  
      Iteration 4:   log likelihood = -14050.356  
      Iteration 5:   log likelihood = -14050.356  
      
      Fitting full model:
      
      tau =  0.0     log likelihood = -14050.356
      tau =  0.1     log likelihood = -14065.041
      
      Iteration 0:   log likelihood = -14065.041  
      Iteration 1:   log likelihood = -14052.984  
      Iteration 2:   log likelihood = -14050.803  
      Iteration 3:   log likelihood = -14050.383  
      Iteration 4:   log likelihood = -14050.358  
      Iteration 5:   log likelihood = -14050.356  
      Iteration 6:   log likelihood = -14050.356  
      Iteration 7:   log likelihood = -14050.356  
      
      Random-effects logistic regression              Number of obs      =     31879
      Group variable: YY1                             Number of groups   =      6551
      
      Random effects u_i ~ Gaussian                   Obs per group: min =         1
                                                                     avg =       4.9
                                                                     max =         6
      
      Integration method: mvaghermite                 Integration points =        12
      
                                                      Wald chi2(7)       =   6920.45
      Log likelihood  = -14050.356                    Prob > chi2        =    0.0000
      
      ------------------------------------------------------------------------------
           hequity |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             hhsex |   -.059407    .035975    -1.65   0.099    -.1299166    .0111027
               age |   .0321019   .0052896     6.07   0.000     .0217345    .0424692
              age2 |   -.000256   .0000498    -5.14   0.000    -.0003536   -.0001585
              educ |   .2042289   .0062746    32.55   0.000      .191931    .2165269
              race |  -.3215373   .0179039   -17.96   0.000    -.3566284   -.2864463
         logincome |   1.137076   .0206597    55.04   0.000     1.096584    1.177568
            crisis |  -.0873179   .0303421    -2.88   0.004    -.1467872   -.0278485
             _cons |  -14.46458   .2479954   -58.33   0.000    -14.95064   -13.97852
      -------------+----------------------------------------------------------------
          /lnsig2u |  -19.23615   107.4103                     -229.7565    191.2843
      -------------+----------------------------------------------------------------
           sigma_u |   .0000665   .0035722                      1.29e-50    3.44e+41
               rho |   1.34e-09   1.44e-07                      5.0e-101           1
      ------------------------------------------------------------------------------
      Likelihood-ratio test of rho=0: chibar2(01) =     0.00 Prob >= chibar2 = 1.000

      Thank you again.
      Luke Brown

      Comment


      • #4
        Well, at first glance it appears that there is almost no variation at the group (YY1) level in your response, as sigma_u and rho are both very close to zero, so that the pooled logistic model would be fine.

        But looking a bit more closely, I see that sigma_u is extremely imprecisely estimated, essentially as being anywhere from 0 to infinity, which means the data are actually quite consistent with a large rho. So, looking more closely at your model I see that you have both age and age squared in the model. The correlation between these is 0.98 in the example data. So once again you have a massive near-colinearity in these variables that is impacting the estimation in a bad way, and the quadratic term is introducing only an infinitesimal amount of information. So I would re-estimate the model using only linear age. If you still get a sigma_u and rho close to zero and they are reasonably precisely estimated, then the pooled logistic model will be fine.

        Comment


        • #5
          Ok, great. I re-estimated without Age2, and I obtained sigma_u= 0.0044019 and rho= 5.89e-06 . So, now I have another question, assuming that I am not taking into account the pooled regression, does the random effect still make sense? In other words, shall I include it to my final research or not because it is not a good estimation since its rho and sigma values?

          Thank you so much again, your explanations are always really helpful.

          Comment


          • #6
            Luke:
            if the likelihood-ratio test that appears as a footnote of -xtlogit- outcome table fails to reach statistical significance, you would be better off with switching to a pooled logistic regression (remember to -cluster- your standard errors on your -panelid-).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Perfect, thank you so much

              Comment


              • #8
                Carlo Lazzaro would you please explain briefly to me why I should cluster my errors on my panel iid? I did not really understand their meaning.
                Thank you so much

                Comment


                • #9
                  Luke:
                  if you go -logit- (or any other one wave of data regression model) with panel data without clustering your standard errrors at -panelid- you're actually telling Stata that your observations are independent, which is not the case if you have panel data.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    Thank you Carlo for your explanation, however I am using an unbalanced panel data set. Do I still need to use them?
                    Thank you again for your great help

                    Comment


                    • #11
                      Yes, because your observations within the same panel are not independent (and for those panels with one observation only -cluster- won't harm).
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment

                      Working...
                      X