View source: R/estimation-functions.R
causalQual_iv | R Documentation |
Fit two-stage least squares models for qualitative outcomes to estimate the local probabilities of shift.
causalQual_iv(Y, D, Z)
Y |
Qualitative outcome before treatment. Must be labeled as |
D |
Binary treatment indicator. |
Z |
Binary instrument. |
Under an instrumental-variables design, identification requires the instrument to be independent of potential outcomes and potential treatments (exogeneity), that the
instrument influences the outcome solely through its effect on treatment (exclusion restriction), that the instrument has a nonzero effect on treatment probability (relevance), and that the instrument can only
increase/decrease the treatment probability (monotonicity). If these assumptions hold, we can recover the local probabilities of shift for all classes:
\delta_{m, L} := P(Y_i(1) = m | i \, is \, complier) - P(Y_i(0) = m | i \, is \, complier), \, m = 1, \dots, M.
causalQual_iv
applies, for each class m
, the standard two-stage least squares method to the binary variable 1(Y_i = m)
. Specifically, the routine first estimates
the following first-stage regression model via OLS:
D_i = \gamma_0 + \gamma_1 Z_i + \nu_i,
and constructs the predicted values \hat{D}_i
. It then uses these predicted values in the second-stage regressions:
1(Y_i = m) = \alpha_{m0} + \alpha_{m1} \hat{D}_i + \epsilon_{mi}, \quad m = 1, \dots, M.
The OLS estimate \hat{\alpha}_{m1}
of \alpha_{m1}
is then our estimate of \delta_{m, L}
. Standard errors are computed using conventional procedures and used to construct
conventional confidence intervals. All of this is done by calling the ivreg
function.
An object of class causalQual
.
Riccardo Di Francesco
Di Francesco, R., and Mellace, G. (2025). Causal Inference for Qualitative Outcomes. arXiv preprint arXiv:2502.11691. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.48550/arXiv.2502.11691")}.
causalQual_soo
causalQual_rd
causalQual_did
## Generate synthetic data.
set.seed(1986)
data <- generate_qualitative_data_iv(100, outcome_type = "ordered")
Y <- data$Y
D <- data$D
Z <- data$Z
## Estimate local probabilities of shift.
fit <- causalQual_iv(Y, D, Z)
summary(fit)
plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.