Announcement

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

  • RE: Calculating standardized coefficients in logit models

    Hello!

    I am trying to calculate standardized coefficients in logit models. Pampel suggested several steps. 1. Save the predicted probabilities from logistic regression or save the predicted logits. 2. Obtain R squared. 3. Transform the predicted probabilities into predicted logits. 4. Find the variance of the predicted logits. 5. Compute the standard deviation of Y as the square root of the variance of the predicted logits divided by R squared. 6. Compute standardized coefficients.

    I just wonder using STATA how I can save the predicted logits from logistic regression and transform the predicted probabilities into predicted logits. I would greatly appreciate for any help. Thank you.

    Pampel, F. C. (2000). Logistic regression: A primer. Thousand Oaks, CA: Sage
    Last edited by DY Kim; 09 Aug 2020, 13:27.

  • #2
    After -logit-, the -predict- command with the -xb- option will save the logits in the variable you specify in that command. It seems you have no real need of the predicted probabilities here--they are just an intermediate step to calculating the logits themselves, but Stata gives you the logits directly.

    For more information, see -help logit postestimation- and click on the link for -predict-.

    Comment


    • #3
      Hi,

      Using Stata16, I want to present a table results for standardized coefficients for two models (logit and probit).
      The standardized coefficient I'm interested are Y-standardized and fully standardized coefficient.
      After performing either logit or probit regression, I use:
      Code:
      listcoef, st help
      To obtain the standardized coefficients.

      The command I'm using to present table results is esttab (and estadd). Cheking many posts related to my doubt made me realize the use of matrix command to keep regression results. I do not clearly understand some codes but I coded in some way it has worked.
      For example, codes to obtain a table for y-standardized results in logit were:

      Code:
      logit sick tp t2m ro
      listcoef, st
      matrix list r(table)
      matrix table = r(table)        
      matrix bStdY = table[1..3,5]'
      estadd matrix bStdY = bStdY
      esttab, main(bStdY)    
      
      ----------------------------
                            (1)  
                           sick
      sick                  
      tp               0.000195***
                         (4.10)  
      
      t2m              0.000540  
                         (1.14)  
      
      ro               0.000125  
                         (1.61)  
      
      _cons                    ***
                      (-125.69)  
      ----------------------------
      N                  310623  
      ----------------------------
      bStdY coefficients; t statistics in parentheses
      * p<0.05, ** p<0.01, *** p<0.001
      And the situation is similar for fully-standardized coefficient in logit:

      Code:
      logit sick tp t2m ro
      listcoef, st
      matrix list r(table)
      matrix table = r(table)        
      matrix bStdXY = table[1..3,6]'
      estadd matrix bStdXY = bStdXY
      esttab, main(bStdXY)
      
      ----------------------------
                            (1)  
                           sick  
      ----------------------------
      sick                  
      tp                 0.0187***
                         (4.10)  
      
      t2m               0.00350  
                         (1.14)  
      
      ro                0.00707  
                         (1.61)  
      
      _cons                    ***
                      (-125.69)  
      ----------------------------
      N                  310623  
      ----------------------------
      bStdXY coefficients; t statistics in parentheses
      * p<0.05, ** p<0.01, *** p<0.001

      First problem is that the table result present a row for coefficient when there is no standardized value for this. So I would like to drop it from the table.

      The second problem is when I tried to assemble y-standardized and fully-standardized coefficient in a single table result. This were the codes used:
      Code:
      logit sick tp t2m ro
      listcoef, st
      matrix list r(table)
      matrix table = r(table)    
      
      matrix bStdY = table[1..3,5]'
      estadd matrix bStdY = bStdY
      
      matrix bStdXY = table[1..3,6]'
      estadd matrix bStdXY = bStdXY  
       
      esttab, mean(bStdY bStdXY)
      The codes above did not work.

      What could a solution for this?
      Those previous examples were made for logit model but I want to do also for probit model and to show one single table for both model containing y and fully standardized coefficients.

      Comment

      Working...
      X