Announcement

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

  • Hausman test is failing

    Dear community members,

    With reference to thread https://www.statalist.org/forums/for...-of-i-category within https://www.statalist.org/forums/for...nality-not-met.

    Each student_ID is repeating multiple times.I have done xtset student_ID before running the regressions.

    My dataset: It is a natural data of a college. In which students have taken many tests( within and across the semesters) in the different courses (majoring courses). I want to compare the score of students by their social category.

    The dependent variable is a dummy i.e., Positive_disc01 ( 1= positive score, 0=negative score)
    The core independent variable is, students' particular socio-religious group i.e., Student_Caste_New



    In my research, I am mainly interested to know if students who are in a particular socio-religious group (i.e., stud_SCST), do they have a lower chance of getting a positive score (i.e., Positive_disc01: which is, a certain type of socioeconomic index).


    Hausman test is failing to suggest if I should go for fixed or random effect model.

    However, an expert had suggested Hausman test will run through (https://www.statalist.org/forums/for...11#post1696711)

    Code:
    . xtset collegerollno
    
    Panel variable: collegerollno (unbalanced)
    
    . doedit "D:\PROJECT_IntExt_Internal external project stata files\New_Dofile_Deepak.do"
    
    . xtlogit Positive_disc01 i.Student_Caste_New i.T_jati_new    attendence_percent i.T_nature i.course1 semester
    >    i.T_gender   i.division   ,  fe
    note: multiple positive outcomes within groups encountered.
    note: 8 groups (122 obs) omitted because of all positive or
          all negative outcomes.
    note: 2.Student_Caste_New omitted because of no within-group variance.
    note: 3.Student_Caste_New omitted because of no within-group variance.
    note: 2.course1 omitted because of no within-group variance.
    note: 3.course1 omitted because of no within-group variance.
    note: 4.course1 omitted because of no within-group variance.
    note: 5.course1 omitted because of no within-group variance.
    note: 6.course1 omitted because of no within-group variance.
    note: 7.course1 omitted because of no within-group variance.
    note: 2.division omitted because of no within-group variance.
    note: 3.division omitted because of no within-group variance.
    
    Iteration 0:   log likelihood = -4711.5243  
    Iteration 1:   log likelihood = -4697.4242  
    Iteration 2:   log likelihood = -4697.4069  
    Iteration 3:   log likelihood = -4697.4069  
    
    Conditional fixed-effects logistic regression        Number of obs    =  9,791
    Group variable: collegerollno                        Number of groups =    647
    
                                                         Obs per group:
                                                                      min =      6
                                                                      avg =   15.1
                                                                      max =     16
    
                                                         LR chi2(6)       =  49.84
    Log likelihood = -4697.4069                          Prob > chi2      = 0.0000
    
    ------------------------------------------------------------------------------------
       Positive_disc01 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------------+----------------------------------------------------------------
     Student_Caste_New |
                SC/ST  |          0  (omitted)
                  OBC  |          0  (omitted)
                       |
            T_jati_new |
                    2  |  -.0521505   .0663246    -0.79   0.432    -.1821443    .0778433
                    3  |   .0123199   .0711494     0.17   0.863    -.1271304    .1517703
                       |
    attendence_percent |   .0109843   .0017903     6.14   0.000     .0074753    .0144932
            2.T_nature |   .0078302   .0550874     0.14   0.887     -.100139    .1157995
                       |
               course1 |
                  eco  |          0  (omitted)
                  eng  |          0  (omitted)
                hindi  |          0  (omitted)
              history  |          0  (omitted)
                maths  |          0  (omitted)
                  pol  |          0  (omitted)
                       |
              semester |   .0873339   .0210808     4.14   0.000     .0460162    .1286516
            2.T_gender |   .1974969   .0731768     2.70   0.007      .054073    .3409208
                       |
              division |
                    2  |          0  (omitted)
                    3  |          0  (omitted)
    ------------------------------------------------------------------------------------
    
    . estimates store fixed
    
    . xtlogit Positive_disc01 i.Student_Caste_New i.T_jati_new    attendence_percent i.T_nature i.course1 semester
    >    i.T_gender   i.division   , re
    
    Fitting comparison model:
    
    Iteration 0:   log likelihood = -6795.0358  
    Iteration 1:   log likelihood = -6100.0401  
    Iteration 2:   log likelihood = -6095.8839  
    Iteration 3:   log likelihood = -6095.8825  
    Iteration 4:   log likelihood = -6095.8825  
    
    Fitting full model:
    
    tau =  0.0     log likelihood = -6095.8825
    tau =  0.1     log likelihood = -6081.9125
    tau =  0.2     log likelihood = -6093.8851
    
    Iteration 0:   log likelihood = -6081.9125  
    Iteration 1:   log likelihood = -6081.6228  
    Iteration 2:   log likelihood = -6081.6227  
    
    Random-effects logistic regression                   Number of obs    =  9,913
    Group variable: collegerollno                        Number of groups =    655
    
    Random effects u_i ~ Gaussian                        Obs per group:
                                                                      min =      6
                                                                      avg =   15.1
                                                                      max =     16
    
    Integration method: mvaghermite                      Integration pts. =     12
    
                                                         Wald chi2(16)    = 941.07
    Log likelihood = -6081.6227                          Prob > chi2      = 0.0000
    
    ------------------------------------------------------------------------------------
       Positive_disc01 | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------------+----------------------------------------------------------------
     Student_Caste_New |
                SC/ST  |  -.2598846   .0763338    -3.40   0.001     -.409496   -.1102731
                  OBC  |  -.1290695   .0698694    -1.85   0.065     -.266011    .0078719
                       |
            T_jati_new |
                    2  |  -.0658054   .0658859    -1.00   0.318    -.1949394    .0633286
                    3  |   .0219436   .0698121     0.31   0.753    -.1148857    .1587728
                       |
    attendence_percent |    .011776   .0013962     8.43   0.000     .0090396    .0145125
            2.T_nature |  -.0126113   .0543952    -0.23   0.817     -.119224    .0940014
                       |
               course1 |
                  eco  |   .8948999   .0890632    10.05   0.000     .7203392    1.069461
                  eng  |  -.3307983   .0965467    -3.43   0.001    -.5200264   -.1415703
                hindi  |   1.293322   .0993397    13.02   0.000      1.09862    1.488025
              history  |   .1819405   .1195191     1.52   0.128    -.0523127    .4161936
                maths  |   .7044516   .0912066     7.72   0.000     .5256899    .8832133
                  pol  |   2.043114   .0932743    21.90   0.000     1.860299    2.225928
                       |
              semester |   .0906821   .0196079     4.62   0.000     .0522512    .1291129
            2.T_gender |   .2185489    .072893     3.00   0.003     .0756812    .3614166
                       |
              division |
                    2  |   .0818407   .0719516     1.14   0.255    -.0591819    .2228634
                    3  |   .4876127   .1682825     2.90   0.004     .1577851    .8174403
                       |
                 _cons |  -1.532339   .1544492    -9.92   0.000    -1.835053   -1.229624
    -------------------+----------------------------------------------------------------
              /lnsig2u |  -2.247357    .231178                     -2.700457   -1.794256
    -------------------+----------------------------------------------------------------
               sigma_u |   .3250818   .0375759                       .259181     .407739
                   rho |   .0311226   .0069709                      .0200101    .0481034
    ------------------------------------------------------------------------------------
    LR test of rho=0: chibar2(01) = 28.52                  Prob >= chibar2 = 0.000
    
    . estimates store random
    
    . hausman fixed
    
                     ---- Coefficients ----
                 |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                 |     fixed        random       Difference       Std. err.
    -------------+----------------------------------------------------------------
      T_jati_new |
              2  |   -.0521505    -.0658054        .0136549        .0076156
              3  |    .0123199     .0219436       -.0096236        .0137299
    attendence~t |    .0109843      .011776       -.0007918        .0011207
      2.T_nature |    .0078302    -.0126113        .0204415         .008705
        semester |    .0873339     .0906821       -.0033482        .0077415
      2.T_gender |    .1974969     .2185489        -.021052        .0064381
    ------------------------------------------------------------------------------
                            b = Consistent under H0 and Ha; obtained from xtlogit.
             B = Inconsistent under Ha, efficient under H0; obtained from xtlogit.
    
    Test of H0: Difference in coefficients not systematic
    
    chi2(6) = (b-B)'[(V_b-V_B)^(-1)](b-B)
            = -86.36
    
    Warning: chi2 < 0 ==> model fitted on these data
             fails to meet the asymptotic assumptions
             of the Hausman test; see suest for a
             generalized test.


    How can one know if she needs to apply the fixed or random model for analysis in such circumstance.
    regards,
    ajay
    Last edited by ajay pasi; 12 Jan 2023, 00:00.

  • #2
    When ran the fe and re regressions using continuous dependent variable (which is used for generating dummy dependent variable).

    Hausman test reports

    Code:
    . hausman fixed
    
                     ---- Coefficients ----
                 |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                 |     fixed        random       Difference       Std. err.
    -------------+----------------------------------------------------------------
      T_jati_new |
              2  |    .4264345     .4578411       -.0314066        .0532113
              3  |    1.441701     1.328031        .1136696        .0641926
    attendence~t |   -.0879724    -.0807107       -.0072617        .0068747
      2.T_nature |    1.236799     1.353228       -.1164291        .0470688
        semester |    -.496735    -.4325908       -.0641442        .0474367
      2.T_gender |   -.1598409    -.2626592        .1028183        .0444737
    ------------------------------------------------------------------------------
                              b = Consistent under H0 and Ha; obtained from xtreg.
               B = Inconsistent under Ha, efficient under H0; obtained from xtreg.
    
    Test of H0: Difference in coefficients not systematic
    
        chi2(6) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                =  22.71
    Prob > chi2 = 0.0009

    Comment


    • #3
      Try this and look to suest for a possible solution.
      Code:
      hausman fixed random, sigmamore
      Last edited by George Ford; 12 Jan 2023, 12:25.

      Comment


      • #4
        Thank you George sir.

        Comment

        Working...
        X