#  Software 

 



[hIRT: Hierarchical Item Response Theory Models](/software/hirt "hIRT: Hierarchical Item Response Theory Models")

An R package implementing hierarchical item response theory (IRT) models where both the mean and the variance of latent preferences (ability parameters) may depend on observed covariates ([*Zhou 2018*](/publications/hierarchical-item-response-models-analyzing-public-opinion)). The current implementation includes both the two-parameter latent trait model for binary data and the graded response model for ordinal... [*Read more*](/software/hirt "hIRT: Hierarchical Item Response Theory Models")

[localIV: Estimation of Marginal Treatment Effects using Local Instrumental Variables](/software/localiv-estimation-marginal-treatment-effects-using-local-instrumental-variables "localIV: Estimation of Marginal Treatment Effects using Local Instrumental Variables")

In the generalized Roy model, the marginal treatment effect (MTE) can be used as a building block for constructing conventional causal parameters such as the average treatment effect (ATE) and the average treatment effect on the treated (ATT) ([*Heckman, Urzua, and Vytlacil 2006*](https://www.mitpressjournals.org/doi/10.1162/rest.88.3.389)). Given a treatment selection model and an outcome model, the function mte() estimates the MTE via local instrumental variables (or via a normal... [*Read more*](/software/localiv-estimation-marginal-treatment-effects-using-local-instrumental-variables "localIV: Estimation of Marginal Treatment Effects using Local Instrumental Variables")

[paths: An Imputation Approach to Estimating Path-Specific Causal Effects](/software/paths-imputation-approach-estimating-path-specific-causal-effects "paths: An Imputation Approach to Estimating Path-Specific Causal Effects")

In causal mediation analysis with multiple causally ordered mediators, a set of path-specific effects are identified under standard ignorability assumptions. This package implements an imputation approach to estimating these effects along with a set of bias formulas for conducting sensitivity analysis (Zhou and Yamamoto &lt;[*doi:10.31235/osf.io/2rx6p*](https://doi.org/10.31235%2Fosf.io%2F2rx6p)&gt;). It contains two main functions: paths() for estimating path-specific effects and sens() for conducting sensitivity analysis. Estimation uncertainty is quantified using the nonparametric... [*Read more*](/software/paths-imputation-approach-estimating-path-specific-causal-effects)

[rbw: Implementation of Residual Balancing Weights for Marginal Structural Models](/software/implementation-residual-balancing-weights-marginal-structural-models "rbw: Implementation of Residual Balancing Weights for Marginal Structural Models")

An R package implementing residual balancing weights for marginal structural models, which can be used to estimate marginal effects of time-varying treatments and also controlled direct/mediator effects in causal mediation analysis ([*Zhou and Wodtke 2020*](/sites/g/files/omnuum1816/files/xzhou/files/zhou-wodtke2020_rbw.pdf "zhou-wodtke2020_rbw.pdf")). This package provides two functions, rbwPanel() and rbwMed(), that produce residual balancing weights for analyses of time-varying treatments and causal mediation respectively. Available at ... [*Read more*](/software/implementation-residual-balancing-weights-marginal-structural-models "rbw: Implementation of Residual Balancing Weights for Marginal Structural Models")

[rwrmed: Regression-with-residuals (RWR) Analysis of Causal Mediation.](/software/rwrmed-regression-residuals-rwr-analysis-causal-mediation "rwrmed: Regression-with-residuals (RWR) Analysis of Causal Mediation.")

This packages implements the regression-with-residuals (RWR) approach to causal mediation analysis, allowing for post-treatment confounding of the mediator-outcome relationship ([*Zhou and Wodtke 2019*](/files/xzhou/files/zhou-wodtke2019_cde.pdf); [*Wodtke and Zhou 2019*](/sites/g/files/omnuum1816/files/xzhou/files/Wodtke-Zhou2020_decomp.pdf "Wodtke-Zhou2020_decomp.pdf")). The rwrmed() function fits user-specified mediator and outcome models with residualized post-treatment confounders. The decomp() function implements a two-component... [*Read more*](/software/rwrmed-regression-residuals-rwr-analysis-causal-mediation "rwrmed: Regression-with-residuals (RWR) Analysis of Causal Mediation.")

[strat: An Implementation of the Stratification Index](/software/strat "strat: An Implementation of the Stratification Index")

An R package implementing the stratification index ([*Zhou 2012*](https://journals.sagepub.com/doi/abs/10.1177/0081175012452207)). The package provides two functions, srank(), which returns stratum-specific information, including population share and average percentile rank; and strat(), which returns the stratification index and its approximate standard error. When a grouping factor is specified, strat also provides a detailed decomposition of the overall... [*Read more*](/software/strat "strat: An Implementation of the Stratification Index")