Title: | Profiling Compliers and Non-Compliers for Instrumental Variable Analysis |
Version: | 1.1.2 |
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) <doi:10.48550/arXiv.2103.06328>. |
Depends: | R (≥ 3.4.0) |
License: | GPL-3 |
URL: | https://github.com/sumtxt/ivdesc/ |
BugReports: | https://github.com/sumtxt/ivdesc/issues |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.3.2 |
Suggests: | haven |
Imports: | knitr (≥ 1.20.8), purrr (≥ 0.2.5), rsample (≥ 0.0.3) |
NeedsCompilation: | no |
Packaged: | 2025-07-21 19:22:30 UTC; mmarbach |
Author: | Moritz Marbach |
Maintainer: | Moritz Marbach <m.marbach@ucl.ac.uk> |
Repository: | CRAN |
Date/Publication: | 2025-07-22 11:50:02 UTC |
The effects of watching a Fox debate on Proposition 209
Description
The data set (n=507) contains findings from the experiment described in Albertson and Lawrence (2009)
in which a representative sample of survey respondents in Orange County, California, were randomly
assigned to receive encouragement to view a Fox debate on affirmative action, which would take
place on the eve of the 1996 presidential election. Shortly after the election, these respondents were
reinterviewed. The postelection questionnaire asked respondents whether they viewed the debate,
whether they supported a California proposition (209) to eliminate affirmative action (support
),
and how informed they felt about the proposition (infopro
). The dataset can be used to reproduce
Table 2 in Aronow and Carnegie (2013). Note that mean imputation was used to handle missing data so
non-integer values are imputed. support
and infopro
are excepted and include missing values.
Usage
FoxDebate
Format
A data frame with 507 observations on the following 12 variables:
- partyid
An 11 point scale from "strong Republican" to "strong Democrat".
- pnintst
Respondent interest in politics and national affairs. Coded 1 = "very interested", 2 = "somewhat interested", 3 = "only slightly interested", 4 = "not interested at all".
- watchnat
Frequency of national television news consumption. Coded 1 = "never", 2 = "less than once a month", 3 = "once a month", 4 = "several times a month", 5 = "once a week", 6 = "several times a week", 7 = "every day".
- educad
Education level of respondent. Coded 1 = "eighth grade or less", 2 = "beyond eighth grade, not high school", 3 = "ged", 4 = "high school", 5 = "less than one year vocational school", 6 = "one to two year vocational school", 7 = "two years or more vocational school", 8 = "less than two years of college", 9 = "two or more years of college", 10 = "finished a two-year college program", 11 = "finished a four-year college program", 12 = "master degree or equivalent", 13 = "ph.d., m.d., or other advance degree".
- readnews
How often respondent reads political news. Coded 1 = "never", 2 = "less than once a month", 3 = "once a month", 4 = "several times a month", 5 = "once a week", 6 = "several times a week", 7 = "every day".
- gender
Respondent gender. Coded 1 for female and 0 for male.
- income
Family income from all sources. Coded 1 = "under $10,000", 2 = "between $10,000 and $20,000", 3 = "between $20,000 and $30,000", 4 = "between $30,000 and $40,000", 5 = "between $40,000 and $50,000", 6 = "between $50,000 and $60,000", 7 = "between $60,000 and $70,000", 8 = "between $70,000 and $80,000", 9 = "between $80,000 and $90,000", 10 = "between $90,000 and $100,000", 11 = "$100,000 or more".
- white
Binary indicator coded 1 if subject is white and 0 otherwise.
- support
Support for Proposition 209. Coded 1 if subject voted against or opposed and 0 if subject voted for or favored
- infopro
Information on Proposition 209. Coded from 1 to 4, with 4 meaning respondents had a great deal of information about Proposition 209 prior to the election, and 1 meaning respondents reported no information about the proposition before the election.
- watchpro
Binary indicator coded 1 if subject watched the Fox Debate about affirmative action and 0 otherwise. This is the outcome ("treatment") of interest.
- conditn
Binary indicator coded 1 if subject was (randomly) prompted to watch the Fox Debate about affirmative action. This is the encouragement (instrumental) variable.
Details
This dataset data documentation has been copied from the archived R package cicsw.
References
Bethany Albertson and Adria Lawrence. (2009). After the credits roll: The long-term effects of educational television on public knowledge and attitudes. American Politics Research. 37(2): 275-300.
Peter M. Aronow and Allison Carnegie. (2013). Beyond LATE: Estimation of the average treatment effect with an instrumental variable. Political Analysis. 21.4 (2013): 492-506.
Peter M. Aronow and Allison Carnegie. (2013). Replication data for: Beyond LATE: Estimation of the average treatment effect with an instrumental variable. Dataverse Network. http://hdl.handle.net/1902.1/21729 (accessed May 14, 2015).
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
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))