standard_confint {IVDML} | R Documentation |
Compute Standard Confidence Interval for the Treatment Effect Estimate in an IVDML Object
Description
This function calculates a standard confidence interval for the estimated (potentially heterogeneous) treatment effect from a fitted IVDML
object (output of fit_IVDML()
). The confidence interval is computed using the normal approximation method using the standard error computed by se()
and the treatment effect estimate from coef()
.
Usage
standard_confint(
object,
iv_method,
a = NULL,
A = NULL,
kernel_name = NULL,
bandwidth = NULL,
level = 0.95
)
Arguments
object |
An object of class |
iv_method |
Character. The instrumental variable estimation method to use. Must be one of the methods specified in the fitted object. |
a |
Numeric (optional). A specific value of |
A |
Numeric vector (optional). The variable with respect to which treatment effect heterogeneity is considered. If |
kernel_name |
Character (optional). The name of the kernel function to use for smoothing (if a heterogeneous treatment effect is estimated). Must be one of "boxcar", "gaussian", "epanechnikov", or "tricube". |
bandwidth |
Numeric (optional). The bandwidth for the kernel smoothing (if a heterogeneous treatment effect is estimated). |
level |
Numeric (default: 0.95). The confidence level for the interval (e.g., 0.95 for a 95% confidence interval). |
Value
description A list containing:
-
CI
: A numeric vector of length 2 with the lower and upper confidence interval bounds. -
level
: The confidence level used. -
heterogeneous_parameters
: A list with values ofa
,kernel_name
, andbandwidth
(if applicable), orNULL
if a homogeneous treatment effect is estimated.
Examples
set.seed(1)
Z <- rnorm(100)
X <- Z + rnorm(100)
H <- rnorm(100)
D <- Z^2 + sin(X) + H + rnorm(100)
A <- X
Y <- tanh(A) * D + cos(X) - H + rnorm(100)
fit <- fit_IVDML(Y = Y, D = D, Z = Z, X = X, ml_method = "gam")
standard_confint(fit, iv_method = "mlIV")
standard_confint(fit, iv_method = "mlIV", a = 0, A = A,
kernel_name = "boxcar", bandwidth = 0.2, level = 0.95)