| Title: | Estimate Bounds via Principal Stratification |
|---|---|
| Description: | When studying the causal effect of a treatment on an outcome, post-treatment events may render the outcome undefined. For example, the effect of job training on hourly wage is ill-defined for those who would not be employed without job training. This package estimates average causal effects among those whose outcome would be defined regardless of the intervention, producing a set-identified result. For more details, see Lundberg and Cho (2025) <doi:10.48550/arXiv.2508.14770>. |
| Authors: | Ian Lundberg [aut, cre], Soonhong Cho [aut] |
| Maintainer: | Ian Lundberg <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.2 |
| Built: | 2026-11-07 22:35:20 UTC |
| Source: | https://github.com/cran/pstratreg |
Print results from principal stratification regression.
## S3 method for class 'pstratreg' print(x, ...)## S3 method for class 'pstratreg' print(x, ...)
x |
An object of class |
... |
Other arguments to |
No return value, called for side effects.
Uses principal stratification and parametric models to bound the average causal effect among those who would have a valid outcome under either treatment condition
pstratreg( formula_y, formula_s, formula_sq_resid = NULL, family_y = "gaussian", homoskedastic = TRUE, data, weights = NULL, treatment_name, monotonicity_positive = FALSE, monotonicity_negative = FALSE, mean_dominance_y1_positive = FALSE, mean_dominance_y1_negative = FALSE, mean_dominance_y0_positive = FALSE, mean_dominance_y0_negative = FALSE, aggregate = TRUE, group_vars = NULL )pstratreg( formula_y, formula_s, formula_sq_resid = NULL, family_y = "gaussian", homoskedastic = TRUE, data, weights = NULL, treatment_name, monotonicity_positive = FALSE, monotonicity_negative = FALSE, mean_dominance_y1_positive = FALSE, mean_dominance_y1_negative = FALSE, mean_dominance_y0_positive = FALSE, mean_dominance_y0_negative = FALSE, aggregate = TRUE, group_vars = NULL )
formula_y |
A model formula for the outcome |
formula_s |
A model formula for the binary indicator for whether the outcome exists |
formula_sq_resid |
A model formula for the log mean of squared residuals for a variance function regression. Should only use variables that are used in |
family_y |
Character family of the outcome, either |
homoskedastic |
A logical for whether homoskedasticity of the outcome should be assumed. If |
data |
A data frame |
weights |
A numeric vector of weights, of length |
treatment_name |
A character string for the name of the treatment variable in |
monotonicity_positive |
A logical. Whether to assume M1 >= M0, so that treatment never causes the outcome to be undefined |
monotonicity_negative |
A logical. Whether to assume M1 <= M0, so that lack of treatment never causes the outcome to be undefined |
mean_dominance_y1_positive |
A logical. Whether to assume E(Y1 | S1 = 1, S0 = 1) >= E(Y1 | S1 = 1, S0 = 0), so that the always-survivor treated units have mean outcomes at least as great as the observed-survivor treated units |
mean_dominance_y1_negative |
A logical. Whether to assume E(Y1 | S1 = 1, S0 = 1) <= E(Y1 | S1 = 1, S0 = 0), so that the always-survivor treated units have mean outcomes no greater the observed-survivor treated units |
mean_dominance_y0_positive |
A logical. Whether to assume E(Y0 | S1 = 1, S0 = 1) >= E(Y0 | S1 = 0, S0 = 1), so that the always-survivor untreated units have mean outcomes at least as great as the observed-survivor untreated units |
mean_dominance_y0_negative |
A logical. Whether to assume E(Y0 | S1 = 1, S0 = 1) <= E(Y0 | S1 = 0, S0 = 1), so that the always-survivor untreated units have mean outcomes no greater the observed-survivor untreated units |
aggregate |
A logical. Whether to aggregate results or return one estimate per row of |
group_vars |
Character vector of names of variables in |
An object of class pstratreg, which is a list containing:
estimates_y |
A data frame or tibble containing point bounds for the outcome values among those whose outcome exists regardless. |
estimates_s |
A data frame or tibble containing point estimates for outcome existence. |
fit_s |
The |
fit_y |
The |
fit_sq_resid |
The |
call |
A list of arguments passed to the function. |
sim <- pstratreg_sim(n = 100) result <- pstratreg( formula_y = formula(y ~ x + a), formula_s = formula(s ~ x + a), data = sim, treatment_name = "a" ) result <- pstratreg( formula_y = formula(y ~ x + a), formula_s = formula(s ~ x + a), data = sim, treatment_name = "a", aggregate = TRUE, homoskedastic = FALSE, monotonicity_negative = TRUE )sim <- pstratreg_sim(n = 100) result <- pstratreg( formula_y = formula(y ~ x + a), formula_s = formula(s ~ x + a), data = sim, treatment_name = "a" ) result <- pstratreg( formula_y = formula(y ~ x + a), formula_s = formula(s ~ x + a), data = sim, treatment_name = "a", aggregate = TRUE, homoskedastic = FALSE, monotonicity_negative = TRUE )
Calculate standard errors by a nonparametric bootstrap, and 95
pstratreg_se(x, r = 100)pstratreg_se(x, r = 100)
x |
An object of class |
r |
Number of bootstrap replicates |
Data frame with estimates, standard errors, and confidence intervals for many quantities of interest.
sim <- pstratreg_sim(n = 100) result <- pstratreg( formula_y = formula(y ~ x + a), formula_s = formula(s ~ x + a), data = sim, treatment_name = "a" ) se <- pstratreg_se(result, r = 10)sim <- pstratreg_sim(n = 100) result <- pstratreg( formula_y = formula(y ~ x + a), formula_s = formula(s ~ x + a), data = sim, treatment_name = "a" ) se <- pstratreg_se(result, r = 10)
Simulate data to illustrate principal stratification regression bounding.
pstratreg_sim(n = 100)pstratreg_sim(n = 100)
n |
Integer number of cases |
Simulated data frame
pstratreg_sim(n = 100)pstratreg_sim(n = 100)
Summarize results from principal stratification regression.
## S3 method for class 'pstratreg' summary(object, ...)## S3 method for class 'pstratreg' summary(object, ...)
object |
An object of class |
... |
Other arguments to |
No return value, called for side effects.