Title: | Profiling Compliers and Non-Compliers for Instrumental Variable Analysis |
---|---|
Description: | Estimating the mean and variance of a covariate for the complier, never-taker and always-taker subpopulation in the context of instrumental variable estimation. This package implements the method described in Marbach and Hangartner (2020) <doi:10.1017/pan.2019.48> and Hangartner, Marbach, Henckel, Maathuis, Kelz and Keele (2021) <arXiv:2103.06328>. |
Authors: | Moritz Marbach <[email protected]> [aut, cre] |
Maintainer: | Moritz Marbach <[email protected]> |
License: | GPL-3 |
Version: | 1.1.1 |
Built: | 2025-01-09 23:22:37 UTC |
Source: | https://github.com/cranhaven/cranhaven.r-universe.dev |
Estimates the mean and variance of a covariate for the complier, never-taker and always-taker subpopulation.
ivdesc( X, D, Z, variance = FALSE, boot = TRUE, bootn = 1000, balance = TRUE, ... )
ivdesc( X, D, Z, variance = FALSE, boot = TRUE, bootn = 1000, balance = TRUE, ... )
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 |
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.
Returns a object ivdesc
with estimates for each subgroup (co
: complier, nt
: never-taker, at
: always-taker) and the full sample:
mu
and mu_se
: Mean of X
and standard error
pi
and pi_se
: Proportion of each subgroup in the sample and standard error
var
: Variance of X
(if variance=TRUE
)
Can be coerced to a proper data.frame
using as.data.frame
.
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.
# 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))
# 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))