3
$\begingroup$

I have performed a binary logistic regression in R using the glm command and family=binomial. The dependent variable (DV) is not re-contracted = 0 or re-contracted = 1. The final model has 8 predictors. My question is regarding the interpretation of the regression coefficients. My understanding is that each regression coefficient indicates the change in the log odds of the DV due to a one unit change in the predictor variable with all other explanatory variables held constant. What does "all other explanatory variables held constant" mean? Are they held at their mean? If so, what does this mean for dichotomous predictors coded as 0 and 1? How are they held constant?

Thank you in advance for your help.

$\endgroup$
1
$\begingroup$

I am going to give a shot at answering your question with one practical example.

From the mtcars dataset in R{datasets}, we can run a logistic regression to model the variable am Transmission (0 = automatic, 1 = manual) - i.e. whether a particular model of car has automatic or manual transmission - using mpg (miles per gallon) and qsec (quarter mile time) as explanatory variables.

In case you are not familiar with the dataset, this is its head:

                   mpg cyl disp  hp drat    wt  qsec vs am gear carg
Mazda RX4         21.0   6  160 110 3.90 2.620 16.46  0  1    4    4
Mazda RX4 Wag     21.0   6  160 110 3.90 2.875 17.02  0  1    4    4
Datsun 710        22.8   4  108  93 3.85 2.320 18.61  1  1    4    1
Hornet 4 Drive    21.4   6  258 110 3.08 3.215 19.44  1  0    3    1

So you would use a call such as:

Call:  glm(formula = as.factor(am) ~ mpg + qsec, family = "binomial", 
    data = mtcars)

Coefficients:
(Intercept)          mpg         qsec  
     30.116        2.213       -4.244  

Degrees of Freedom: 31 Total (i.e. Null);  29 Residual
Null Deviance:      43.23 
Residual Deviance: 7.504    AIC: 13.5

And the coefficient for the explanatory variable mpg would be $\hat\beta_1 =2.212745$ (the exact value), which as you mentioned, corresponds to the expected increase in the predicted independent variable $\log(odds)$ of the car having transmission 1 (manual) for every unit increase in the explanatory variable mpg:

$\large \color{red}{\text{log}} \left[\color{blue}{\text{odds(p(Y=1))}}\right]=\color{red}{\text{log}}\left(\frac{\hat p\,(Y=1)}{1-\hat p\,(Y=1)}\right) = X\hat\beta = \hat\beta_o + \hat\beta_1\, \text{mpg} + \hat\beta_2 \,\text{qsec} $

Let's first see the estimated value for the first entry Mazda RX4 with the values in the dataset:

predict(fit)[1]
          Mazda RX4 
          6.734753 

If now we leave the rest of the dataset as is, but we increase all the values of the mpg variable by $1$: mtcars$mpg <- mtcars$mpg + 1, the mpg for the Mazda RX4 will be 22 instead of the original 21, and the predicted value using the same model,

predict(fit, newdata = mtcars) # This new mtcars has an mpg variable increased by 1.
          Mazda RX4     
          8.9474982 

This can be easily reproduced "manually", by adding the coefficient of the model to the original estimated value:

predict(fit)[1] + fit$coefficients[2] # 6.734753 + 2.212745
        Mazda RX4 
        8.947498

So the concepts sound clear, and I hope this illustrates the meaning with an example. As you can see, we only increase the variable corresponding to the coefficient we were considering, leaving all other variables in the model unchanged.

$\endgroup$
  • $\begingroup$ Thank you very much for your explanation and for providing a practical example. This answer was very helpful. $\endgroup$ – Courtney Mar 8 '16 at 1:28
  • $\begingroup$ Nice explanation, @Antoni Parellada, but I would make one minor correction. The estimated coefficient is the expected increase in the predicted independent variable log(odds) of the car having transmission for every unit increase in the explanatory variable, holding all other variables constant. A bit more care should be taken to place "hats" on coefficients (or not) where appropriate. A lot of beginner confusion surrounds estimated parameters and parameters themselves, so it's imperative that these are kept in order in answers. $\endgroup$ – StatsStudent Mar 8 '16 at 1:57
  • 1
    $\begingroup$ @StatsStudent Good points! Thank you for reading it, and paying attention to detail. Let me know if I caught all the hat-less parts. $\endgroup$ – Antoni Parellada Mar 8 '16 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.