Announcement

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

  • #16
    Hi Andrew Musau

    Thank you for advising on this. Two quick inquires please:

    1- Is McFadden's Pseudo R2 the same of Pseudo R2 obtained from -logit-?
    2- In your code, I can't understand why you determine 11 and then 10 with scalar [ scalar l1= e(ll), then scalar l0= e(ll)]. If it is an equation, so can I used the same code with my variable, whatever the number of variables in the mode? So, just replace my variables in the code to obtain Pseudo R2 (again is it = McFadden's Pseudo R2​​​​​​​)?

    Thank you!

    Comment


    • #17
      A follow-up question, please. I read the manual of -firthlogit- but I can't find information about how to add an option of " robust cluster (id) " if I want to robust standard errors adjusted for clustering at the firm level. Any suggestions, please?

      Comment


      • #18
        1- Is McFadden's Pseudo R2 the same of Pseudo R2 obtained from -logit-?
        Yes, the Pseudo \(R^{2}\) reported by logit is McFadden's Pseudo \(R^{2}\).

        In your code, I can't understand why you determine 11 and then 10 with scalar [ scalar l1= e(ll), then scalar l0= e(ll)]. If it is an equation, so can I used the same code with my variable, whatever the number of variables in the mode? So, just replace my variables in the code to obtain Pseudo R2 (again is it = McFadden's Pseudo R2)?
        That is just implementation of the formula. I have to store the values of the maximized log-likelihoods as scalars, see help scalar. Look at this example applied to logit

        Code:
        . webuse lbw
        (Hosmer & Lemeshow data)
        
        . logit low age smoke i.race
        
        Iteration 0:   log likelihood =   -117.336  
        Iteration 1:   log likelihood = -109.57893  
        Iteration 2:   log likelihood = -109.43115  
        Iteration 3:   log likelihood =  -109.4311  
        Iteration 4:   log likelihood =  -109.4311  
        
        Logistic regression                             Number of obs     =        189
                                                        LR chi2(4)        =      15.81
                                                        Prob > chi2       =     0.0033
        Log likelihood =  -109.4311                     Pseudo R2         =     0.0674
        
        ------------------------------------------------------------------------------
                 low |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |  -.0348828   .0334024    -1.04   0.296    -.1003502    .0305847
               smoke |    1.10055   .3719453     2.96   0.003     .3715511     1.82955
                     |
                race |
              black  |   1.011413   .4934234     2.05   0.040     .0443209    1.978505
              other  |    1.05673   .4059583     2.60   0.009     .2610665    1.852394
                     |
               _cons |  -1.007554   .8616628    -1.17   0.242    -2.696382    .6812744
        ------------------------------------------------------------------------------
        
        .
        . qui logit low age smoke i.race
        
        . scalar l1= e(ll)
        
        . qui logit low
        
        . scalar l0= e(ll)
        
        . scalar McFadden_R2= 1-(l1/l0)
        
        . di McFadden_R2
        .06736977
        I cannot help further on firthlogit as I have very limited experience with the command.
        Last edited by Andrew Musau; 13 Mar 2018, 13:24.

        Comment


        • #19
          Hi Andrew,

          Many thanks for your in detail explanation. Now everything almost is OK. I'd be so happy if Joseph Coveney indicates how to add an option of " robust cluster (id) " or it's alternate "vce(cluster id)" or any other suggestions if I want to robust standard errors adjusted for clustering at the firm level when running -firthlogit-. When I tried to run - firthlogit - with year fixing effects and (i.year) and if in the model [ - firthlogit - y X i.year if x==1, vce(cluster id) ], Stata gave me this error message:
          option vce(cluster) is not allowed with evaltype d0

          Any thoughts?
          Last edited by Mohamed Elsayed; 13 Mar 2018, 14:50.

          Comment


          • #20
            You cannot add an option of robust cluster id to -firthlogit-. You can search Statalist archives for the reason why.

            Comment


            • #21
              Hi Joseph,

              Many thanks for your feedback in this respect and for sure for creating this magic command.

              Finally, if any participant or Stata expert sees any problem when Stata drops one or two years and their obs when including year fixed effects in -logit- due to the perfect prediction, or whether this would negatively affect model fit? I'd be grateful if you share the knowledge with me.

              Thanks.

              Comment

              Working...
              X