GEE or mixed model, two different questions
Today let's look at two methods that fit the exact same data and are both correct, yet hand back two different numbers for the very same treatment effect.
Thirty clinics take part in a trial of a new treatment protocol. Fifteen clinics run the new protocol, and fifteen keep the standard care they have always used. Each clinic enrolls ten patients, so the trial covers three hundred patients in total. Eight weeks later, every patient's treatment either succeeded or it did not, recorded as a 1 or a 0.
Here is every one of those three hundred patients, already grouped into each clinic's own share of successes, split by arm.
Build that same trial in R now, and reproduce this picture yourself.
Each blue dot is one clinic's own success rate. The two red diamonds are the overall rate for each arm: 0.34 for standard care, 0.673 for the new protocol, so the new protocol does look better on average.
But look at the blue dots themselves. Among the standard-care clinics alone, one sits at a success rate of 0.0 and another at 0.9. Among the new-protocol clinics, one sits at 0.1 and another reaches 1.0. Clinics in the same arm do not land anywhere near each other, and some clinics from different arms overlap completely.
That spread, sitting right there in the plot above, is why this lesson needs two different methods instead of one.
Two questions about the same effect
When you ask how much the new protocol helps, you are actually asking one of two different questions, and they are not the same question wearing two names.
- Subject-specific: if one particular clinic's own patients switched from standard care to the new protocol, how much would that clinic's own log odds of success move?
- Population-averaged: across the whole population of clinics, some that start low and some that start high, how much higher is the overall success probability under the new protocol than under standard care?
If the two arms differed by a fixed number of percentage points, these two questions would have the same answer. They do not, because a logistic model does not work on probabilities directly. It works on log odds, and the function that turns a log odds back into a probability, plogis(), is curved rather than straight.
Take two toy clinics that have nothing to do with the trial above. Clinic A starts at a baseline success probability of 0.2 under standard care, and clinic B starts at 0.8. Watch what the exact same log-odds bump of 1, the size this lesson's trial was built around, does to each of their probabilities.
qlogis() turns a probability into a log odds, and plogis() turns a log odds back into a probability. Adding the bump in between is exactly what a treatment coefficient in a logistic model does to a clinic's own log odds. The same bump of 1 moves clinic A's probability up by 0.205, but moves clinic B's probability up by only 0.116, even though both clinics received the identical log-odds effect.
A clinic that starts near 0.5 has the most room for a log-odds bump to move its probability. A clinic that already starts near 0 or near 1 has less room, because a probability cannot go below 0 or above 1. Average that bump across a population of clinics sitting at all sorts of starting probabilities, as the thirty clinics in this trial do, and the average probability shift comes out smaller than the shift any single clinic gets in log odds.
That gap between a subject-specific effect and a population-averaged effect is exactly what the next two models go on to measure, on the real clinic trial.