AE 20: Causal Inference from a Randomized Experiment

Nowak-Węgrzyn et al. (2019) conducted a multicenter, randomized, double-blind, placebo-controlled clinical trial to evaluate whether vital wheat gluten (VWG) oral immunotherapy (OIT) is effective at increasing wheat tolerance in children and young adults with wheat allergy. In today’s AE, you will analyze a dataset simulated to represent this study using the tools from lecture.

(https://pubmed.ncbi.nlm.nih.gov/30389226/)

Packages

Data

set.seed(42)
n <- 46
wheat_trial <- tibble(
  id                 = 1:n,
  age                = round(runif(n, 4, 22), 1),
  baseline_wheat_ige = round(rexp(n, rate = 1/30), 1),
  vwg_oit            = c(rep(1, 23), rep(0, 23))
) |>
  mutate(
    max_dose_mg = pmax(0, round(
      150 + 950 * vwg_oit - 3 * baseline_wheat_ige + 12 * age + rnorm(n, sd = 90)
    ))
  )

glimpse(wheat_trial)
Rows: 46
Columns: 5
$ id                 <int> 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, …
$ age                <dbl> 20.5, 20.9, 9.2, 18.9, 15.6, 13.3, 17.3, 6.4, 15.8,…
$ baseline_wheat_ige <dbl> 13.3, 7.1, 30.8, 32.4, 38.6, 17.1, 90.6, 14.9, 10.6…
$ vwg_oit            <dbl> 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, …
$ max_dose_mg        <dbl> 1331, 1391, 1126, 960, 1197, 1175, 1052, 1184, 1384…

Variables:

Variable Description
id Unique participant identifier
age Participant age (years)
baseline_wheat_ige Baseline wheat IgE level (kU/L) — a measure of allergy severity
vwg_oit Treatment indicator: 1 = VWG OIT, 0 = Placebo
max_dose_mg Maximum tolerated wheat protein dose (mg) at the year-1 food challenge

Exercise 1: Study design

With your teammate, fill in the following based on the paper and today’s lecture:

  • Treatment indicator (\(Z\)):

  • Treatment group (\(Z = 1\)):

  • Control group (\(Z = 0\)):

  • Outcome (\(Y\)):

  • Covariates (\(X\)):

Exercise 2: Exploratory data analysis

a. Create a visualization comparing the distribution of max_dose_mg across the two treatment groups. What do you notice?

# add code here

Describe what you see:

b. Compute the mean and standard deviation of max_dose_mg for each treatment group.

# add code here

Exercise 3: Modeling

a. Fit a linear regression model predicting max_dose_mg from vwg_oit.

# add code here

b. Interpret the slope coefficient for vwg_oit in context. Since this is a randomized experiment, use causal language in your interpretation (e.g., “causes,” “leads to”).

Write your answer here.

Exercise 4: Inference

Choose one of the following approaches to assess the evidence for a treatment effect on max_dose_mg. Complete all parts of your chosen option.


Option A: Bootstrap confidence interval

a. Calculate the observed fit using specify() |> fit().

# add code here

b. Generate 1000 bootstrap samples and fit a model to each one.

set.seed(1120)
# add code here

c. Compute the 95% confidence interval using the percentile method.

# add code here

d. Interpret the confidence interval for vwg_oit in context. Use causal language.

Write your answer here.


Option B: Hypothesis test

a. State the null and alternative hypotheses.

\(H_0\):

\(H_A\):

b. Calculate the observed fit and simulate the null distribution using 1000 permutations.

set.seed(24601)
# add code here

c. Visualize the null distribution and shade the p-value region.

# add code here

d. Calculate the p-value.

# add code here

e. State your conclusion in context.

Write your answer here.


Exercise 5: Further covariate adjustment

a. Fit a model that adds baseline_wheat_ige as an additional predictor. How does the vwg_oit estimate compare to the model in Exercise 3?

# add code here

Write your answer here.

b. Why might we include baseline_wheat_ige in our model even if the two groups are already balanced on this variable?

Write your answer here.