confint.ipw_haldensify {haldensify} | R Documentation |
Confidence Intervals for IPW Estimates of the Causal Effects of Stochatic Shift Interventions
Description
Confidence Intervals for IPW Estimates of the Causal Effects of Stochatic Shift Interventions
Usage
## S3 method for class 'ipw_haldensify'
confint(object, parm = seq_len(object$psi), level = 0.95, ...)
Arguments
object |
An object of class |
parm |
A |
level |
A |
... |
Other arguments. Not currently used. |
Details
Compute confidence intervals for estimates produced by
ipw_shift
.
Value
A named numeric
vector containing the parameter estimate from
a ipw_haldensify
object, alongside lower/upper Wald-style confidence
intervals at a specified coverage level.
Examples
# 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"
)
confint(est_ipw_shift)
[Package haldensify version 0.2.3 Index]