# Choosing “typical” (median) values to calculate probability in logistic regression

Following Hosmer et al. (2013, see below for full reference) I am trying to find estimated probabilities from a logitistic regression controlling for the additional covariates. Hosmer et al. (2013, p. 80-1) proposes to calculate a modified logit "that subtracts the contribution of [the covariates of interest] from the logit and uses its median value as a way to control for the additional covariates". In particular, they propose $$\hat{g}(\textbf{x}) = \beta_{0} + \beta_{1}x_{1}+\beta_{2}x_{2}+\beta_{3}x_{3} + \beta_{4}x_{4} + \beta_{5}x_{5} + \beta_{6}x_{6}, \label{eq:1}$$ and then using $$\hat{gm}(\textbf{x})=\hat{g}(\textbf{x})-(\beta_{1}x_{1}+ \beta_{2}x_{2}),$$ where $x_{1}$ and $x_2$ are the independent variables of interest.

My question is how $\hat{gm}$ is calculated if for instance the coeffients were as follows (these are values from the example in the book):

• $\beta_{0}$ -7.695
• $\beta_{1}$ 0.089
• $\beta_{2}$ 1.365
• $\beta_{3}$ 0.083
• $\beta_{4}$ -0.201
• $\beta_{5}$ 0.583
• $\beta_{6}$ -0.791

Hosmer et al. finds $\hat{gm}=-5.349$, but I cannot understand how this value is obtained. Can anyone help me?

So far I have downloaded the dataset from here and run the regression as described in the book giving me the coefficients mentioned above. I have then calculated the predicted values from the model for each observation in the data set (the median of which is -4.369), say $\textbf{P}$. Then I have calculated the predicted values for $\beta_{1}x_{1}=\textbf{B1}$ and $\beta_{2}x_{2}=\textbf{B2}$ for each observation. Finally, I have calculated $\textbf{P}-(\textbf{B1}+\textbf{B2})=\textbf{A}$, the median of which is -6.707, i.e. not -5.349.

The R script of my efforts so far can be found here.

For completeness it should be noted that it seems that they do not advise to use median values of the covariates, as "these values may not provide a logit that is, in some sense, at the median or middle of the log-odds of [the independent variable] for these covariates".

Hosmer, David W., Stanley Lemeshow, and Rodney X. Sturdivant. Applied Logistic Regression. Third edition. Wiley Series in Probability and Statistics. Hoboken, New Jersey: Wiley, 2013.

• Well what're the median values for those covariates x1...x6? – AdamO Feb 21 '18 at 13:53
• They are x1m=6, x2m=1,x3m=31.95,x4m=2,x5m=2,x6m=2 – avriis Feb 21 '18 at 14:07
• and when you do the algebra what answer do you get? – AdamO Feb 21 '18 at 15:14
• Sorry, not quite sure what you mean? – avriis Feb 21 '18 at 17:53
• @AdamO sorry for bothering you and for my thickness in not understanding your previous comment - can you help me out? – avriis Mar 14 '18 at 13:42