Malcolm Barrett

2021-09-01

- Fit a propensity model predicting exposure
`x`

,`x + z`

where z is all covariates - Calculate weights
- Fit an outcome model estimating the effect of
`x`

on`y`

weighted by the propensity score

- Use a model like
`lm(x ~ z)`

for the propensity score model. - Use
`wt_ate()`

with`.fitted`

and`.sigma`

; transforms using`dnorm()`

to get on probability-like scale. - Apply the weights to the outcome model as normal!

- Bin the continuous exposure into quantiles and use categorical regression like a multinomial model to calculate probabilities.
- Calculate the weights where the propensity score is the probability you fall into the quantile you actually fell into. Same as the binary ATE!
- Same workflow for the outcome model

`exposure ~ confounders`

`wt_ate()`

`smkintensity82_71`

) affect weight gain among lighter smokers?`exposure ~ confounders`

`wt_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 frame`wt_ate()`

, calculate the weights using `wait_minutes_posted_avg`

, `.fitted`

, and `.sigma`

`05:00`

- Fit an intercept-only model (e.g.
`lm(x ~ 1)`

) or use mean and SD of`x`

- Calculate weights from this model.
- Divide these weights by the propensity score weights.
`wt_ate(.., stabilize = TRUE)`

does this all!

`03:00`

- Use the stabilized weights in the outcome model. Nothing new here!

`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.39 0.0659 3.63 4.93e-4
```

- Extreme weights even after stabilization
- Bootstrap: non-normal distribution
- Bootstrap: estimate different from original model