Announcement

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

  • non-binary categorical logistic regression coefficients

    I am trying to see indivual category logistic regression coefficients for a class I am in- the class uses SPSS and they are easily seen there. I looked around and found the commands estout and esttab. I love Stata and asked if I could use it instead of having to learn a new program. estout former gives the same coefficients as in the main logit output so doesn't add anything and esttab also no individual category coefficients. Help please and thanks in advance.
    Last edited by Rita Ryan; 20 Nov 2023, 14:27.

  • #2
    What exactly are you looking for in the output that Stata doesn't provide? You refer to them as "individual category coefficients." But when you have a categorical variable as a regressor in -logit- you do get regression coefficients for every category of the regressor except the base category (and the omission of the base category is a matter of mathematical necessity, which also must occur in other statistical packages).
    Code:
    . webuse nhanes2
    
    . logit diabetes i.region
    
    Iteration 0:  Log likelihood = -1999.7591  
    Iteration 1:  Log likelihood =  -1996.842  
    Iteration 2:  Log likelihood = -1996.8276  
    Iteration 3:  Log likelihood = -1996.8276  
    
    Logistic regression                                     Number of obs = 10,349
                                                            LR chi2(3)    =   5.86
                                                            Prob > chi2   = 0.1185
    Log likelihood = -1996.8276                             Pseudo R2     = 0.0015
    
    ------------------------------------------------------------------------------
        diabetes | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
          region |
             MW  |  -.0388123   .1381393    -0.28   0.779    -.3095604    .2319358
              S  |   .1977985   .1314819     1.50   0.132    -.0599012    .4554983
              W  |  -.0698666   .1407068    -0.50   0.620    -.3456469    .2059138
                 |
           _cons |  -3.014434   .1034642   -29.14   0.000     -3.21722   -2.811648
    ------------------------------------------------------------------------------
    So what is it you would like to see that isn't there?

    Comment


    • #3
      Like Clyde, I am not sure what Rita wants that she isn't getting. Perhaps she wants the odds ratios rather than, or in addition to, the coefficients? You can get those by adding the or option.

      Code:
      . webuse nhanes2
      
      . logit diabetes i.region, or nolog
      
      Logistic regression                                     Number of obs = 10,349
                                                              LR chi2(3)    =   5.86
                                                              Prob > chi2   = 0.1185
      Log likelihood = -1996.8276                             Pseudo R2     = 0.0015
      
      ------------------------------------------------------------------------------
          diabetes | Odds ratio   Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            region |
               MW  |   .9619312   .1328805    -0.28   0.779     .7337694    1.261039
                S  |   1.218717   .1602392     1.50   0.132     .9418576    1.576959
                W  |   .9325183   .1312117    -0.50   0.620     .7077624    1.228647
                   |
             _cons |   .0490736   .0050774   -29.14   0.000     .0400663    .0601059
      ------------------------------------------------------------------------------
      Note: _cons estimates baseline odds.
      When using esttab, you use the eform option if you want the exponentiated coefficients presented. e.g.

      Code:
      . webuse nhanes2
      
      . logit diabetes i.region
      
      Iteration 0:  Log likelihood = -1999.7591  
      Iteration 1:  Log likelihood =  -1996.842  
      Iteration 2:  Log likelihood = -1996.8276  
      Iteration 3:  Log likelihood = -1996.8276  
      
      Logistic regression                                     Number of obs = 10,349
                                                              LR chi2(3)    =   5.86
                                                              Prob > chi2   = 0.1185
      Log likelihood = -1996.8276                             Pseudo R2     = 0.0015
      
      ------------------------------------------------------------------------------
          diabetes | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
            region |
               MW  |  -.0388123   .1381393    -0.28   0.779    -.3095604    .2319358
                S  |   .1977985   .1314819     1.50   0.132    -.0599012    .4554983
                W  |  -.0698666   .1407068    -0.50   0.620    -.3456469    .2059138
                   |
             _cons |  -3.014434   .1034642   -29.14   0.000     -3.21722   -2.811648
      ------------------------------------------------------------------------------
      
      . esttab, eform
      
      ----------------------------
                            (1)   
                       diabetes   
      ----------------------------
      diabetes                    
      1.region                1   
                            (.)   
      
      2.region            0.962   
                        (-0.28)   
      
      3.region            1.219   
                         (1.50)   
      
      4.region            0.933   
                        (-0.50)   
      ----------------------------
      N                   10349   
      ----------------------------
      Exponentiated coefficients; t statistics in parentheses
      * p<0.05, ** p<0.01, *** p<0.001
      -------------------------------------------
      Richard Williams, Notre Dame Dept of Sociology
      StataNow Version: 19.5 MP (2 processor)

      EMAIL: [email protected]
      WWW: https://www3.nd.edu/~rwilliam

      Comment

      Working...
      X