TransWikia.com

How to get log odds from these results of logistic regression

Cross Validated Asked on November 2, 2021

I have performed logistic regression (using ‘LOGIT’) on variables from titanic dataset. The formula used is:

survived ~ age + sex + pclass

I have obtained results as follows:

==================== Summary() ====================
                           Logit Regression Results                           
==============================================================================
Dep. Variable:               survived   No. Observations:                  714
Model:                          Logit   Df Residuals:                      710
Method:                           MLE   Df Model:                            3
Date:                Mon, 20 Jul 2020   Pseudo R-squ.:                  0.3289
Time:                        14:29:27   Log-Likelihood:                -323.65
converged:                       True   LL-Null:                       -482.26
Covariance Type:            nonrobust   LLR p-value:                 1.860e-68
===============================================================================
                  coef    std err          z      P>|z|      [0.025      0.975]
-------------------------------------------------------------------------------
Intercept       5.0560      0.502     10.069      0.000       4.072       6.040
sex[T.male]    -2.5221      0.207    -12.168      0.000      -2.928      -2.116
age            -0.3693      0.076     -4.841      0.000      -0.519      -0.220
pclass         -1.2885      0.139     -9.253      0.000      -1.561      -1.016
===============================================================================

==================== Summary2() ====================
                         Results: Logit
=================================================================
Model:              Logit            Pseudo R-squared: 0.329     
Dependent Variable: survived         AIC:              655.2909  
Date:               2020-07-20 14:29 BIC:              673.5745  
No. Observations:   714              Log-Likelihood:   -323.65   
Df Model:           3                LL-Null:          -482.26   
Df Residuals:       710              LLR p-value:      1.8597e-68
Converged:          1.0000           Scale:            1.0000    
No. Iterations:     6.0000                                       
------------------------------------------------------------------
              Coef.   Std.Err.     z      P>|z|    [0.025   0.975]
------------------------------------------------------------------
Intercept     5.0560    0.5021   10.0692  0.0000   4.0719   6.0402
sex[T.male]  -2.5221    0.2073  -12.1676  0.0000  -2.9284  -2.1159
age          -0.3693    0.0763   -4.8415  0.0000  -0.5188  -0.2198
pclass       -1.2885    0.1393   -9.2528  0.0000  -1.5615  -1.0156
=================================================================

Edit: I want to explain results in lay terms. I want to determine how much odds of survival change with changes in each predictor variable. To clarify, I want to know:

  1. What are the odds of a male surviving as compared to a female?

  2. How do odds change for every 1 year increase in age of the person?

I understand it is a very basic question, but it is important to have reliable knowledge about it.

One Answer

The question title is:

How to get log odds from these results of logistic regression

The estimates are already on the log-odds scale. All you have to do is read the relevant entry.

What are the odds of a male surviving as compared to a female?

The log-odds of a male surviving compared to a female is -2.5221, holding the other variables constant. If we exponentiate this we get

> exp(-2.5221)
[1] 0.0803

and this is the odds ratio of survival for males compared to females - that is the odds of survival for males is 92% lower than the odds of survival for females

How do odds change for every 1 year increase in age of the person?

Every 1 year increase in age is associated with a 0.3693 decrease in log-odds of survival holding the other variables constant. If we exponentiate this:

> exp(-0.3693)
[1] 0.691

So every 1 unit increase in age is associated with a decrease in the odds of survival of 31%, holding the other variables constant.

Answered by Robert Long on November 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP