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.