robust_p_value_aggregated {IVDML} | R Documentation |
Compute Aggregated Robust p-Value for Treatment Effect in an IVDML Object
Description
This function calculates an aggregated robust (with respect to weak IV) p-value for testing a candidate treatment effect value in a fitted IVDML
object (output of fit_IVDML()
), using either the the standard Double Machine Learning aggregation method ("DML_agg") or the method by 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_p_value_aggregated(
object,
candidate_value,
iv_method,
a = NULL,
A = NULL,
kernel_name = NULL,
bandwidth = NULL,
agg_method = "DML_agg",
gamma = 0.5
)
Arguments
object |
An object of class |
candidate_value |
Numeric. The candidate treatment effect value to test. |
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). |
agg_method |
Character (default: "DML_agg"). The aggregation method for computing the p-value. Options are:
|
gamma |
Numeric (default: 0.5). Quantile level for the |
Value
The aggregated robust p-value for testing the candidate treatment effect.
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, A = A, ml_method = "gam")
robust_p_value_aggregated(fit, candidate_value = 0, iv_method = "mlIV")
robust_p_value_aggregated(fit, candidate_value = 0, iv_method = "mlIV",
a = 0, A = A, kernel_name = "boxcar", bandwidth = 0.2)