Conversation
|
ready for review! Obviously make any and all suggestions/revisions you see fit. I know we've debated over the years about how interactions should/should not be embedded in DAGs, so I tried to take the most neutral possible stance and cover what I think are the most common approaches. |
|
One big thing here is that I want to cover marginaleffects for interaction |
Love this part of the chapter. Very nice display of the options |
|
Another couple of things I'd like to see in this chapter:
|
malcolmbarrett
left a comment
There was a problem hiding this comment.
thanks for getting this in! lots of good, nuanced content here.
I've requested some additional changes in addition to my comments in the thread
chapters/14-interaction.qmd
Outdated
| In effect modification, we're interested in how the effect of E changes depending on Q. | ||
| In this setting, we condition on Q to look at what happens within levels of Q, but we don't necessarily intervene on Q itself. | ||
| Effect modification is asymmetric: it focuses on the effect of E, not on the effect of Q. | ||
| Importantly, Q must be a pre-treatment variable which cannot be affected by E [@hernan2021]. |
There was a problem hiding this comment.
We should clarify here that this difference in effects IS due to the causal structure (we think) --- we just don't think it's due to the effect modifier. Like, SOMETHING is interacting in the causal sense to create this difference, but we are not, as you say, intervening on Q because we don't think that's it.
Relatedly, does it make sense to think about this approach when Q IS a joint cause BUT not practical to intervene on?
There was a problem hiding this comment.
Later on this is covered in depth, but we should still give a little taste here
There was a problem hiding this comment.
@malcolmbarrett I added a sentence addressing this above if you want to take a look
chapters/14-interaction.qmd
Outdated
| ### Formal definitions | ||
|
|
||
| Let's make these concepts more precise using counterfactual notation. | ||
| Let $D_e$ denote the counterfactual outcome D under an intervention to set exposure E to level e. |
There was a problem hiding this comment.
we have a lot of inconsistency with what is being LaTexified here. I'm not sure what my opinion is about that, but I wanted to bring it up as a point of discussion
There was a problem hiding this comment.
Agreed. Maybe this needs a full pass throughout the book, though
| $$E[D_{e_1 q_1}] - E[D_{e_1 q_0}] \neq E[D_{e_0 q_1}] - E[D_{e_0 q_0}]$$ | ||
|
|
||
| The two formulations are mathematically equivalent and show that E and Q have equal status in the definition of interaction [@hernan2021]. | ||
| Like effect modification, interaction can be defined with respect to distributions or specific measures, and the presence of interaction may depend on the scale chosen (additive vs. multiplicative) [@VanderWeele2012; @VanderWeele2014]. |
There was a problem hiding this comment.
I think I'd like to see a callout box giving the intuition as to why we see interaction or not differently on different scales
| For women (sex = 0), the effect of medication is `r round(coef(mod_em)[2], 2)` mmHg. | ||
| For men (sex = 1), the effect is `r round(coef(mod_em)[2] + coef(mod_em)[4], 2)` mmHg (`r round(coef(mod_em)[2], 2)` + `r round(coef(mod_em)[4], 2)`). | ||
|
|
||
| If we assume that medication is not affected by sex (which is true since sex precedes medication in time) and that the effect of medication on blood pressure is unconfounded given sex, then this interaction term measures effect modification; i.e., the effect of medication varies across levels of sex. |
There was a problem hiding this comment.
Given the statement about sex preceding medication in time, should this say "If we assume that sex is not affected by medication"?
| filter(str_detect(term, "exercise|diet")) | ||
| ``` | ||
|
|
||
| The interaction term `exercise:diet` is `r round(coef(mod_interaction)[4], 2)`, suggesting that the joint effect of exercise and diet together is greater than the sum of their individual effects. |
There was a problem hiding this comment.
I think you've got the wrong coef here because this is rounding to 5 but the table says 2.79
| The interaction term `exercise:diet` is `r round(coef(mod_interaction)[4], 2)`, suggesting that the joint effect of exercise and diet together is greater than the sum of their individual effects. | ||
| If we've correctly controlled for confounding of both exercise and diet, this coefficient measures interaction. | ||
|
|
||
| ### Marginal structural models |
There was a problem hiding this comment.
In this section, can you try to use propensity for the weights where possible? Where it is not possible please let me know so I can implement it
|
|
||
| ### Marginal structural models | ||
|
|
||
| **Marginal structural models (MSMs)** provide a framework for distinguishing between effect modification and interaction in the analysis [@VanderWeele2009]. |
There was a problem hiding this comment.
I feel like we need a callout box for the term marginal structural models which is used to refer to many techniques, presumably because it is a generalization of them (but I haven't thought it through or looked into usage all that much)
|
|
||
| For interaction, we need weights for both E and Q: | ||
| $$w^E = \frac{P(E = e | Q = q)}{P(E = e | Q = q, X = x)}$$ | ||
| $$w^Q = \frac{P(Q = q)}{P(Q = q | X = x)}$$ |
There was a problem hiding this comment.
I think we need some intuition here, given the symmetric nature of interaction you lay out, about why we have
and not
|
Having slept on this, here are a few more things I wanted to include in this chapter:
Reviewing my notes on this chapter, I also found https://www.the100.ci/2024/06/26/sometimes-a-causal-effect-is-just-a-causal-effect-regardless-of-how-its-mediated-or-moderated/ which you might find as an interesting perspective |
LucyMcGowan
left a comment
There was a problem hiding this comment.
Ok I started this review but I have general questions about terminology -- I don't think effect modification is necessarily in the absence of confounders? I think of effect modification just meaning is the effect modified by a particular variable (i.e. do we observe a different effect in different strata, these could be after conditioning on confounders) and interaction (as it seems like it is defined in the beginning of this chapter) to mean is it causal i.e. is Q actually the cause of the difference we see (vs. some other variable that is just correlated with Q) -- but then in the simulation it seems like we've moved away from those definitions (@tgerke do you mind weighing in?)
|
|
||
| **Effect modification** occurs when the effect of one exposure (E) on an outcome (D) varies across strata of a third variable (Q). | ||
| In effect modification, we're interested in how the effect of E changes depending on Q. | ||
| In this setting, we condition on Q to look at what happens within levels of Q, but we don't necessarily intervene on Q itself. |
There was a problem hiding this comment.
| In this setting, we condition on Q to look at what happens within levels of Q, but we don't necessarily intervene on Q itself. | |
| In this setting, we condition on Q to look at what happens within levels of Q, but we don't necessarily intervene on Q itself. We are not necessarily claiming that Q is the cause of the observed heterogeneity. While the difference in effects across levels of Q is likely causal in origin (something in the underlying causal structure produces this variation), Q may just be a correlate or marker of that causal factor rather than the factor itself. |
LucyMcGowan
left a comment
There was a problem hiding this comment.
Ok I started this review but I have general questions about terminology -- I don't think effect modification is necessarily in the absence of confounders? I think of effect modification just meaning is the effect modified by a particular variable (i.e. do we observe a different effect in different strata, these could be after conditioning on confounders) and interaction (as it seems like it is defined in the beginning of this chapter) to mean is it causal i.e. is Q actually the cause of the difference we see (vs. some other variable that is just correlated with Q) -- but then in the simulation it seems like we've moved away from those definitions (@tgerke do you mind weighing in?)
|
(I made a bunch of switchings of E->X, D->Y and am just committing those but I'll leave the rest as suggestions for you to look through |
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
Co-authored-by: Lucy D'Agostino McGowan <LucyMcGowan@users.noreply.github.com>
This is a good catch -- the chapter could be more clear here. Effect modification is definitely not limited to settings without confounders, and we can and should adjust for confounders of E->D effect when assessing effect modification. But what matters is the role of Q: in effect modification, Q is a conditioning variable, not an intervention target (which would be interaction). These definitions are very much motivated by VanderWeele 2009 which was drilled into my head during training, but we don't have to stick with those if there's a better way to frame how we like to call things. |
draft of interaction and effect modification chapter