Stanford University
x, x + z where z is all covariatesx on y weighted by the propensity scorelm(x ~ z) for the propensity score model.wt_ate() with .fitted and .sigma; transforms using dnorm() to get on probability-like scale.exposure ~ confounderswt_ate()smkintensity82_71) affect weight gain among lighter smokers?exposure ~ confounderswt_ate()wt_ate()# A tibble: 1,162 × 74
seqn qsmk death yrdth modth dadth sbp dbp sex
<dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <fct>
1 235 0 0 NA NA NA 123 80 0
2 244 0 0 NA NA NA 115 75 1
3 245 0 1 85 2 14 148 78 0
4 252 0 0 NA NA NA 118 77 0
5 257 0 0 NA NA NA 141 83 1
6 262 0 0 NA NA NA 132 69 1
7 266 0 0 NA NA NA 100 53 1
8 419 0 1 84 10 13 163 79 0
9 420 0 1 86 10 17 184 106 0
10 434 0 0 NA NA NA 127 80 1
# ℹ 1,152 more rows
# ℹ 65 more variables: age <dbl>, race <fct>, income <dbl>,
# marital <dbl>, school <dbl>, education <fct>, …
lm() with wait_minutes_posted_avg as the outcome and the confounders identified in the DAG.augment() to add model predictions to the data framewt_ate(), calculate the weights using wait_minutes_posted_avg, .fitted, and .sigma05:00 lm(x ~ 1)) or use mean and SD of xwt_ate(.., stabilize = TRUE) does this all!03:00 03:00 lm(
wait_minutes_actual_avg ~ wait_minutes_posted_avg,
weights = swts,
data = wait_times_swts
) |>
tidy() |>
filter(term == "wait_minutes_posted_avg") |>
mutate(estimate = estimate * 10)# A tibble: 1 × 5
term estimate std.error statistic p.value
<chr> <dbl> <dbl> <dbl> <dbl>
1 wait_minutes_posted_… 2.40 0.0655 3.66 4.48e-4