1
$\begingroup$

I know the question is easy but I didn't manage to find an answer (in case, a link to a similar question would help, thanks).

I have a simple logistic regression model with 2+ categorical predictors.
To keep it simple, let's make an example:

  • predictor 1 = age group = young/normal/old
  • predictor 2 = city = rome/paris/london
  • target variable = the user converted (1) or didn't convert (0)

I have to use dummy variables (with the n-1 rule) so my model is:

target = b0 + b1*age_young + b2*age_old + b3*city_paris + b4*city_london

My reference category for the age group is normal and for the city is rome.

Let's say I get the following results:

  • b0 (intercept) = -2.9429
  • b1 (age_young) = -0.0624
  • b2 (age_old) = -0.1618
  • b3 (city_paris) = 0.4060
  • b4 (city_london) = 1.0060

So e^b0 should be the odds ratio when all the variables are 0, i.e. when the user is from rome and belongs to the age group normal.

Here are the questions:

  1. is e^b3 the odds-ratio when the city is paris (easy interpretation)? Or is it the odds-ratio of paris compared to rome (something like a marginal odd ratio) (I'm not sure about the interpretation in plain english in this case)?

  2. do the users from rome convert more or less compared to users from paris or london? For me it's hard to say, given that b0 "contains information" about user from rome and from the normal age group. It seems that from b0 I cannot extract information about rome only.

-- EDIT 1 --
b3 (city_london) --> b4 (city_london)

-- EDIT 2 --
b0 should be the odd ratio --> e^b0 should be the odds-ratio

$\endgroup$
  • $\begingroup$ I just fixed two errors: 1) b3 (city_london) --> b4 (city_london) 2) b0 should be the odd ratio --> e^b0 should be the odd ratio $\endgroup$ – Bustic01 Sep 19 '18 at 3:58
2
$\begingroup$

The coefficients of a logistic regression cannot be directly interpreted as odds-ratio. One possible way to interpret them is to get back to the definition of a logistic. If the estimated coefficients are $\beta$, the predicted probability for a user with characteristics $X_i$ is $$ \hat p(X_i) = F(X_i) = \frac{1}{1+e^{-X_i \hat \beta}} $$ Now, to get to your questions.

  1. $\beta_3$ is the coefficient reflecting the marginal effect of being in Paris rather than in Rome (as you guessed, the interpretation of $\beta_3$ should be done with respect to the reference category: Rome). From there, you can either compute the marginal effect of being in Paris (rather than Rome), say from someone in the normal age group: $$ \hat p(normal, Paris) -\hat p(normal, Rome) = \frac{1}{1+e^{-\beta_0 - \beta_3}} - \frac{1}{1+e^{-\beta_0}} $$ or you can compute the odds-ratio (see the definition of the odds): $e^{\beta_3}$
  2. Both Paris and London have positive coefficients. Considering only these point estimates, we can say that users in Rome tend to convert less than in Paris and London. With the current version of the model, this is true for users from all age groups. If you want to say something about how the conversion of young users differ by city compared to other old users (say), you would need to introduce interactions ($Rome*young$, $Rome*normal$, $Rome*old$, $Paris*young$, etc) and estimate the coefficients relative to all interactions.
$\endgroup$
  • $\begingroup$ Many thanks for you answer. Based on your comment I edited my post to fix an error about the interpretation of bx: as you pointed out, it's not the odds-ratio, since the odds ratio is e^bx. What it's still not clear to me is: what is the odds-ratio for the city of rome? Or what is the odds-ratio for paris? Or for age-young? I'm not interested in the "relative/marginal" odds-ratio but I want the "absolute" one. It seems that, since b0 contains information for two distinct categorical predictors, it's impossible to get the odds-ratio for one single predictor. Am I wrong? $\endgroup$ – Bustic01 Sep 19 '18 at 4:06
  • $\begingroup$ Odds ratios, by definition, are relative quantities. In the case of categorical covariates, they indicate how much the odds multiply when the covariate goes from a category to another (say Rome to Paris). If you want an absolute quantity, what you are looking for is a predicted probability, which I defined in the first equation of my answer. Another absolute quantity are the odds defined as $e^{X_i \beta}$ (same notations as above). $\endgroup$ – Roland Sep 19 '18 at 9:10
  • $\begingroup$ Sorry but I'm not getting it. :) In this example what is the odds-ratio for the city of rome? $\endgroup$ – Bustic01 Sep 20 '18 at 3:38
  • $\begingroup$ The expected probability of conversion for a middle-aged individual in Rome is $\frac{1}{1+e^{b_0}}$. For a young individual in Rome it is $\frac{1}{1+e^{b_0+b_1}}$. For an old individual in Rome it is $\frac{1}{1+e^{b_0+b_2}}$. "Odds ratios for the city of Rome" is not a correctly defined concept, because odds-ratios are relative to another category, for instance "Paris vs. Rome" (please read the definition of odds and odds ratios in the link in my answer). $\endgroup$ – Roland Sep 20 '18 at 21:18
  • $\begingroup$ Ok, thanks. What it wasn't clear to me is that, even in a binary categorical predictor (e.g. is_female), the odds-ratio is not "absolute" but it's relative to the default category (e.g. male or, more in general, not-female). $\endgroup$ – Bustic01 Sep 21 '18 at 3:06

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.