1
$\begingroup$

Context

Let Y be a logical vector and X1 a factor with 3 levels. Since Y is binary, logistic regression is used.

 Y <- c(0,0,0,0,0,0,1,1,1,0,1,1,0,1,1,0,1,1,0,0)
X1 <- rep(1:4,5)
factor.X1 <- as.factor(X1)
fit.overall <- glm(Y~X1,family = binomial(link="logit"))
fit.levelwise <- glm(Y~factor.X1,family = binomial(link="logit"))    
exp(fit.overall$coefficients)
exp(fit.levelwise$coefficients)

Both these fits are not significant. Assuming the variables were significant, we could interpret the coefficients of the variables in terms of odds-ratio. When using as.factor(X1), it seems that dummy variables are created.

Question

How can one interpret a general coefficient (here X1) versus levelwise coefficients (factor.X12 factor.X13 factor.X14) ?

> exp(fit.overall$coefficients)
(Intercept)          X1 
  0.6680935   1.0842614 
> exp(fit.levelwise$coefficients)
(Intercept)  factor.X12  factor.X13  factor.X14 
  0.6666667   1.0000000   2.2500000   1.0000000 

Attempt to answer

Here is how I would interpret these odd-ratios :

  1. With fit.overall, the odds of Y increase by a factor of 1.08 if X1 is increased of one unit.
  2. With fit.levelwise, the odds of Y are equal whether X1 is 1,2 or 3 and are multiplied by 2.25 if X1 is 3.
$\endgroup$
1
  • $\begingroup$ Your interpretation looks good to me. $\endgroup$ – Noah Mar 9 at 20:28
1
$\begingroup$

There are some nuances in your attempted interpretation that need to be cleaned up, so I'll take a stab.

First of all, Y is a binary variable taking the values 1 or 0. So you can't really talk about the odds of Y - rather, you should talk about the odds of Y being equal to 1 rather than 0. For example, if Y is a variable quantifying exam status and 1 stands for passed the exam and 0 stands for *failed the exam", you can talk about *the odds of passing rather than failing the exam. Many people would shorten this to the odds of passing the exam.

Second of all, the number 1.08 reported for your fit.overall refers to estimated odds. Thus, the correct interpretation of this number would be:

The odds of Y being equal to 1 rather than 0 were estimated to increase by a multiplicative factor of 1.08 for each 1-unit increase in the value of X1 (i.e., an 8% increase).

Note that this interpretation holds whether or not X1 is significant.

Third of all, your interpretation of the estimated odds reported for fit.levelwise is incorrect. When you treat X1 as a factor with 4 levels labelled as 1, 2, 3 and 4, R sets aside the first level as the reference level of X1 against which all other levels of X1 will be compared in terms of the odds of Y being 1 rather than 0.

Thus, the number 1.0 associated with the factor.X12 in your output can be interpreted as follows:

Subjects in our target population for whom X1 = 2 were estimated to have the same odds of Y being equal to 1 rather than 0 as subjects for whom X1 = 1.

If the subjects in the study were students from a local college, Y was their exam status and X1 was their gender (1 = Male, 2 = Female, 3 = Non-Binary, 4 = Other), the above statement would be translated as:

Female students from the local college were estimated to have the same odds of passing the exam as male subjects.

Furthermore, the number 2.25 associated with the factor.X13 in your output can be interpreted as follows:

The odds of Y being equal to 1 rather than 0 were estimated to be 2.25 times higher for subjects in our target population for whom X1 = 3 compared to subjects for whom X1 = 1.

In the context of the current example, this last statement would read:

The odds of passing the exam were estimated to be 2.25 times higher for non-binary students at the local college compared to male students.

$\endgroup$
1
  • $\begingroup$ Your answer is crystal clear, thank you ! $\endgroup$ – Jean de Léry Mar 10 at 10:22

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.