Construct Searching and Sampling confidence intervals for the causal effect, which provides the robust inference of the treatment effect in the presence of invalid instrumental variables in both low-dimensional and high-dimensional settings. It is robust to the mistakes in separating valid and invalid instruments.
SearchingSampling(
Y,
D,
Z,
X = NULL,
intercept = TRUE,
method = c("OLS", "DeLasso", "Fast.DeLasso"),
robust = TRUE,
Sampling = TRUE,
alpha = 0.05,
CI.init = NULL,
a = 0.6,
rho = NULL,
M = 1000,
prop = 0.1,
filtering = TRUE,
tuning.1st = NULL,
tuning.2nd = NULL
)SearchingSampling returns an object of class "SS", which is a list containing the following components:
1-alpha confidence interval for beta.
The set of selected relevant IVs.
The initial set of selected relevant and valid IVs.
The indicator that the plurality rule is satisfied.
The outcome observation, a vector of length \(n\).
The treatment observation, a vector of length \(n\).
The instrument observation of dimension \(n \times p_z\).
The covariates observation of dimension \(n \times p_x\).
Whether the intercept is included. (default = TRUE)
The method used to estimate the reduced form parameters. "OLS" stands for ordinary least squares, "DeLasso" stands for the debiased Lasso estimator, and "Fast.DeLasso" stands for the debiased Lasso estimator with fast algorithm. (default = "OLS")
If TRUE, the method is robust to heteroskedastic errors. If FALSE, the method assumes homoskedastic errors. (default = TRUE)
If TRUE, use the proposed sampling method; else use the proposed searching method. (default=TRUE)
The significance level (default=0.05)
An initial range for beta. If NULL, it will be generated automatically. (default=NULL)
The grid size for constructing beta grids. (default=0.6)
The shrinkage parameter for the sampling method. (default=NULL)
The resampling size for the sampling method. (default = 1000)
The proportion of non-empty intervals used for the sampling method. (default=0.1)
Filtering the resampled data or not. (default=TRUE)
The tuning parameter used in the 1st stage to select relevant instruments. If NULL, it will be generated data-dependently, see Details. (default=NULL)
The tuning parameter used in the 2nd stage to select valid instruments. If NULL, it will be generated data-dependently, see Details. (default=NULL)
When robust = TRUE, the method will be input as ’OLS’. For rho, M, prop, and filtering, they are required only for Sampling = TRUE.
As for tuning parameter in the 1st stage and 2nd stage, if do not specify, for method "OLS" we adopt \(\sqrt{\log n}\) for both tuning parameters, and for other methods
we adopt \(\max{(\sqrt{2.01 \log p_z}, \sqrt{\log n})}\) for both tuning parameters.
Guo, Z. (2021), Causal Inference with Invalid Instruments: Post-selection Problems and A Solution Using Searching and Sampling, Preprint arXiv:2104.06911.
data("lineardata")
Y <- lineardata[,"Y"]
D <- lineardata[,"D"]
Z <- as.matrix(lineardata[,c("Z.1","Z.2","Z.3","Z.4","Z.5","Z.6","Z.7","Z.8")])
X <- as.matrix(lineardata[,c("age","sex")])
Searching.model <- SearchingSampling(Y,D,Z,X, Sampling = FALSE)
summary(Searching.model)
Sampling.model <- SearchingSampling(Y,D,Z,X)
summary(Sampling.model)
Run the code above in your browser using DataLab