From 75e4d351969829c7ca7cc582d46b7e9ec55809d6 Mon Sep 17 00:00:00 2001 From: drakileshr <14765034+drakileshr@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:42:08 +0530 Subject: [PATCH] Update 03-counterfactuals.qmd --- chapters/03-counterfactuals.qmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chapters/03-counterfactuals.qmd b/chapters/03-counterfactuals.qmd index c7e9e99..d2f947a 100644 --- a/chapters/03-counterfactuals.qmd +++ b/chapters/03-counterfactuals.qmd @@ -373,7 +373,7 @@ data_observed |> group_by(exposure) |> summarise(avg_outcome = mean(observed_outcome)) ``` -Now our estimated causal effect (because interference exists) is `r data_observed |> group_by(exposure) |> summarise(avg_outcome = mean(observed_outcome)) |> mutate(exposure = c(1, 0)) |> pivot_wider(names_from = exposure, values_from = avg_outcome, names_prefix = "x_") |> summarise(estimate = x_1 - x_0) |> pull() |> round(1)`. This demonstrates what can go wrong when *interference* occurs. One of the main ways to combat interference is change the *unit* under consideration. Here, each individual, each unique *id*, is considered a unit, and there is interference between units (i.e. between partners). If instead we consider each *partner* as a unit and randomize the partners rather than the individuals, we solve the interference issue, as there is not interference *between* different partner sets. This is sometimes referred to as a *cluster randomized trial*. What we decide to do within each cluster may depend on the causal question at hand. For example, if we want to know what would happen if *everyone* at chocolate ice cream versus if *everyone* at vanilla, we would want to randomize both partners to either chocolate or vanilla, as seen below. +Now our estimated causal effect (because interference exists) is `r data_observed |> group_by(exposure) |> summarise(avg_outcome = mean(observed_outcome)) |> mutate(exposure = c(1, 0)) |> pivot_wider(names_from = exposure, values_from = avg_outcome, names_prefix = "x_") |> summarise(estimate = x_1 - x_0) |> pull() |> round(1)`. This demonstrates what can go wrong when *interference* occurs. One of the main ways to combat interference is change the *unit* under consideration. Here, each individual, each unique *id*, is considered a unit, and there is interference between units (i.e. between partners). If instead we consider each *partner* as a unit and randomize the partners rather than the individuals, we solve the interference issue, as there is not interference *between* different partner sets. This is sometimes referred to as a *cluster randomized trial*. What we decide to do within each cluster may depend on the causal question at hand. For example, if we want to know what would happen if *everyone* ate chocolate ice cream versus if *everyone* ate vanilla, we would want to randomize both partners to either chocolate or vanilla, as seen below. ```{r} set.seed(11)