ivdesc {ivdesc} | R Documentation |
Profiling compliers and non-compliers for instrumental variable analysis
Description
Estimates the mean and variance of a covariate for the complier, never-taker and always-taker subpopulation.
Usage
ivdesc(
X,
D,
Z,
variance = FALSE,
boot = TRUE,
bootn = 1000,
balance = TRUE,
...
)
Arguments
X |
vector with numeric covariate |
D |
vector with binary treatment |
Z |
vector with binary instrument |
variance |
Calculate the variance of the covariate for each subgroup? |
boot |
Replace all standard errors with bootstrap standard errors? |
bootn |
number of bootstraps (ignored if |
balance |
Run balance test? |
... |
additional arguments to be passed to |
Details
This function estimates the mean and the associated standard error of X
for the complier, never-taker and always-taker subpopulation within a sample where some, but not all, units are encouraged by instrument Z
to take the treatment D
.
Observations with missing values in either X
, D
, or Z
are droppped (listwise deletion).
One-sided noncompliance is supported. The mean for the always-/never-taker subpopulation will only be computed if there are at least two observed units in these subpopulations.
If boot=FALSE
, standard errors based on asymptotic theory are estimated.
The balance test is a t-test allowing for unequal variances.
Value
Returns a object ivdesc
with estimates for each subgroup (co
: complier, nt
: never-taker, at
: always-taker) and the full sample:
-
mu
andmu_se
: Mean ofX
and standard error -
pi
andpi_se
: Proportion of each subgroup in the sample and standard error -
var
: Variance ofX
(ifvariance=TRUE
)
Can be coerced to a proper data.frame
using as.data.frame
.
References
M. Marbach and D. Hangartner. 2020. Profiling Compliers and Non-compliers for Instrumental Variable Analysis. Political Analysis, 28(3), 435-444.
D. Hangartner, M. Marbach, L. Henckel, M. H. Maathuis, R. R. Kelz, and L. Keele. 2021. Profiling Compliers in Instrumental Variables Designs. Available at arXiv: https://arxiv.org/abs/2103.06328.
See Also
Examples
# Example 1: Albertson/Lawrence (2009)
# see Marbach/Hangartner (2019) for details/discussion
library(icsw)
data(FoxDebate)
with(FoxDebate, ivdesc(X=readnews,D=watchpro,Z=conditn) )
# Example 2: JTPA Data
library(haven)
jtpa <- read_dta("http://fmwww.bc.edu/repec/bocode/j/jtpa.dta")
with(jtpa, ivdesc(age, training, assignmt, bootn=500))
with(jtpa, ivdesc(hispanic, training, assignmt, boot=FALSE))