| Type: | Package |
| Title: | Estimate Bounds via Principal Stratification |
| Version: | 1.0.2 |
| 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>. |
| License: | MIT + file LICENSE |
| Encoding: | UTF-8 |
| Imports: | dplyr, foreach, methods, purrr, stats, tidyr, tidyselect |
| Config/roxygen2/version: | 8.1.0 |
| NeedsCompilation: | no |
| Packaged: | 2026-10-23 23:52:02 UTC; ilundberg |
| Author: | Ian Lundberg [aut, cre], Soonhong Cho [aut] |
| Maintainer: | Ian Lundberg <ianlundberg@ucla.edu> |
| Depends: | R (≥ 4.1.0) |
| Repository: | CRAN |
| Date/Publication: | 2026-11-07 17:20:02 UTC |
pstratreg: 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.
Author(s)
Maintainer: Ian Lundberg ianlundberg@ucla.edu
Authors:
Ian Lundberg ianlundberg@ucla.edu
Soonhong Cho
Description
Print results from principal stratification regression.
Usage
## S3 method for class 'pstratreg'
print(x, ...)
Arguments
x |
An object of class |
... |
Other arguments to |
Value
No return value, called for side effects.
Estimate Principal Stratification Regression Bounds
Description
Uses principal stratification and parametric models to bound the average causal effect among those who would have a valid outcome under either treatment condition
Usage
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
)
Arguments
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 |
Value
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. |
Examples
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
)
Standard errors for pstratreg
Description
Calculate standard errors by a nonparametric bootstrap, and 95
Usage
pstratreg_se(x, r = 100)
Arguments
x |
An object of class |
r |
Number of bootstrap replicates |
Value
Data frame with estimates, standard errors, and confidence intervals for many quantities of interest.
Examples
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
Description
Simulate data to illustrate principal stratification regression bounding.
Usage
pstratreg_sim(n = 100)
Arguments
n |
Integer number of cases |
Value
Simulated data frame
Examples
pstratreg_sim(n = 100)
Summary
Description
Summarize results from principal stratification regression.
Usage
## S3 method for class 'pstratreg'
summary(object, ...)
Arguments
object |
An object of class |
... |
Other arguments to |
Value
No return value, called for side effects.