Skip to content

Commit

Permalink
Update chapters/21-sensitivity.qmd
Browse files Browse the repository at this point in the history
Co-authored-by: Malcolm Barrett <[email protected]>
  • Loading branch information
LucyMcGowan and malcolmbarrett authored Sep 21, 2024
1 parent 1f52970 commit 3bc8bf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapters/21-sensitivity.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ adjust_coef(

Examining this output, we see that if there were an unmeasured confounder like the one we specified above, our observed effect, 6.58, would be attenuated to 6.19. That is, rather than the effect of extra magic morning hours increasing the average posted wait time at 9am by 6.58 minutes, the true effect would be 6.19 minutes, assuming our specifications about the unmeasured confounder were correct. Take a look at @tbl-alt-sets, this number should look familiar.

In this case, our "guesses" about the relationship between our unmeasured confounder and the exposure and outcome were accurate because it was in fact measured! Inn reality, we often have to use other techniques to come up with these guesses. Sometimes, we have access to different data or previous studies that would allow us to quantify these effects. Sometimes, we have some information about one of the effects, but not the other (i.e., we have a guess for the impact of the historic high temperature on the average posted wait time, but not on whether there are extra magic morning hours). In these cases, one solution is an *array*-based approach where we specify the effect we are sure of and vary the one we are not. Let's see an example of that. We can plot this array to help us see the impact of this potential confounder. Examining @fig-sens-array, we can see, for example, that if there was a one standard deviation difference in historic high temperature such that extra magic morning hours were 9 degrees cooler on average than days without extra magic morning hours, the true causal effect of extra magic morning hours on the average posted wait time at 9am would be 4.28 minutes, rather than the observed 6.58 minutes.
In this case, our "guesses" about the relationship between our unmeasured confounder and the exposure and outcome were accurate because it was, in fact, measured! In reality, we often have to use other techniques to come up with these guesses. Sometimes, we have access to different data or previous studies that would allow us to quantify these effects. Sometimes, we have some information about one of the effects, but not the other (i.e., we have a guess for the impact of the historic high temperature on the average posted wait time, but not on whether there are extra magic morning hours). In these cases, one solution is an *array*-based approach where we specify the effect we are sure of and vary the one we are not. Let's see an example of that. We can plot this array to help us see the impact of this potential confounder. Examining @fig-sens-array, we can see, for example, that if there was a one standard deviation difference in historic high temperature such that extra magic morning hours were 9 degrees cooler on average than days without extra magic morning hours, the true causal effect of extra magic morning hours on the average posted wait time at 9am would be 4.28 minutes, rather than the observed 6.58 minutes.

```{r}
#| label: fig-sens-array
Expand Down

0 comments on commit 3bc8bf0

Please sign in to comment.