robust_confint {IVDML} | R Documentation |
Compute Robust Confidence Interval for Treatment Effect in an IVDML Object
Description
This function computes a robust (with respect to weak IV) confidence interval/confidence set for the estimated treatment effect in a fitted IVDML
object (output of fit_IVDML()
). The confidence interval/confidence set is constructed by inverting the robust test from the robust_p_value_aggregated()
function, which either uses the Double Machine Learning aggregation method ("DML_agg"
) or the quantile-based method of Meinshausen, Meier, and Bühlmann (2009) ("MMB_agg"
) to aggregate the p-values corresponding to the S_split
cross-fitting sample splits (where S_split
was an argument of the fit_IVDML()
function).
Usage
robust_confint(
object,
iv_method,
level = 0.95,
a = NULL,
A = NULL,
kernel_name = NULL,
bandwidth = NULL,
CI_range = NULL,
agg_method = "DML_agg",
gamma = 0.5
)
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. |
level |
Numeric (default: 0.95). The confidence level for the confidence interval. |
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 |
bandwidth |
Numeric (optional). The bandwidth for the kernel smoothing (if a heterogeneous treatment effect is estimated). |
CI_range |
Numeric vector of length 2 (optional). The search range for the confidence interval. If |
agg_method |
Character (default:
|
gamma |
Numeric (default: 0.5). Quantile level for the |
Value
A list with the following elements:
-
CI
: A named numeric vector with the lower and upper bounds of the confidence interval. -
level
: The confidence level used. -
message
: A message describing the nature of the confidence set (e.g., whether it spans the full range, is non-connected, or is empty due to optimization failure). -
heterogeneous_parameters
: A list of parameters (a
,kernel_name
,bandwidth
) if a heterogeneous treatment effect is considered; otherwise,NULL
.
References
Meinshausen, N., Meier, L., & Bühlmann, P. (2009). P-values for high-dimensional regression. Journal of the American Statistical Association, 104(488), 1671–1681.
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")
robust_confint(fit, iv_method = "mlIV", CI_range = c(-10, 10))
robust_confint(fit, iv_method = "mlIV", a = 0, A = A,
kernel_name = "boxcar", bandwidth = 0.2, CI_range = c(-10, 10))