# Interpret coefficient from binary independent variable (logistic regression)

I have performed a logistic regression in R and I get the following output.

COEFFICIENTS
(Intercept)    -1.934770e+01
V1             -5.187678e-03
V2              3.559278e-01
V3             -1.057302e-03
V4              1.272497e-02
V5             -3.022905e-03


V2 is a binary independent variable where positive is denoted 0 and negative is repesented by 1.

How do I interpret it, or do I actually have to split them into two separate variables in the regression?

Does the coefficient mean that for one unit change, so going from positive to negative, the log-odds of the dependent variable to occur increases by 0.00356?

Bear with me here, I will explain a case where the variable is not binary as I think you will understand better how R behaves with binary variables.

Let me start with a linear regression model $$\hat{y} = \beta_0 + x_1\hat\beta_1 + x_2\hat\beta_2$$ where

• $$x_1$$ is a numerical variable and can take any real valued number
• $$x_2$$ is a categorical variable, for example, a city where a person is living, and can take lets say, 3 values: "New york", "Chicago", "Florida".

Now lets have a look to $$x_1$$. If the value of $$x_1$$ increases one unit while everything else remains the same, the value of $$\hat{y}$$ is increased $$\hat\beta_1$$

Now, when dealing with a categorical variable, R will internally create what are called "Dummy variables". And it will create as many dummy variables as levels in the categorical variable minus 1. In our case, the categorical variable has $$3$$ possible values, so R will create $$3-1=2$$ dummy variables. This way, it will assign a value of the variable the role of the "ground level" and assign the value 0. For example, lets say that New york is our ground level. This means that:

• If $$x_2$$=New york then $$\hat{y}=x_1\hat\beta_1+0\hat\beta_2=x_1\hat\beta_1$$

The other 2 levels will appear in the output table separately in their dummy variables as "x2Chicago" and "x2Florida". This way,

• x2Chicago=1 if $$x_2$$=Chicago and $$0$$ otherwise,
• x2Florida=1 if $$x_2$$=Florida and 0 otherwise.

So you will end up with a table like

1 Intercept 10
2        x1  5
3 x2Chicago  7
4 x2Florida  9


This means that,

• If x2=New York, then $$\hat{y}=10 + 5x_1$$
• If x2=Chicago, then $$\hat{y}=10 + 5x_1 + 7$$
• If x2=Florida, then $$\hat{y}=10 + 5x_1 + 9$$

Now, If you have a binary variable, it has $$2$$ possible values, so R will create only $$1$$ dummy variable. But the meaning of this variable is the same as before. You will have the ground level with value 0 and the second level with value 1.

$$\frac{\pi}{1-\pi} = exp(-19.34 -0.00518V_1 + 0.355V_2+\ldots)$$
If $$V_2$$ is positive then $$\frac{\pi}{1-\pi} = exp(-19.34 -0.00518V_1 + 0.355\times 0+\ldots)$$
If $$V_2$$ is negative then $$\frac{\pi}{1-\pi} = exp(-19.34 -0.00518V_1 + 0.355\times 1+\ldots)$$
• R does not create a dummy variable for me, as I have already created that myself. V2 consists of 0 and 1. Again, does this then mean that the log-odds of the dependent variable to happen decreases when we go from negative which is 0 to positive whis is 1? Oct 16, 2020 at 13:34