Title: | Instrumental Variables Estimation for 2^k Factorial Experiments |
---|---|
Description: | Implements instrumental variable estimators for 2^K factorial experiments with noncompliance. |
Authors: | Matthew Blackwell [aut, cre] , Nicole Pashley [aut] |
Maintainer: | Matthew Blackwell <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.0 |
Built: | 2024-11-04 03:02:58 UTC |
Source: | https://github.com/mattblackwell/factiv |
Calculates averages of covariates by compliance group in a 2^K factorial setting.
compliance_profile(formula, data, subset)
compliance_profile(formula, data, subset)
formula |
one-sided formula to indicate the treatment
assignment, treatment uptake, and covariates. The right-hand
side of the formula should have three components separated by
the |
data |
a data.frame on which to apply the |
subset |
subset of the data to pass to estimation. |
A list with two objects:
raw_table |
a data.frame whose rows represent the covariates and whose columns represent the different compliance groups. Each entry is the estimated mean of the covariate for that compliance group. |
std_table |
a data.frame similarly structured to raw_table but with the standardized difference between the compilance group means and the overall means in place of the raw means. |
Matthew Blackwell
Matthew Blackwell and Nicole Pashley (2021) "Noncompliance in Factorial Experiments." Working paper.
data(newhaven) cov_prof <- compliance_profile(~ inperson + phone | inperson_rand + phone_rand | age + maj_party + turnout_96, data = newhaven) cov_prof
data(newhaven) cov_prof <- compliance_profile(~ inperson + phone | inperson_rand + phone_rand | age + maj_party + turnout_96, data = newhaven) cov_prof
Estimates principal stratum-specific effects and interactions in a 2^K factorial experiment
iv_factorial(formula, data, subset, method = "lm", level = 0.95)
iv_factorial(formula, data, subset, method = "lm", level = 0.95)
formula |
formula specification of the factorial design with
noncompliance. The right-hand side of the formula should have
two components separated by the |
data |
A data.frame on which to apply the |
subset |
subset of the data to pass to estimation. |
method |
character indiciating if the estimator should be
|
level |
the confidence level required. |
This function estimates treatment effects for 2^K factorial experiments in the face of noncompliance on all factors. A monotonicity assumption is assumed for both treatment-instrument pairs, along with treatment exclusion. See Blackwell (2017) for more details on those assumptions.
The procedure uses iterative generalized method of moments (GMM) to estimate both the proportions of each compliance class (also known as principal strata) and the average potential outcomes within those classes. It also provides estimates of several one-way, joint, and interactive treatment effects within these classes.
Under the above assumptions, the compliance classes are the
product of the compliance classes for each treatment-instrument
pair. For instance, "cc"
is the class that would comply
with both treatments, "ca"
is the class that would comply
with the first treatment and always take the second treatment, and
"cn"
is the class that would comply with the first
treatment and never take the second treatment. Finally, note that
treatment effects are only well-defined for compliance classes for
which there is compliance on at least one treatment.
A list of class iv_factorial
that contains the following
components:
rho |
vector of estimated compliance class probabilities. |
psi |
vector of the estimated conditional mean of the outcome within the compliance classes. |
vcov |
estimated asymptotic variance matrix of the combined
|
pcafe_est |
vector of estimated main effects of each factor among perfect compliers. |
pcafe_se |
vector of estimated standard errors for the
estimated effects in |
pcafe_cis |
a matrix of confidence intervals for the PCAFE estimates. |
level |
the confidence level of the returned confience intervals. |
Matt Blackwell
Matthew Blackwell (2017) Instrumental Variable Methods for Conditional Effects and Causal Interaction in Voter Mobilization Experiments, Journal of the American Statistical Association, 112:518, 590-599, doi:10.1080/01621459.2016.1246363
Matthew Blackwell and Nicole Pashley (2020) "Noncompliance in Factorial Experiments." Working paper.
data(newhaven) out <- iv_factorial(turnout_98 ~ inperson + phone | inperson_rand + phone_rand, data = newhaven) summary(out)
data(newhaven) out <- iv_factorial(turnout_98 ~ inperson + phone | inperson_rand + phone_rand, data = newhaven) summary(out)
Estimate main effect IV ratios for 2^K factorial experiments
iv_finite_factorial(formula, data, subset, level = 0.95)
iv_finite_factorial(formula, data, subset, level = 0.95)
formula |
formula specification of the factorial design with
noncompliance. The right-hand side of the formula should have
two components separated by the |
data |
a data.frame on which to apply the |
subset |
subset of the data to pass to estimation. |
level |
the confidence level required. |
This function estimates the ratio of the effect of treatment assignment on the outcome to the effect of treatment assignment on treatment uptake in 2^K factorial experiments. The approach uses finite sample asymptotic inference to generate confidence intervals.
A list of class iv_finite_factorial
that contains the
following components:
tau |
a vector of estimated effect ratios for each factor. |
tau_cis |
a matrix of confidence intervals for each effect ratio. This matrix has 4 columns because it is possible to have disjoint confidence intervals in this method. |
tau_y |
a vector of the estimated effects on the outcome. |
v_tau_y |
the estimated sample variances of the effects on the outcome. |
tau_d |
a vector of the estimated effects on treatment uptake. |
v_tau_y |
the estimated sample variances of the effects on treatment uptake. |
level |
the confidence level of |
Matt Blackwell
Matthew Blackwell and Nicole Pashley (2021) "Noncompliance in Factorial Experiments." Working paper.
data(newhaven) out <- iv_finite_factorial(turnout_98 ~ inperson + phone | inperson_rand + phone_rand, data = newhaven) out joint <- iv_finite_factorial(turnout_98 ~ inperson + phone | inperson_rand + phone_rand, data = newhaven) joint
data(newhaven) out <- iv_finite_factorial(turnout_98 ~ inperson + phone | inperson_rand + phone_rand, data = newhaven) out joint <- iv_finite_factorial(turnout_98 ~ inperson + phone | inperson_rand + phone_rand, data = newhaven) joint
A data set that contains a subset of the voter mobilzation field experiment analyzed in Gerber and Green (2000).
A data frame with 7865 observations and 6 variables:
ward of the residence.
indicator variable for voting in the 1998 general election.
indicator variable for if the respondent received in-person canvassing.
indicator variable for if the respondent received phone canvassing.
indicator variable for if the respondent was randomized to receive in-person canvassing.
indicator variable for if the respondent was randomized to receive phone canvassing.
respondent age.
indicator variable for if the respondent is a registered Democrat or Republican.
indicator variable for whether or not the respondent voted in the 1996 general election.
Data was cleaned and used in Bowers and Hansen (2009). It was a 2x2 factorial design with noncompliance on both factors. This is the subset of the subjects who lived in a single-person household and were not randomized to receive get-out-the-vote mailers. Blackwell (2017) analyzed the full data adjusting for noncompliance.
https://doi.org/10.7910/DVN/Q6CID7
Gerber, Alan S., and Donald P. Green. “The Effects of Canvassing, Telephone Calls, and Direct Mail on Voter Turnout: A Field Experiment.” The American Political Science Review 94, no. 3 (2000): 653. https://doi.org/10.2307/2585837.
Hansen, Ben B., and Jake Bowers. “Attributing Effects to a Cluster-Randomized Get-Out-the-Vote Campaign.” Journal of the American Statistical Association 104, no. 487 (2009): 873–85. https://doi.org/10.1198/jasa.2009.ap06589.
Blackwell, Matthew. “Instrumental Variable Methods for Conditional Effects and Causal Interaction in Voter Mobilization Experiments.” Journal of the American Statistical Association 112, no. 518 (2017): 590–99. https://doi.org/10.1080/01621459.2016.1246363.
Tidy summarizes information about the components of a model.
## S3 method for class 'iv_factorial' tidy(x, conf.int = FALSE, conf.level = 0.95, ...)
## S3 method for class 'iv_factorial' tidy(x, conf.int = FALSE, conf.level = 0.95, ...)
x |
An |
conf.int |
Logical indicating whether or not to include a
confidence interval in the tidied output. Defaults to |
conf.level |
The confidence level to use for the confidence
interval if |
... |
Additional arguments. Not used. Needed to match generic signature only. |
A tibble::tibble()
with columns:
term |
The name of the effect term. |
estimand |
Which complier effect being estimated. |
estimate |
The estimated value of the effect. |
std.error |
The estimated standard error of the effect. |
conf.low |
Lower bound of the confidence interval for the estimate. |
conf.high |
Upper bound of the confidence interval for the estimate. |
Matt Blackwell
Tidy summarizes information about the components of a model.
## S3 method for class 'iv_finite_factorial' tidy(x, conf.level = 0.95, ...)
## S3 method for class 'iv_finite_factorial' tidy(x, conf.level = 0.95, ...)
x |
An |
conf.level |
The confidence level to use for the confidence interval. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval. |
... |
Additional arguments. Not used. Needed to match generic signature only. |
A tibble::tibble()
with columns:
term |
The name of the effect term. |
estimand |
Which complier effect being estimated. |
estimate |
The estimated value of the effect. |
ci_1_lower |
Lower bound for the first interval of the Fieller confidence regresion for the estimate. |
ci_1_upper |
Upper bound for the first interval of the Fieller confidence regresion for tshe estimate. |
ci_2_lower |
Lower bound for the second interval of the
Fieller confidence regresion for the estimate. Only non- |
ci_2_upper |
Upper
bound for the second interval of the Fieller confidence
regresion for the estimate. Only non- |
Matt Blackwell