Announcement

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

  • Estout: Adding Odds Ratio and Lrtest

    Dear Stata friends,

    I have the problem that I do not get the Odds ratio and lrtest information when using the estout command.


    melogit teayyopp if mysampleee==1, or || country:, intpoints(30)

    Fitting fixed-effects model:

    Iteration 0: log likelihood = -286811.83
    Iteration 1: log likelihood = -267240.07
    Iteration 2: log likelihood = -267210.85
    Iteration 3: log likelihood = -267210.85

    Refining starting values:

    Grid node 0: log likelihood = -260503.05

    Fitting full model:

    Iteration 0: log likelihood = -260503.05 (not concave)
    Iteration 1: log likelihood = -260500.31 (not concave)
    Iteration 2: log likelihood = -260497.57 (not concave)
    Iteration 3: log likelihood = -260495.25 (not concave)
    Iteration 4: log likelihood = -260493.33 (not concave)
    Iteration 5: log likelihood = -260491.76 (not concave)
    Iteration 6: log likelihood = -260490.52
    Iteration 7: log likelihood = -260489.54
    Iteration 8: log likelihood = -260488.66
    Iteration 9: log likelihood = -260488.52
    Iteration 10: log likelihood = -260488.49
    Iteration 11: log likelihood = -260488.49

    Mixed-effects logistic regression Number of obs = 1277158
    Group variable: country Number of groups = 33

    Obs per group:
    min = 8,119
    avg = 38,701.8
    max = 315,334

    Integration method: mvaghermite Integration pts. = 30

    Wald chi2(0) = .
    Log likelihood = -260488.49 Prob > chi2 = .
    ------------------------------------------------------------------------------
    teayyopp | Odds Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    _cons | .0601004 .004484 -37.69 0.000 .0519242 .0695639
    -------------+----------------------------------------------------------------
    country |
    var(_cons)| .1827738 .0451973 .1125704 .296759
    ------------------------------------------------------------------------------
    Note: Estimates are transformed only in the first equation.
    LR test vs. logistic model: chibar2(01) = 13444.71 Prob >= chibar2 = 0.0000

    . estimates store model2

    estout * using model, replace cells((b(fmt(3) label("b_Coeff")) p(par fmt(3) label("p_Val")) _star(label("Star")) se(fmt(3) label("Std_Err")))) starlevels(* 0.10 ** 0.05 *** 0.01) stats(N F chi2 df df_m aic bic lrtest_chi2 lrtest_df lrtest_p)


    Output:
    model2
    b_Coeff
    teayyopp
    _cons -2.812
    /
    var(_cons[country]) 0.183
    N 1.277.158.000
    F
    chi2
    df
    df_m 0.000
    aic 520.980.982
    bic 521.005.102
    lrtest_chi2
    lrtest_df
    lrtest_p
    The output shows the b coefficient and nothing for the lrtest results. However, you can see from above the lrtest is 13444.71 and p-value is 0.0000

    Do you know the reason for that issue?

    Thank you very much!

    Best wishes,
    Michael


  • #2
    Use 'eform' option after 'estout' command to get the results back transformed. For stats option, you are using several names that do not exist in the scalars after 'melogit' such as F. AIC, BIC arre calculated by 'estout' but you need to run 'ereturn' after the model to see what are the available scalars estout can print for you in the stat option.

    Code:
    melogit your_model
    
    est sto your_model_name
    
    eret li // see the available e() scalars for estout can print
    
    estout your_model_name, eform stats(N p chi2 chi2_c ll_c) //some available e() scalars after melogit
    PS: Please learn to use code delimiters for posting Stata outputs here. Read the forum rules FAQ section. The way you posted your output is quite difficult to understand.
    Roman

    Comment


    • #3
      Thank you very much!!!!

      It worked.

      Is it also possible with the estout command to add number of groups (here countries), Prob > Chibar2 test, ICC and IC (AIC, BIC). I did not find it in the eret li list.

      Regarding posting Stata outputs - I will keep this in mind. Sorry for that!

      I highly appreciate your help!

      Best wishes,
      Michael

      Comment


      • #4
        That information is saved in a matrix e(N_g). You need to work around a little to add that in your result using 'estadd' , see below:

        Code:
        est sto your_model_name
        
        mat  r = e(N_g)
        
        estadd loc Group = r[1,1], replace
        
        estout your_model_name, eform stats(N  Group p chi2 chi2_c ll_c )
        Last edited by Roman Mostazir; 23 Oct 2020, 05:59. Reason: Added 'replace' option
        Roman

        Comment


        • #5
          Thank you! It worked

          Best regards,
          Michael

          Comment

          Working...
          X