I'm looking at the following question in Judea Pearl's primer on causality In an attempt to estimate the effectiveness of a new drug, a randomized experiment is conducted. In all, 50% of the patients are assigned to receive the new drug and 50% to receive a placebo.
A day before the actual experiment, a nurse hands out lollipops to some patients who show signs of depression, mostly among those who have been assigned to treatment the next day (i.e., the nurse’s round happened to take her through the treatment-bound ward). Strangely, the experimental data revealed a Simpson’s reversal: Although the drug proved beneficial to the population as a whole, drug takers were less likely to recover than nontakers, among both lollipop receivers and lollipop nonreceivers. Assuming that lollipop sucking in itself has no effect whatsoever on recovery, answer the following questions:
Is the drug beneficial to the population as a whole or harmful?
Does your answer contradict our gender example, where sex-specific data was deemed more appropriate?
Draw a graph (informally) that more or less captures the story.
How would you explain the emergence of Simpson’s reversal in this story?
Would your answer change if the lollipops were handed out (by the same criterion) a day after the study?
[Hint: Use the fact that receiving a lollipop indicates a greater likelihood of being assigned to drug treatment, as well as depression, which is a symptom of risk factors that lower the likelihood of recovery.]
A solution to this was posted before here Distribution to match an example with collider bias?
With the following code
set.seed(10)
n <- 1e6
x <- rbinom(n, 1, 0.5)
dep <- rbinom(n, 1, 0.5)
lolli <- rbinom(n, 1, 0.5*x + 0.5*dep)
y <- rbinom(n, 1, 0.1*x + 0.8*dep)
mean(y[x==1]) - mean(y[x==0]) # 0.1
mean(y[x==1 & lolli==1]) - mean(y[x==0 & lolli==1]) # -0.17
mean(y[x==1 & lolli==0]) - mean(y[x==0 & lolli==0]) # -0.17
I've run the code and seen that it gives the desired results. However one thing confuses me is that in the hint it states " drug treatment, as well as depression, which is a symptom of risk factors that lower the likelihood of recovery".
But our target variable $y \sim \mathrm{Ber}(0.1x + 0.8 \times \text{dep})$ which clearly shows that if $x = 1$ and $\text{dep} = 1$ then we have a 90% chance of recovery? In fact here being depressed increases your chance of recovery but shouldn't it be the opposite? Is this a mistake or have I misunderstood something?