Description Usage Arguments Examples
IPW Estimates of the Causal Effects of Stochatic Shift Interventions
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
W |
A |
A |
A |
Y |
A |
delta |
A |
n_bins |
A |
cv_folds |
A |
lambda_seq |
A |
... |
Additional arguments for model fitting to be passed directly to
|
bin_type |
A |
trim_density |
A |
undersmooth_type |
A |
bootstrap |
A |
n_boot |
A |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # simulate data
n_obs <- 50
W1 <- rbinom(n_obs, 1, 0.6)
W2 <- rbinom(n_obs, 1, 0.2)
A <- rnorm(n_obs, (2 * W1 - W2 - W1 * W2), 2)
Y <- rbinom(n_obs, 1, plogis(3 * A + W1 + W2 - W1 * W2))
# fit the IPW estimator
est_ipw_shift <- ipw_shift(
W = cbind(W1, W2), A = A, Y = Y,
delta = 0.5, n_bins = 3L, cv_folds = 2L,
lambda_seq = exp(seq(-1, -10, length = 100L)),
# arguments passed to hal9001::fit_hal()
max_degree = 1,
# ...continue arguments for IPW
undersmooth_type = "gcv"
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.