Package: causalverse 1.1.0

causalverse: The All-in-One Causal Inference Toolkit

A comprehensive, one-stop-shop toolkit for causal inference in R, the 'tidyverse' of causal analysis. Covers the full causal inference pipeline: randomized experiments (RCT, power analysis, attrition), quasi-experimental designs (DiD, staggered adoption, synthetic DID, synthetic controls, RD, IV), heterogeneous treatment effects (causal forests, BLP, GATES, Qini curves), mediation analysis, sensitivity analysis, panel data diagnostics, and publication-ready reporting. Provides 80+ utility functions, 14 in-depth vignettes, and seamless integration with leading causal inference packages.

Authors:Mike Nguyen [aut, cre]

causalverse_1.1.0.tar.gz
causalverse_1.1.0.zip(r-4.7-any)causalverse_1.1.0.zip(r-4.6-any)causalverse_1.1.0.zip(r-4.5-any)
causalverse_1.1.0.tgz(r-4.6-any)causalverse_1.1.0.tgz(r-4.5-any)
causalverse_1.1.0.tar.gz(r-4.7-any)causalverse_1.1.0.tar.gz(r-4.6-any)
causalverse_1.1.0.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION
card.svg |card.png
causalverse/json (API)

# Install 'causalverse' in R:
install.packages('causalverse', repos = c('https://mikenguyen13.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/mikenguyen13/causalverse/issues

Pkgdown/docs site:https://mikenguyen13.github.io

On CRAN:

Conda:

causal-analysiscausal-inferencecausal-modelscausalitycausality-analysis

6.36 score 6 stars 57 scripts 107 exports 119 dependencies

Last updated from:6d5877de50. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK581
source / vignettesOK2352
linux-releaseOK730
macos-releaseOK618
macos-oldrelOK676
windows-develOK524
windows-releaseOK665
windows-oldrelOK631
wasm-releaseOK349

Exports:ama_export_figama_export_tabama_labsama_scale_colorama_scale_fillama_themeattrition_analysisbacon_decomp_plotbalance_assessmentbalance_plotbalance_scatter_custombalance_tableblp_analysiscausal_forest_summarycausal_summarycausal_tablecheck_backendscoef_plotcompare_estimatorsconfounding_strengthcovariate_summarydag_adjustment_setsdag_plotdag_test_implicationsdid_event_studydid_power_analysisdose_responsedose_response_curvedr_ateeffect_size_convertequivalence_shiftevent_study_financeexport_figexport_tabget_balanced_panelheterogeneity_forest_plotheterogeneity_plotinstall_backendsiv_diagnostic_summaryiv_diagnosticsiv_sensitivityjournal_checkjournal_listjournal_palettejournal_sourcesjournal_stylejournal_tablelee_boundslove_plotmde_calcmed_indmediation_analysismultiverse_analysisnice_taboverlap_weightspanel_diagnosticspanel_estimateparallel_trends_plotplacebo_testplot_coef_comparisonplot_coef_par_trendsplot_covariate_balance_pretrendplot_density_by_treatmentplot_event_coefsplot_panel_estimateplot_PanelEstimateplot_par_trendsplot_pscore_overlapplot_rd_aa_shareplot_treat_timeplot_trends_across_grouppower_simpretrend_sensitivityprocess_panel_estimatepropensity_diagnosticsqini_curverd_assumption_testsrd_bandwidth_sensitivityrd_binscatterrd_covariate_balancerd_placebo_cutoffsrd_plotrole_boundsrole_simulationrole_testsc_gap_plotsc_inference_plotscale_color_journalscale_colour_journalscale_fill_journalsensitivity_plotshift_testsimulate_role_dataspec_curvestack_datastacked_didstaggered_summarysynthdid_estsynthdid_est_atesynthdid_est_persynthdid_plot_atesynthdid_se_jacknifesynthdid_se_placebotest_pretrendstheme_journaltidy_causaltreatment_calendar

Dependencies:abindargbackportsbdsmatrixbitbit64bootbroomcarcarDataCBPScellrangerclicliprcodetoolscollapsecolorspacecorpcorcowplotcpp11crayoncurldata.tableDerivdigestdoBydoParalleldplyrdreamerrfarverfastDummiesfixestforcatsforeachforecastforeignFormulafracdiffgenericsggplot2glmnetgluegtablehavenhmsHotellingisobanditeratorslabelinglatticelifecyclelme4lmtestmagrittrMASSMatchItMatrixMatrixModelsmaxLikmgcvminqamiscToolsmodelrmvtnormnlmenloptrnnetnumDerivPanelMatchpbkrtestpillarpkgconfigplmprettyunitsprogresspurrrquantregR.methodsS3R.ooR.utilsR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRcppProgressRdpackreadrreadxlreformulasrematchriorlangS7sandwichscalesshapeSparseMstringistringmagicstringrsurvivalsynthdidsystemfittibbletidyrtidyselecttimeDatetzdburcautf8vctrsviridisLitevroomwithrwritexlxtablezoo

Formatting Tables and Figures for a Target Journal
The journals covered | Look up one journal | How the rules differ | One set of models, many journals | Exporting | Checking a table against another journal | Figures | Keeping the rules current

Last update: 2026-11-29
Started: 2026-11-26

Moderator, Mediator, Both, or Neither?
The question | Did the treatment move Z? | The gated role test | How often do the rules get it right? | Bounds when the moderator was measured after treatment | References

Last update: 2026-11-29
Started: 2026-11-29

Regression Discontinuity
1. Introduction to Regression Discontinuity Designs | 1.1 Potential Outcomes Framework for RD | 1.2 Key Identifying Assumptions | 1.3 Sharp vs. Fuzzy RD | 1.4 Continuity-Based vs. Local Randomization Approaches | 2. Simulated Data | 3. Visual RD Analysis | 3.1 Raw Scatter Plot | 3.2 Binned Scatter Plot | 3.3 Local Polynomial Fits | 3.4 Linear Fits with Varying Bandwidths | 4. The rdrobust Package (Calonico, Cattaneo, Titiunik 2014) | 4.1 Basic Estimation with rdrobust() | 4.2 RD Plots with rdplot() | 4.3 Bandwidth Sensitivity Analysis | 4.4 Different Kernel Choices | 4.5 Different Polynomial Orders | 4.6 Including Covariates in rdrobust | 4.7 Clustered Standard Errors | 4.8 Additional rdrobust Options | 5. The rddensity Package (Cattaneo, Jansson, Ma 2020) | 5.1 Histogram Check | 5.2 Formal Density Test with rddensity() | 5.3 Density Plots with rdplotdensity() | 5.4 Advanced Options for rddensity | 6. The rdpower Package (Cattaneo, Titiunik, Vazquez-Bare 2019) | 6.1 Power Calculations with rdpower() | 6.2 Power for Different Effect Sizes | 6.3 Sample Size Calculations with rdsampsi() | 6.4 Power with Covariates | 7. The rdlocrand Package (Cattaneo, Frandsen, Titiunik 2015) | 7.1 Window Selection with rdwinselect() | 7.2 Randomization Inference with rdrandinf() | 7.3 Bernoulli vs. Fixed Margins Randomization | 7.4 Sensitivity to Window Choice | 7.5 Randomization Inference with Covariates | 8. The rdmulti Package (Cattaneo, Keele, Titiunik, Vazquez-Bare 2021) | 8.1 Simulated Multi-Cutoff Data | 8.2 Multi-Cutoff RD with rdmc() | 8.3 Multi-Score RD with rdms() | 8.4 Visualization for Multi-Cutoff Designs | 9. RD Bounds with the rdbounds Package and causalverse | 9.1 Conceptual Framework | 9.2 Full rdbounds Workflow for Sharp RD | 9.3 Full rdbounds Workflow for Fuzzy RD | 9.4 Customizing the Bounds Plot | 10. Fuzzy RD in Detail | 10.1 First Stage: Cutoff Predicts Treatment | 10.2 Reduced Form: Cutoff Predicts Outcome | 10.3 IV Estimation with fixest::feols() | 10.4 Bandwidth Sensitivity for Fuzzy RD | 10.5 Fuzzy RD with rdrobust | 11. Covariate Balance Tests | 11.1 Covariate-as-Outcome Tests | 11.2 Visual Balance Check | 11.3 Covariate Balance with rdrobust | 11.4 Visual Covariate Plots | 12. Lee Bounds and the Connection to RD | 12.1 Using lee_bounds() from causalverse | 13. Sharp RD Estimation with fixest | 13.1 Local Linear Regression | 13.2 Bandwidth Sensitivity | 13.3 Higher-Order Polynomial Specifications | 13.4 Triangular Kernel Weights | 14. Heterogeneous Treatment Effects in RD with rdhte | 14.1 Simulated Example | 14.2 Bandwidth Selection for HTE | 14.3 Linear Combinations of Effects | 15. Boundary/Geographic RD with rd2d | 15.1 Simulated Example | 15.2 Rich Geographic Visualizations | Panel 1: Treatment Boundary Map | Panel 2: Outcome Heat Map (Choropleth) | Panel 3: Density of Units Near the Boundary | Panel 4: The Jump at the Boundary (RD Plot) | 16. Regression Kink Design | 16.1 Theory | 16.2 Estimation with rdrobust | 16.3 Visualizing the Kink | 17. RD with Discrete Running Variable | 17.1 Key Challenges | 17.2 Binomial Test Approach | 17.3 Local Linear Estimation with Clustering | 18. Practical Guidelines for Applied Researchers | 14.1 Design Phase | 14.2 Analysis Checklist | 14.3 Common Pitfalls | 14.4 Placebo Cutoff Tests | 14.5 Donut Hole Tests | 19. Comprehensive Visualization Suite for RD | 19.1 Publication-Ready RD Plot with Binned Scatter | 19.2 Full RD Assumption Test Battery | 19.3 Bandwidth Sensitivity Visualization | 19.4 Placebo Cutoff Visualization | 19.5 Density Continuity (McCrary) Test Visualization | 19.6 Covariate Balance at the Cutoff | 19.7 Confidence Interval Comparison: Conventional vs. Robust | 19.8 Local Randomization Framework: Balance Tests | 19.9 Fuzzy RD: First Stage and Reduced Form Visualization | 19.10 Complete RD Publication Pipeline | 20. Comprehensive References | Foundational References | Estimation and Inference | Manipulation Testing | Power Analysis | Local Randomization | Multiple Cutoffs and Scores | Bounds Under Manipulation | Lee Bounds and Selection | Polynomial Warnings | Software and Implementation

Last update: 2026-11-27
Started: 2026-03-18

Event Studies (Finance)
1. Introduction | 1.1 What Is a Finance Event Study? | 1.2 A Brief History | 1.3 Finance Event Studies vs. Econometric Event Studies | 2. The Event Study Framework | 2.1 Timeline and Windows | 2.2 Normal Return Models | 2.2.1 Constant Mean Return Model | 2.2.2 Market Model | 2.2.3 Market-Adjusted Return Model | 2.2.4 Fama-French Three-Factor Model | 2.2.5 Carhart Four-Factor Model | 2.3 Abnormal Returns | 2.4 Cumulative Abnormal Returns (CAR) | 2.5 Buy-and-Hold Abnormal Returns (BHAR) | 3. Simulated Data | 4. Market Model Estimation | 4.1 OLS Estimation in the Estimation Window | 4.2 Estimation Using fixest::feols() | 4.3 Computing Abnormal Returns | 4.4 Visualizing Average Abnormal Returns | 5. Cumulative Abnormal Returns (CAR) | 5.1 Computing CAR for Individual Firms | 5.2 Cumulative Average Abnormal Return Over Time | 5.3 Visualizing CAAR | 5.4 CAR Distribution Across Firms | 6. Statistical Tests | 6.1 Parametric Tests | 6.1.1 Cross-Sectional t-Test | 6.1.2 Standardized Cross-Sectional Test (Patell Test) | 6.1.3 BMP Test (Boehmer, Musumeci, and Poulsen, 1991) | 6.2 Non-Parametric Tests | 6.2.1 Sign Test | 6.2.2 Generalized Sign Test | 6.2.3 Rank Test (Corrado, 1989) | 6.3 Summary of Test Results | 7. Buy-and-Hold Abnormal Returns (BHAR) | 7.1 Why BHAR? | 7.2 BHAR Calculation | 7.3 BHAR Accumulation Over Time | 7.4 Calendar-Time Portfolio Approach (CTAR) | 8. Fama-French Factor Models | 8.1 Three-Factor Model | 8.2 Carhart Four-Factor Model | 8.3 Which Model to Use? | 9. The EventStudy Package | 9.1 Basic Usage | 9.2 Available Models in EventStudy | 9.3 Available Tests in EventStudy | 10. Cross-Sectional Analysis of CARs | 10.1 Motivation | 10.2 OLS Cross-Sectional Regression | 10.3 Using fixest::feols() | 10.4 Interpreting Cross-Sectional Results | 10.5 Multiple Window Analysis | 11. The estudy2 Package: C++ Optimized Event Study Tests | 11.1 Overview of Available Tests | 11.2 Basic Usage with estudy() | 11.3 Interpreting Nonparametric Results | 12. Long-Horizon Event Studies | 12.1 Calendar-Time Portfolio Approach (CTPR) | 12.2 Buy-and-Hold Abnormal Returns (Long-Horizon) | 12.3 Robust Inference with crseEventStudy | 13. Event-Induced Variance and Cross-Sectional Dependence | 13.1 The Kolari-Pynnonen (2010) Adjusted BMP Test | 13.2 Handling Event Date Clustering | 14. Wealth Effects and Dollar Abnormal Returns | 14.1 Converting CARs to Dollar Returns | 14.2 Portfolio-Level Wealth Analysis | 15. Best Practices and Common Pitfalls | 15.1 Event Date Accuracy | 15.2 Overlapping Events | 15.3 Thin Trading | 15.4 Event-Induced Variance | 15.5 Clustering of Event Dates | 15.6 Estimation Window Length | 15.7 Short-Selling Constraints and Market Microstructure | 16. Comparison: Finance vs. Econometric Event Studies | 16.1 Finance Event Studies | 16.2 Econometric Event Studies (Dynamic DID) | 16.3 When to Use Which | 17. Putting It All Together: A Complete Event Study Pipeline | 18. Total Event Valuation and Aggregate Wealth Effects | 18.1 From CAR to Dollar Wealth Effect | 18.2 Market-Cap Weighted vs. Equal-Weighted CARs | 18.3 Industry Spillover and Rival Wealth Effects | 18.4 Cross-Sectional Regression: Determinants of CARs | 18.5 M&A Wealth Effects: Combined Firm Value (CFV) | 18.6 Bootstrap Confidence Intervals for CARs | 18.7 Multiple Testing Corrections (FDR/Bonferroni) | 18.8 Power Analysis for Event Studies | 18.9 Full Publication-Quality Event Study Table | 18.10 NPV Interpretation: CAR as Capitalized Value Change | 18.11 Normalized Event Cost Metrics | 18.12 Population Extrapolation: Scaling to the Full Industry | 18.13 Regulatory Cost Assessment via Event Studies | Method | Caveat: The Endogeneity Problem | 19. Advanced Topics: Intraday Event Studies and High-Frequency Data | 19.1 Intraday vs. Daily Event Studies | 19.2 Volatility Around Events: Event-Induced Variance | 19.3 Announcement Returns vs. Pre-Announcement Drift | 20. References

Last update: 2026-11-27
Started: 2026-03-18

Randomized Control Trials
1. Introduction | 1.1 Randomized Control Trials as the Gold Standard | 1.2 The Potential Outcomes Framework (Rubin Causal Model) | 1.3 Estimands: ATE, ATT, ATU | 1.4 SUTVA: Stable Unit Treatment Value Assumption | 1.5 Randomization as an Identification Strategy | 1.6 Finite-Sample vs. Super-Population Inference | 2. Simulated RCT Data | 3. Balance Checking | 3.1 Summary Statistics by Group | 3.2 Standardized Mean Differences | 3.3 Visualizing Standardized Mean Differences | 3.4 Variable-by-Variable t-Tests | 3.5 Formal Joint Balance Tests with balance_assessment() | 3.6 Visual Balance Check with plot_density_by_treatment() | 4. Treatment Effect Estimation | 4.1 Simple Difference in Means (t-test) | 4.2 OLS Regression with fixest::feols() | 4.3 Covariate-Adjusted Estimation | 4.4 The Lin (2013) Estimator | 4.5 Fixed Effects for Stratified (Block) Experiments | 5. Robust Standard Errors with estimatr | 5.1 HC2 Standard Errors with lm_robust() | 5.2 Difference in Means with difference_in_means() | 5.3 The Lin Estimator via lm_lin() | 6. Randomization Inference with ri2 | 6.1 Motivation | 6.2 Randomization Inference with ri2 | 6.3 Randomization Inference for Blocked Designs | 7. Experimental Design with DeclareDesign | 7.1 Declaring a Design | 7.2 Diagnosing the Design | 7.3 Redesigning for Power | 8. Randomization with randomizr | 8.1 Complete Random Assignment | 8.2 Block (Stratified) Random Assignment | 8.3 Cluster Random Assignment | 9. Heterogeneous Treatment Effects | 9.1 Why Heterogeneity Matters | 9.2 Interaction Models | 9.3 Subgroup Analysis | 9.4 Heterogeneity by Education Level | 9.5 Causal Forests for Data-Driven Heterogeneity (grf) | 10. Multiple Testing Corrections | 10.1 The Multiple Testing Problem | 10.2 Simulating Multiple Outcomes | 10.3 Applying Corrections | 10.4 Comparison of Methods | 11. Power Analysis | 11.1 Analytical Power Calculation | 11.2 Power for Different Effect Sizes | 11.3 Power Curves | 11.4 Power with Multiple Effect Sizes | 11.5 Impact of Covariate Adjustment on Power | 12. Cluster-Randomized Trials | 12.1 When Clusters Matter | 12.2 Intra-Class Correlation Coefficient (ICC) | 12.3 Cluster-Robust Standard Errors | 12.4 Power for Cluster-Randomized Trials | 13. Sensitivity Analysis with sensemakr | 13.1 Motivation | 13.2 Sensitivity Analysis | 14. Causal Forests with grf | 14.1 Simulating Data with Heterogeneous Effects | 14.2 Fitting the Causal Forest | 14.3 Variable Importance | 14.4 CATE Estimation and Targeting | 14.5 Best Linear Projection and Calibration | 14.6 Prioritization Analysis | 15. Double/Debiased Machine Learning with DoubleML | 15.1 Partially Linear Regression Model (PLR) | 15.2 Interactive Regression Model (IRM) | 15.3 Comparison of DML Approaches | 16. BART-based Causal Inference with bartCause | 16.1 Estimating ATE and ATT | 16.2 ATT Estimation | 16.3 Posterior Distribution of Treatment Effects | 17. Optimal Treatment Assignment with policytree | 17.1 Computing Doubly Robust Scores | 17.2 Learning an Optimal Policy Tree | 17.3 Evaluating the Policy | 18. Adaptive Experiments and Multi-Armed Bandits | 18.1 Thompson Sampling with Valid Inference | 18.2 Key Concepts | 19. Covariate-Adaptive Randomization | 19.1 Block (Stratified) Randomization | 19.2 Cluster Randomization | 19.3 Block-and-Cluster Randomization | 19.4 Rerandomization | 20. Practical Guidelines and Checklist | 20.1 Pre-Registration | 20.2 The CONSORT Framework | 20.3 Analysis Checklist | 20.4 Common Pitfalls | 21. Summary | 22. Adaptive Experimental Design | 22.1 Response-Adaptive Randomization | 22.2 Sequential Testing with Alpha-Spending Functions | 22.3 Bayesian Adaptive Trial Design | 23. Comprehensive Visualization Suite for RCTs | 23.1 CONSORT Flow Diagram | 23.2 Treatment Effect by Subgroup Forest Plot | 23.3 Dose-Response Curve (Continuous Treatment) | 23.4 Compliance Diagram (Assignment vs. Receipt) | 23.5 Power Curve: Power vs. Sample Size | 24. Regression Adjustment and ANCOVA | 24.1 Why ANCOVA Increases Power | 24.2 Lin (2013) Interaction Estimator | 24.3 Simulation: Naive vs. ANCOVA vs. Lin Estimator | 24.4 ANCOVA Power Gain Formula | 25. Intention-to-Treat, Per-Protocol, and LATE | 25.1 Data Generating Process with Non-Compliance | 25.2 Intent-to-Treat (ITT) Estimate | 25.3 Per-Protocol (PP) Estimate | 25.4 Local Average Treatment Effect (LATE) via Wald Estimator and 2SLS | 25.5 IV Approach with Covariates (2SLS) | References | SUTVA Violations and Interference | The Stable Unit Treatment Value Assumption | Network Interference and Exposure Mapping | Simulating Spillover Effects in a Network | Bipartite Experiments and Two-Sided Platforms | Cluster-Level SUTVA: Conservative but Robust | Manski (1993) Bounds Under Interference | Adaptive Experiments: Thompson Sampling and Bayesian Updating | Why Adapt? The Exploration-Exploitation Trade-off | Thompson Sampling for Bernoulli Arms | Inference After Adaptive Experiments | Rerandomization and Covariate-Adaptive Randomization | The Problem with Pure Randomization | Mahalanobis Rerandomization (Morgan and Rubin 2012) | Stratified Block Randomization | Pairwise Matching Before Randomization | Comparing Designs: CRD vs. Rerandomized vs. Stratified | Additional References (SUTVA, Adaptive, Rerandomization)

Last update: 2026-11-27
Started: 2026-03-18

Synthetic Controls
1. Introduction | 1.1 The Problem of Comparative Case Studies | 1.2 Mathematical Formulation | 1.3 Key Assumptions | 1.4 Advantages Over Traditional Methods | 1.5 Relationship to Other Methods | 2. California Proposition 99 Example | 2.1 Data Overview | 2.2 Setting Up the Panel Matrices | 2.3 Pure Synthetic Control Estimate | 2.4 Synthetic Difference-in-Differences Estimate | 2.5 Standard DID Estimate | 2.6 Visualizing the Estimates | 2.7 Unit Contribution Plot | 3. causalverse Synthetic Control Functions | 3.1 Available Estimation Methods | 3.2 Comparing All Methods with panel_estimate() | 3.3 Formatting Results with process_panel_estimate() | 3.4 Data Preparation with get_balanced_panel() | 3.5 Single-Cohort Estimation with synthdid_est() | 4. Standard Errors and Inference | 4.1 Placebo-Based Inference with synthdid_se_placebo() | 4.2 Jackknife Standard Errors with synthdid_se_jacknife() | 4.3 Comparison of SE Methods | 4.4 Confidence Intervals from synthdid_est_ate() | 5. Staggered Adoption Synthetic Controls | 5.1 The Staggered Adoption Problem | 5.2 The synthdid_est_ate() Function | 5.3 Visualizing Staggered SC Results with synthdid_plot_ate() | 5.4 Comparing Multiple Methods Under Staggered Adoption | 5.5 Placebo Analysis for Staggered Adoption | 6. Per-Period Treatment Effects | 6.1 Decomposing Effects with synthdid_est_per() | 6.2 Interpreting Per-Period Effects | 6.3 Visualizing Per-Period Effects | 7. The Classic Synth Package | 7.1 The dataprep() Function | 7.2 The synth() Function | 7.3 Diagnostic Plots | 7.4 Placebo Tests with Synth | 8. Augmented Synthetic Control with augsynth | 8.1 Motivation | 8.2 The ASCM Estimator | 8.3 Using the augsynth Package | 8.4 Ridge ASCM | 8.5 Other Outcome Models | 8.6 Staggered Adoption with augsynth | 9. Generalized Synthetic Control with gsynth | 9.1 Motivation | 9.2 The IFE Model | 9.3 Using the gsynth Package | 9.4 Examining Results | 9.5 Multiple Treated Units | 9.6 Choosing the Number of Factors | 10. Placebo Tests and Falsification | 10.1 In-Space Placebos | 10.2 In-Time Placebos | 10.3 Pre-Treatment Fit Assessment | 11. Pre-Trend Visualization | 11.1 Gap Plots | 11.2 Path Plots | 11.3 Ratio of Post/Pre MSPE | 12. Practical Guidelines | 12.1 When to Use SC vs. SynthDID vs. DID | 12.2 Donor Pool Selection | 12.3 Number of Pre-Treatment Periods | 12.4 Reporting Checklist | 12.5 Common Pitfalls | 13. Tidy Synthetic Controls with tidysynth | 14. Penalized Synthetic Controls with pensynth | 15. SCtools Extensions | 16. Micro-level Synthetic Controls with microsynth | 13. Summary of causalverse SC Functions | 15. Visualization Suite for Synthetic Control | A. Predictor Balance Table | B. Donor Weight Plot | C. Gap Plot | D. In-Space Placebo Distribution Overlay | E. Pre/Post RMSPE Ratio Distribution | 16. Inference for Synthetic Controls | A. Fisher Exact P-Values from Placebo Distribution | B. Ratio Test: Post/Pre RMSPE | C. Confidence Sets from In-Time and In-Space Placebos | 17. Partially Pooled Synthetic Control (Abadie-L'Hour) | 18. Publication-Ready SC Table and Figures | A. Standard Predictor Balance Table | B. Comparison of SC, Augmented SC, and SynthDiD Estimates | 14. References | Foundational Papers | Synthetic Difference-in-Differences | Augmented Synthetic Control | Staggered Adoption | Generalized Synthetic Control | De-meaned SC and Extensions | Inference | Matrix Completion | Software

Last update: 2026-11-27
Started: 2026-03-18

Sensitivity Analysis and Robustness
Introduction | Omitted Variable Bias: sensemakr | Theory | Implementation | Contour Plots | Extreme Scenarios | Multiple Treatments | Interpretation Guidelines | When the Controls May Be Correlated with the Omitted Variable: regsensitivity | Rosenbaum Bounds | Implementation with rbounds | Implementation with sensitivitymv | Interpretation | E-values | Computing E-values | E-values for Different Study Designs | Visualization | HonestDiD: Sensitivity for Parallel Trends | Smoothness Restrictions | Relative Magnitudes | Placebo Tests | Types of Placebo Tests | Placebo Outcomes | Placebo Treatments (In-Time Placebos for DID) | Placebo Cutoffs for RD | In-Space Placebos for Synthetic Control | Specification Curve Analysis | Building the Specification Space | Bounds Approaches | Lee Bounds | Manual Lee Bounds | Manski Bounds | Multiple Testing Corrections | Family-Wise Error Rate (FWER) | False Discovery Rate (FDR) | Romano-Wolf Step-Down | Choosing a Correction | Randomization Inference | Manual Implementation | ri2 Package | RI for Clustered Designs | When to Use Randomization Inference | Bootstrap Methods | Nonparametric Bootstrap | Pairs Cluster Bootstrap | Wild Cluster Bootstrap | Wild Bootstrap with Few Clusters | Choosing a Bootstrap Method | KonFound-It Framework | Treatment Effect Sensitivity with treatSens | Tipping Point Analysis with tipr | OVtool for Propensity Score Weighting | Selection Model Sensitivity with causalsens | Practical Guidelines | Decision Framework | Which Sensitivity Analysis for Which Method? | Reporting Standards | A Minimal Sensitivity Checklist | Comprehensive Visualization Suite for Sensitivity Analysis | A. Sensitivity Contour Plot for OVB (Omitted Variable Bias) | B. E-Value Distribution Across Multiple Outcomes and Specifications | C. Specification Curve with Color-Coded Decisions | D. Breakdown Point Analysis Plot | E. Calibration Plot: Sensitivity Relative to Known Confounders | Partial Identification Bounds | A. Manski (1990) Sharp Bounds for ATE Under No Assumptions | B. Monotone Treatment Response (MTR) Bounds | C. Monotone Treatment Selection (MTS) Bounds | D. Bounds Comparison Visualization | Quantile Treatment Effects and Distributional Analysis | A. QTE Estimation (Difference in Quantile Functions) | B. Stochastic Dominance Tests | C. Distribution of Treatment Effects Visualization | References | Manski (1990) Partial Identification Bounds | Why Partial Identification? | No-Assumptions Bounds (Manski 1990) | Monotone Treatment Response (MTR) Bounds | Monotone Treatment Selection (MTS) Bounds | MTR + MTS Combined Bounds | Rosenbaum Sensitivity Analysis (Gamma Analysis) | The Framework | Interpreting the Sensitivity Threshold | Partial R2 and Sensitivity Contours: Cinelli and Hazlett (2020) | The sensemakr Framework | Sensitivity Contour Plot | Benchmark Against Observed Covariates | Sensitivity Without sensemakr: Manual Omitted Variable Bias Calculation | Putting It All Together: A Sensitivity Dashboard | Additional References (Partial Identification and Sensitivity)

Last update: 2026-11-25
Started: 2026-03-18

Introduction to CausalVerse
Introduction to the causalverse Package | Core Packages (Auto-Attached) | Vignettes Overview | Reporting | Figures | Export Figures | Tables | Export Tables | Model Free Evidence | Why Visualize Model-Free Evidence? | Using plot_trends_across_group for Model-Free Evidence | New Utility Functions | Robustness & Diagnostics | Regression Discontinuity | Instrumental Variables | Matching & Propensity Scores | Visualization | Package Management | Other Functions | Package Overview: Functions by Method Category | Quick-Start: Three-Line Examples | Decision Guide: Which Method to Use? | New Utility Functions Showcase | tidy_causal(): Unified Model Output | causal_table(): Publication-Ready Comparison Table | effect_size_convert(): Translating Effect Sizes | compare_estimators(): Head-to-Head Method Comparison | balance_table(): Covariate Balance Assessment | Covariate Summary: Publication-Ready Table 1 | Power Analysis | Minimum Detectable Effect with mde_calc() | DiD Power Analysis with did_power_analysis() | Power Curves: Comparing Designs | Treatment Calendar and Staggered Adoption Summary | Treatment Calendar | Staggered Summary | Effect Size Reporting for Publications | Converting a Regression Coefficient | Publication Table Workflow | Putting It All Together: A Complete Workflow

Last update: 2026-08-12
Started: 2024-01-12

Heterogeneous Treatment Effects & Causal ML
1. Introduction | 1.1 Why Heterogeneous Treatment Effects Matter | 1.2 Key Estimands: CATE, ATE, ATT | 1.3 Identification Assumptions | 1.4 Overview of Methods Covered | 2. Setup & Data | 2.1 Simulated Data with Known Heterogeneity | 2.2 The Lalonde Dataset | 2.3 Pre-Treatment Covariate Balance | 2.4 True CATE Distribution | 3. Meta-Learners | 3.1 S-Learner (Single Learner) | 3.2 T-Learner (Two-Learner) | 3.3 X-Learner (Künzel et al. 2019) | 3.4 R-Learner (Robinson 1988 / Nie & Wager 2021) | 3.5 Meta-Learner Comparison | 4. Causal Forests (GRF) | 4.1 Fitting a Causal Forest | 4.2 ATE Estimation | 4.3 CATE Predictions with Confidence Intervals | 4.4 Calibration Test | 4.5 Variable Importance | 4.6 CATE Distribution | 4.7 CATE vs. True Treatment Effect | 4.8 Comprehensive Summary via causal_forest_summary() | 5. BLP Analysis (Best Linear Predictor) | 5.1 The BLP Regression | 5.2 Running BLP Analysis | 5.3 BLP Plot | 5.4 GATES: Group Average Treatment Effects | 5.5 GATES Without GRF (Using OLS) | 6. Qini Curve & Policy Evaluation | 6.1 The Qini Curve | 6.2 Computing the Qini Curve | 6.3 Comparing Qini Curves Across Estimators | 6.4 Optimal Treatment Targeting | 6.5 Policy Value via AIPW | 7. HTE Visualization Suite | 7.1 Forest Plot by Subgroups | 7.2 CATE vs. Continuous Moderator | 7.3 Violin Plot by Treatment Group | 7.4 Partial Dependence Plot | 7.5 Calibration Plot: Predicted vs. Actual CATE by Decile | 8. Double Machine Learning (DML) | 8.1 The Partially Linear Model | 8.2 DML Implementation with Cross-Fitting | 8.3 Heterogeneous DML via Interactions | 8.4 Using the DoubleML Package | 8.5 Interactive Regression Model (IRM) for CATE | 9. AIPW / Augmented IPW for HTE | 9.1 The AIPW Score | 9.2 AIPW ATE Estimation via dr_ate() | 9.3 DR-Learner for CATE | 9.4 Efficiency Comparison: IPW vs. AIPW | 10. Moderated Treatment Effects | 10.1 Treatment-Covariate Interaction Models | 10.2 Omnibus Test for Moderation | 10.3 Marginal Effects of Treatment at Different Covariate Values | 10.4 Marginal Effects with marginaleffects | 11. Subgroup Analysis Best Practices | 11.1 Pre-Specified vs. Data-Driven Subgroups | 11.2 Multiple Testing Correction | 11.3 Causal Tree (Honest Partitioning) | 11.4 Virtual Twins Method | 11.5 Subgroup Forest Plot via heterogeneity_plot() | 12. Evaluation Framework | 12.1 Oracle Evaluation (Simulation) | 12.2 Proxy Evaluation: R-Loss and Tau-Risk | 12.3 Cross-Validated AUUC | 12.4 Bootstrap Confidence Intervals for AUUC | 13. CATE Estimation Uncertainty | 13.1 Pointwise Confidence Intervals from Causal Forest | 13.2 Bootstrap of Entire ML Pipeline | 13.3 Selective Inference Issues | 14. Practical HTE Analysis for Publications | 14.1 Complete Publication Pipeline | 14.2 Subgroup ATE Table | 14.3 Publication Forest Plot | 14.4 Feature Importance for HTE | 14.5 CATE Distribution Summary Figure | 15. Stochastic Treatment Regimes & Targeting Rules | 15.1 Optimal Policy Rules | 15.2 Policy Value Estimation via GRF | 15.3 Welfare Gain from Targeting | 15.4 Stochastic (Probabilistic) Policies | 16. Sensitivity Analysis for HTE | 16.1 Sensitivity to Model Specification | 16.2 Sensitivity to Overlap Violations | 17. Summary & Best Practices | 17.1 Choosing a CATE Estimator | 17.2 Key Diagnostics Checklist | 17.3 Reporting Checklist for Papers | 17.4 Cross-References to Other causalverse Vignettes | 18. Advanced Topics in HTE | 18.1 Continuous and Multi-Valued Treatments | 18.2 Instrumental Variables with Heterogeneity | 18.3 Difference-in-Differences with Heterogeneous Effects | 19. Practical Workflow with causalverse | 19.1 End-to-End HTE Pipeline | 19.2 Integrating AIPW and Causal Forest | 19.3 Using causalverse::dr_ate() on Real Data | 19.4 HTE on Real Data: Lalonde Job Training | 20. Common Pitfalls and Troubleshooting | 20.1 The SUTVA Violation | 20.2 Outcome Leakage into Covariates | 20.3 Extrapolation in CATE Estimation | 20.4 Model Selection for Nuisance Functions | 20.5 Testing for Effect Modification vs. Effect Measure Modification | References

Last update: 2026-08-12
Started: 2026-03-18

Causal Mediation Analysis
Introduction | Key Estimands | Why Mediation Is Hard | 1. The Potential Outcomes Framework for Mediation | Notation | Formal Definitions | Sequential Ignorability | Identification Formula | Simulated Example: Setup | 2. Baron-Kenny Steps (Classical Approach) | Step-by-Step Implementation | Sobel Test | Bootstrap Sobel Test | Limitations of Baron-Kenny | 3. Imai et al. (2010) Causal Mediation | Using causalverse::mediation_analysis() | Direct Use of mediation Package | Quasi-Bayesian vs. Bootstrap Confidence Intervals | 4. Sensitivity Analysis for Mediation | Sensitivity Parameter $\rho$ | Running Sensitivity Analysis | Interpreting Sensitivity Results | $R^2$ Sensitivity Plot | E-Values for Mediation | 5. causalverse::med_ind() - Monte Carlo Indirect Effects | How It Works | Basic Usage | Comparison of Methods | When to Use Monte Carlo vs. Bootstrap | 6. Multiple Mediators | Parallel Mediation | Sequential Mediation | SEM for Multiple Mediators with lavaan | 7. Moderated Mediation (Conditional Process Analysis) | Model Specification | Conditional Indirect Effects | Bootstrap CIs for Conditional Indirect Effects | Visualization: Conditional Indirect Effects | Index of Moderated Mediation (IMM) | Johnson-Neyman (Floodlight) Analysis | 8. Mediation with Binary Outcomes | Logistic Mediation | Interpretation with Binary Outcomes | Binary Mediator and Binary Outcome | 9. Mediation with Treatment Heterogeneity | Subgroup-Specific ACME | Treatment-Mediator Interaction | 10. Causal Forest for Heterogeneous Mediation | Estimating CATE with grf | Decomposing CATE into Mediated vs. Direct Components | 11. Natural Direct and Indirect Effects | Definitions | VanderWeele's Four-Way Decomposition | Implementation with Linear Models | CMAverse Package (if available) | 12. Difference-in-Differences Mediation | Setup: Panel Data Mediation | First-Differencing Mediator and Outcome | Sequential Exogeneity of Mediator | 13. Front-Door Criterion and Instrument-Based Mediation | Front-Door Identification | LATE-Based Mediation Decomposition | 14. Lee Bounds for Mediation with Selection | Setup with Selection into Mediator | Manual Lee Bounds Computation | causalverse::lee_bounds() (requires MedBounds package) | 15. Visualization Suite for Mediation | 1. Path Diagram | 2. Effect Decomposition Bar Chart | 3. Sensitivity Plot: ACME vs. Rho | 4. Proportion Mediated with Uncertainty | 5. Stacked Decomposition Across Subgroups | 16. Structural Equation Modeling (SEM) for Mediation | Simple Mediation in lavaan | Model Fit Assessment | Modification Indices | Multiple Outcomes SEM | Bayesian SEM with blavaan | 17. Complete Publication Pipeline | Step 1: Theory and Hypotheses | Step 2: Data and DGP | Step 3: Descriptive Statistics | Step 4: Correlation Matrix | Step 5: Baron-Kenny Regressions | Step 6: Causal Mediation (Imai et al.) | Step 7: Sensitivity Analysis | Step 8: Publication Figure | Step 9: APA/AMA-Style Reporting Text | Step 10: Reporting Checklist | 18. Summary and Reference Table | Effect Estimand Reference | Identification Assumptions Summary | Package Reference | 19. Common Pitfalls and Practical Guidance | Pitfall 1: Treating Baron-Kenny as Causal Without Justification | Pitfall 2: Ignoring Measurement Error in the Mediator | Pitfall 3: Multicollinearity Between T and M in the Outcome Model | Pitfall 4: Improper Handling of Confounders | Pitfall 5: Reverse Causation (M → T) | 20. Power Analysis for Mediation | Analytical Power for Sobel Test | Monte Carlo Power for Bootstrap Tests | Sample Size Recommendations (Fritz & MacKinnon 2007) | 21. Mediation in Experimental vs. Observational Settings | Randomized Experiment with Mediation | Designs That Strengthen Causal Claims | Observational Mediation: Practical Recommendations | References | Session Information

Last update: 2026-08-12
Started: 2026-03-18

Panel Data Methods
Panel Data Methods | 1. Introduction to Panel Data | 1.1 What Is Panel Data? | 1.2 Balanced vs. Unbalanced Panels | 1.3 Long vs. Wide Format | 1.4 Why Use Panel Data? | 2. Panel Data Structure & Exploration | 2.1 Simulating a Panel Dataset | 2.2 Checking Balance | 2.3 Using get_balanced_panel() from causalverse | 2.4 Within and Between Variation Decomposition | 2.5 Intraclass Correlation (ICC) | 2.6 Missing Data Visualization | 3. Pooled OLS | 3.1 Assumptions and Validity | 3.2 Estimation | 3.3 Cluster-Robust Standard Errors (Liang-Zeger) | 4. Fixed Effects (Within Estimator) | 4.1 The Within Transformation | 4.2 Two-Way FE | 4.3 Interpreting Fixed Effects | 4.4 Two-Way Cluster-Robust Standard Errors | 4.5 Extracting Fixed Effects | 4.6 Using tidy_causal() for FE Results | 5. Random Effects (GLS) | 5.1 The Random Effects Model | 5.2 Hausman Test: FE vs RE | 5.3 Mundlak Correlated Random Effects (CRE) | 6. First-Differences Estimator | 6.1 When to Use First Differences | 6.2 FD vs FE Comparison | 6.3 First-Difference IV | 7. Between Estimator | 7.1 The Between Regression | 7.2 Interpretation and Limitations | 8. Two-Way Mundlak / Correlated Random Effects | 8.1 The Mundlak Device | 8.2 Two-Way CRE (Wooldridge 2021) | 8.3 CRE with Unbalanced Panels | 9. Panel Unit Root Tests | 9.1 Why Unit Roots Matter in Panels | 9.2 ADF Test Per Unit | 9.3 KPSS Test (Stationarity Null) | 9.4 Im-Pesaran-Shin (IPS) Panel Unit Root Test | 9.5 Levin-Lin-Chu (LLC) Test | 9.6 Decision Tree for I(0) vs I(1) | 10. Serial Correlation Tests | 10.1 Why Serial Correlation Matters | 10.2 Wooldridge (2002) Test | 10.3 Breusch-Godfrey / Durbin-Watson for Panels | 10.4 Correcting Serial Correlation | 11. Cross-Sectional Dependence | 11.1 What Is Cross-Sectional Dependence? | 11.2 Pesaran (2004) CD Test | 11.3 Frees (1995) Test | 11.4 Pesaran CCEMG Estimator (Concept) | 12. Heteroskedasticity in Panels | 12.1 Testing for Panel Heteroskedasticity | 12.2 Modified Wald Test for Group-Wise Heteroskedasticity | 12.3 Solutions | 13. Dynamic Panel Models (GMM) | 13.1 The Nickell Bias | 13.2 Arellano-Bond GMM (AB) | 13.3 System GMM (Blundell-Bond) | 13.4 Sargan-Hansen Instrument Validity Test | 13.5 Arellano-Bond AR(1) and AR(2) Tests | 13.6 Instrument Proliferation Warning | 14. Panel Cointegration | 14.1 Spurious Regressions in Panels | 14.2 Engle-Granger Panel Cointegration | 14.3 Error Correction Model (ECM) | 15. Interactive Fixed Effects & Factor Models | 15.1 Bai (2009) Interactive FE Model | 15.2 Principal Component Estimation | 15.3 Comparison: TWFE vs Interactive FE | 16. Nonlinear Panel Models | 16.1 The Incidental Parameter Problem | 16.2 Fixed Effects Logit | 16.3 Fixed Effects Poisson | 16.4 Comparing Poisson vs OLS for Count Outcomes | 17. Unbalanced Panels and Attrition | 17.1 Types of Missingness | 17.2 Attrition Bias Illustration | 17.3 Inverse Probability Weighting (IPW) for Attrition | 18. Long-Run Effects in Panels | 18.1 Distributed Lag Models | 18.2 Local Projections (Jordà 2005) | 19. Panel Data Visualization Suite | 19.1 Spaghetti Plot with Mean Trend | 19.2 Panel Heatmap | 19.3 Variance Decomposition Plot | 19.4 ACF of Panel Residuals by Unit | 19.5 Within vs Between Scatter | 20. Publication Pipeline | 20.1 Assumption Checklist | 20.2 Four-Column Comparison Table | 20.3 Using causal_table() for Journal Output | 20.4 Using tidy_causal() for Programmatic Extraction | 20.5 Coefficient Plot Across Estimators | 20.6 Reporting Guidance | 21. Driscoll-Kraay Standard Errors | 21.1 Motivation | 21.2 Implementation | 21.3 When to Use Driscoll-Kraay | 22. Heterogeneous Treatment Effects in Panels | 22.1 Problem with Pooled FE under Heterogeneity | 22.2 Detecting Heterogeneity | 22.3 Binscatter by Heterogeneity Dimension | 22.4 Mean Group Estimator (Pesaran & Smith 1995) | 23. Specification Curves for Panel Models | 23.1 Researcher Degrees of Freedom | 24. Panel Power Analysis | 24.1 Power in Panel Designs | 24.2 Simulation-Based Power Curve | 24.3 Minimum Detectable Effect (MDE) in Panels | 25. Advanced Topics: Synthetic Control as Panel Method | 25.1 Connection to Panel Data | 25.2 Matrix Completion Perspective | 26. Practical Workflow Example: Firm-Level Panel | 26.1 End-to-End Application | 26.2 Step 1 - Descriptives and Balance | 26.3 Step 2 - Unit Root Screening | 26.4 Step 3 - Model Estimation | 26.5 Step 4 - Diagnostics | 26.6 Step 5 - Final Preferred Model | 26.7 Visualization of Final Results | Summary | References

Last update: 2026-08-12
Started: 2026-03-18

Synthetic Difference-in-Differences
Theory and Background | Overview | Mathematical Formulation | Unit Weights ($\hat{\omega}$) | Time Weights ($\hat{\lambda}$) | Comparison with SC and DID | Assumptions | Synthetic DID | Block Adoption (Assignment) | Incorporating Covariates (Residualization) | Why Use Covariates? | The Residualization Approach | Single Covariate Example | Multiple Covariates | Important Considerations for Residualization | Diagnostics | Inspecting Unit Weights | Pre-Treatment Fit Assessment | Placebo and RMSE Diagnostics | Comparing Diagnostics Across Estimators | Standard Errors and Inference | Placebo Method | Jackknife Method | Bootstrap Method | Comparison of SE Methods | Constructing Confidence Intervals | Multiple Estimators with panel_estimate() | Available Estimators | Running All Estimators | Interpreting the Results | Visualizing Estimator Comparison | Per-Period Treatment Effects | Decomposing Effects by Period | Visualizing Per-Period Effects | Staggered Adoptions | Best Practices and Practical Guidance | When to Use SynthDID vs. SC vs. DID | Reporting Guidelines | Common Pitfalls | Comprehensive Visualization Suite for Synthetic DID | Treated vs. Synthetic Control Trajectory | Unit and Time Weights | Estimator Comparison | RMSPE Ratio: Placebo Inference | Staggered Adoption: ATE Across Cohorts | Extended Visualization Suite | Gap Plot with In-Space Placebos | Treatment Calendar: Staggered Adoption Timing | Staggered Adoption Summary Table | Trajectory Plot: Observed vs. Synthetic with Shaded Treatment Window | Unit Weight Bar Chart (Top Donors) | Time Weight Bar Chart | Estimator Comparison with Confidence Intervals | Inference Methods Deep Dive | Overview of Inference Approaches | Placebo (In-Space) Standard Errors | Jackknife Standard Errors | Bootstrap Standard Errors | Comparing All Three SE Methods | RMSPE Ratio Test: Permutation Inference | Staggered Adoption: A Complete Workflow | Setting Up the Staggered Data | Cohort Structure Visualization | Per-Cohort SDID Estimates | Comparing Staggered SDID vs. DID vs. SC | Covariates in SynthDID: Residualization and Balance | Why Residualize? | Step-by-Step Residualization | Covariate Balance Before and After Weighting | Multiple Treated Units | Setup with Multiple Treated Units | Aggregate and Per-Unit Estimates | Using panel_estimate() for Multiple Estimators | Per-Unit Standard Errors | Sensitivity Analysis: Leave-One-Out Donors | Leave-One-Out Estimation | Visualizing LOO Sensitivity | LOO Gap Plot for Key Donors | Publication Pipeline: End-to-End Example | Step 1: Data Description and Balance | Step 2: Run All Estimators | Step 3: Extract and Tidy the SynthDID Estimate | Step 4: Publication Table via causal_table() | Step 5: Final Reporting Summary | References

Last update: 2026-08-12
Started: 2024-01-12

Difference-in-Differences
Assumptions | Treatment Variation Plot | Pre-treatment Parallel Trends | plot_par_trends | plot_coef_par_trends | Random Treatment Assignments | Random Time Assignment | Random Unit Assignment | DID with in and out treatment status | Plots | Balance Scatter | Balance Trends over Pre-treatment Periods | Estimation | Staggered DID | Additional Analyses | DID Plot | State-of-the-Art DID Methods | Callaway and Sant'Anna (2021) with did | de Chaisemartin and D'Haultfoeuille (2020) with DIDmultiplegt | Honest DiD (Rambachan and Roth, 2023) | did2s: Two-Stage DID (Gardner, 2022) | Doubly Robust DID with DRDID | References | Modern DID Approaches | Callaway and Sant'Anna (2021) - Group-Time ATTs | de Chaisemartin and D'Haultfoeuille (2020) | Gardner (2022) Two-Stage DID with did2s | Imputation Estimator (Borusyak, Jaravel, Spiess 2024) | Sensitivity Analysis for Parallel Trends with HonestDiD | Choosing Among Modern DID Estimators | Side-by-Side Comparison: TWFE vs. Sun-Abraham on Staggered Data | Bacon Decomposition with bacondecomp | TWFE Diagnostic Weights with TwoWayFEWeights | Fast Staggered DID with fastdid | Fixed Effects Counterfactual with fect | Panel Data Visualization with panelView | DIDHAD - Heterogeneous Adoption Designs | Staggered Treatment Timing with staggered | Visualization Suite for DiD | Simulating a Rich Staggered Dataset | Treatment Effect Distribution (Unit-Level ATTs) | Event Study with Bonferroni-Corrected Simultaneous Confidence Bands | Cohort-Specific Treatment Effect Plots | Parallel Trends Visualization with Multiple Control Units | Counterfactual Trajectory Plot | Two-Way Mundlak (Correlated Random Effects) as DiD Alternative | The Mundlak Device | Sensitivity to Control Group Selection | Complete Publication-Ready DiD Pipeline | Step 1: Balance Check (Pre-Treatment Covariate Comparability) | Step 2: Pre-Trend Test (Formal Joint Wald Test) | Step 3: Main Estimates with Multiple Estimators | Step 4: Placebo Test via Randomised Cohort Assignment | Step 5: Robustness to Outcome Transformation | Step 6: Publication-Ready Coefficient Plot (All Specifications) | Minimum Requirements Checklist for Top-Journal Submission | HonestDiD - Sensitivity to Parallel Trends Violations (Rambachan & Roth 2023) | The HonestDiD Framework | Why Pre-Trend Tests Are Misleading | Implementation with fixest and HonestDiD | Event Study Regression | Extracting Coefficients for HonestDiD | Smoothness Restriction Sensitivity Analysis | Breakdown M: Smallest Violation That Breaks Significance | Relative Magnitudes Restriction | Callaway-Sant'Anna with Pre-Trend Test Integration | Stacked DiD with HonestDiD | Running Stacked DiD with causalverse | Applying HonestDiD to Stacked Estimates | Extended Parallel Trends Diagnostics Battery | Step 1: Pre-Trend F-Test | Step 2: Pre-Trend Power Analysis | Step 3: Plausibility-Weighted Pre-Trend Test (Roth 2022) | Step 4: Granger-Type Test (Does Past Treatment Predict Current Outcome?) | Step 5: Placebo / Permutation Test | Step 6: Density Test - Pre-Treatment Slope Balance | Summary Diagnostics Dashboard | Additional References (HonestDiD and Diagnostics)

Last update: 2026-08-12
Started: 2024-01-12

Instrumental Variables
Introduction | The Endogeneity Problem | Omitted Variable Bias (OVB) | Simultaneity (Reverse Causality) | Measurement Error | The IV Solution | Potential Outcomes Framework for IV | The LATE Interpretation | Core Assumptions | 1. Relevance (First Stage) | 2. Exclusion Restriction | 3. Independence (Exogeneity) | 4. Monotonicity | Mathematical Notation for 2SLS | Simulated IV Data | OLS vs. IV: Demonstrating the Bias | OLS Estimation (Biased) | 2SLS Estimation (Consistent) | Comparison Table | 2SLS with fixest | Basic Syntax | Multiple Instruments | Fixed Effects + IV | First-Stage F-statistic with fitstat() | Wu-Hausman Test | Clustered Standard Errors | Multiple Estimations | ivreg Package | First-Stage Diagnostics | First-Stage Regression | F-Statistic and the Rule of Thumb | Partial R-Squared | Visualization of the First Stage | Stock-Yogo Critical Values | Weak Instruments | The Problem | Anderson-Rubin Confidence Sets | The tF Procedure (Lee et al. 2022) | Implementing the tF Procedure | Over-identification Tests | The Sargan-Hansen J Test | When to Use Multiple Instruments | Sensitivity Analysis with sensemakr | Basic Sensitivity Analysis | Contour Plots | Benchmarking | Application to the IV Context | IV with Panel Data | Fixed Effects IV | First-Differenced IV | Shift-Share (Bartik) Instruments | Structure | Identification | Practical Considerations | Judge/Examiner IV Designs | Key Assumptions | Recent Methodological Advances | Visualizing IV | First-Stage Scatter | Reduced-Form Scatter | OLS vs. IV Coefficient Comparison | Binned Scatter Plot for First Stage | LIML, Fuller, and K-Class Estimators | The K-Class Family | Implementation with ivmodel | Comprehensive IV Diagnostics with ivDiag | The Effective F-Statistic | Implementation with ivDiag | LASSO-Selected Instruments and Many Instruments | The Many-Instruments Problem | Implementation with hdm | Jackknife Instrumental Variables (JIVE) | Leave-One-Out First Stage | Implementation with SteinIV | Marginal Treatment Effects (MTE) | The MTE Framework | Implementation with ivmte | Control Function Approach | Two-Stage Residual Inclusion | Manual Implementation with fixest | Internal Instruments: Heteroskedasticity-Based and Copula Methods | When No External Instrument Is Available | Implementation with REndo | Partial Identification and Bounds | When the Exclusion Restriction is Imperfect | Manual Implementation: Sensitivity to Exclusion Restriction Violations | Nonparametric IV Estimation | Beyond Linearity | Implementation with npiv | Randomization Inference for IV | Finite-Sample Valid P-Values | Manual Implementation | Regression Kink Design | Exploiting Kinks in Policy Rules | Implementation with rdrobust | Mendelian Randomization | Genetic Variants as Instruments | Practical Guidelines | Before Estimation | During Estimation | Robustness Checks | Reporting | 22. Comprehensive Visualization Suite for IV | 22.1 First-Stage Visualization | 22.2 IV vs OLS Comparison Plot | 22.3 Weak Instrument Diagnostics Plot | 22.4 IV Sensitivity Analysis: Exclusion Restriction | 22.5 Anderson-Rubin Weak-IV Robust Confidence Intervals | 22.6 Shift-Share (Bartik) Instrument Diagnostics | 22.7 LATE Heterogeneity: Who are the Compliers? | 22.8 Complete IV Publication Pipeline | References | Mendelian Randomization (Genomic IVs) | The Three MR Assumptions | Summary-Level MR: IVW, Egger, and Weighted Median | Egger Intercept as a Pleiotropy Test | Local Average Structural Function (LASF) and Heterogeneous LATE | The Complier Population | Characterizing Compliers | Local Average Response Function | Bartik Instruments in Depth (Shift-Share IV) | Identification Conditions: Two Views | Rotemberg Weights and Industry Concentration | Sensitivity: Drop Top Industry | Many-Weak Instruments and LIML | The Many-IV Problem | IV with Heterogeneous Effects: Marginal Treatment Effects (Heckman-Vytlacil) | From MTE to Standard Parameters | Policy-Relevant Treatment Effects (PRTE) | The ivmte Package for MTE Estimation | Additional References (MR, Bartik, Many-IV, MTE)

Last update: 2026-08-12
Started: 2026-03-18

Matching Methods
1. Introduction | 1.1 The Fundamental Problem and Why Matching Helps | 1.2 Selection on Observables | Conditional Independence Assumption (CIA) | Common Support (Overlap) Condition | 1.3 The Curse of Dimensionality | 1.4 ATT vs. ATE | 1.5 Mathematical Framework for Matching Estimators | Nearest-Neighbor Matching | Propensity Score Matching | Inverse Probability Weighting (IPW) | Subclassification (Stratification) | 2. Simulated Data | 3. Balance Assessment with causalverse | 3.1 balance_assessment(): SUR and Hotelling's T-Test | 3.2 plot_density_by_treatment(): Density Plots | 3.3 balance_scatter_custom(): Standardized Mean Difference Scatter Plot | 3.4 plot_covariate_balance_pretrend(): Balance Over Time | 4. The MatchIt Package | 4.1 Nearest Neighbor Matching | 4.2 Optimal Matching | 4.3 Full Matching | 4.4 Coarsened Exact Matching (CEM) | 4.5 Subclassification | 4.6 Propensity Score Matching (Detailed) | 4.7 Mahalanobis Distance Matching | 4.8 Estimation After Matching | 5. The cobalt Package: Balance Assessment | 5.1 Balance Tables with bal.tab() | 5.2 Love Plots with love.plot() | 5.3 Distributional Balance with bal.plot() | 6. The WeightIt Package: Propensity Score Weighting | 6.1 Basic Usage | 6.2 Entropy Balancing | 6.3 Covariate Balancing Propensity Score (CBPS) | 6.4 Energy Balancing | 6.5 Estimation After Weighting | 7. Propensity Score Methods in Detail | 7.1 Propensity Score Estimation | 7.2 Propensity Score Matching | 7.3 Propensity Score Weighting (IPW / IPTW) | 7.4 Propensity Score Stratification | 7.5 Trimming and Truncation | 7.6 Common Support Assessment | 8. Coarsened Exact Matching (CEM) in Depth | 8.1 How CEM Works | 8.2 Estimation After CEM | 9. Entropy Balancing | 9.1 Theory | 9.2 Implementation | 9.3 Checking Balance After Entropy Balancing | 10. Panel Data Matching with PanelMatch | 10.1 How PanelMatch Differs from Cross-Sectional Matching | 10.2 Balance Assessment for PanelMatch | 11. Sensitivity Analysis | 11.1 Rosenbaum Bounds | 11.2 Sensitivity Analysis with sensemakr | 12. Doubly Robust Estimation | 12.1 Motivation | 12.2 The Augmented IPW Estimator | 12.3 Implementation Strategies | 13. Propensity Score Weighting with PSweight | 13.1 Overlap Weights for Binary Treatment | 13.2 Treatment Effect Estimation and Trimming | 13.3 Multiple Treatments | 14. GBM-based Propensity Scores with twang | 14.1 Estimating Propensity Scores with GBM | 14.2 Balance Diagnostics | 14.3 Using GBM Weights for Outcome Analysis | 15. Optimal Matching with Constraints using designmatch | 15.1 Cardinality Matching | 15.2 Profile Matching with bmatch | 16. Matching with Clustered Data using CMatching | 16.1 Within-Cluster Propensity Score Matching | 16.2 Balance Assessment for Clustered Matching | 17. Matching with Multiple Imputation using MatchThem | 17.1 Matching Across Imputed Datasets | 17.2 Weighting Across Imputed Datasets | 18. CBPS: Covariate Balancing Propensity Score | 18.1 Basic CBPS Estimation | 18.2 Balance Diagnostics for CBPS | 19. Practical Guidelines | 19.1 Choosing a Matching Method | 19.2 Diagnostics Checklist | 19.3 Common Pitfalls | 19.4 Recommended Workflow | 20. Comprehensive Visualization Suite for Matching | 20.1 Data Setup with LaLonde | 20.2 Love Plot Using causalverse::love_plot() | 20.3 Distributional Plots Before and After Matching | 20.4 Propensity Score Distribution with Overlap Weights | 20.5 Caliper Sensitivity Plot (ATT vs. Caliper Width) | 20.6 Balance Improvement over Matching Ratio (1:1, 1:2, 1:3) | 21. Trimming and Overlap | 21.1 Crump et al. (2009) Optimal Trimming Rule | 21.2 Overlap Weights Comparison with IPW and Matching | 22. Sensitivity Analysis for Matching | 22.1 Rosenbaum Bounds (Gamma Sensitivity Analysis) | 22.2 E-Values for Matched Estimates | 22.3 Placebo Tests for Matching | 22.4 Comprehensive Sensitivity Summary Table | 23. References | Genetic Matching (Sekhon 2011) | Motivation: Going Beyond Propensity Score Weights | Key Properties | Comparison: Propensity Score Matching vs. Genetic Matching | Coarsened Exact Matching (CEM): A Deep Dive | The CEM Idea | Sensitivity to Coarsening Choice | Entropy Balancing (Hainmueller 2012) | The Entropy Balancing Idea | Higher-Order Entropy Balancing | Matching Quality: Distribution Tests | Beyond Mean Balance | Energy Distance | Variance Ratio Plot | Additional References (Advanced Matching)

Last update: 2026-08-12
Started: 2026-03-18

Readme and manuals

Help Manual

Help pageTopics
Function to export a figure with custom settingsama_export_fig
Function to export a table with AMA styleama_export_tab
Custom Label Formatting for ggplot2: American Marketing Association Styleama_labs
Custom Color Scale for ggplot2: American Marketing Association Styleama_scale_color
Custom Fill Scale for ggplot2: American Marketing Association Styleama_scale_fill
Custom Theme for ggplot2: American Marketing Association Styleama_theme
Attrition Analysis for Experimental & Panel Dataattrition_analysis
Plot Bacon Decomposition of TWFE Estimatesbacon_decomp_plot
Assess balance between treated and control groupsbalance_assessment
Comprehensive Balance Plot Suitebalance_plot
Custom function to visualize the balance between treatment and control groupsbalance_scatter_custom
Publication-Ready Covariate Balance Tablebalance_table
Best Linear Predictor (BLP) Analysis for Conditional Average Treatment Effectsblp_analysis
Comprehensive Summary of Causal Forest Resultscausal_forest_summary
Unified Causal Model Summarycausal_summary
Publication-Ready Causal Inference Results Tablecausal_table
List Available Backend Packages and Their Statuscheck_backends
Universal Coefficient Plotcoef_plot
Compare Causal Estimators in a Formatted Tablecompare_estimators
Sensitivity Analysis for Omitted Variable Bias (E-value & RV)confounding_strength
Comprehensive Covariate Summary Table (Table 1)covariate_summary
List Adjustment Sets for a DAGdag_adjustment_sets
Quick Causal DAG Visualizationdag_plot
Test Conditional Independence Implied by a DAGdag_test_implications
Enhanced Event Study Plot for Difference-in-Differencesdid_event_study
Power Analysis for Difference-in-Differences Designsdid_power_analysis
Dose-Response Estimation for Continuous Treatmentsdose_response
Dose-Response Curve for Continuous Treatmentdose_response_curve
Doubly-Robust Augmented IPW Estimator for the ATE and ATTdr_ate
Convert Between Causal Effect Size Metricseffect_size_convert
Equivalence Test That Treatment Did Not Shift a Variableequivalence_shift
Compute Abnormal Returns and CARs for Finance Event Studiesevent_study_finance
Export a Figure to a Journal's Specificationsexport_fig
Export a Table to a Journal's Specificationsexport_tab
Extract a Balanced Panelget_balanced_panel
Heterogeneity Forest Plotheterogeneity_forest_plot
Treatment Effect Heterogeneity Visualizationheterogeneity_plot
Install Backend Packages for Causal Inference Methodsinstall_backends
Instrumental Variable Diagnostic Summaryiv_diagnostic_summary
Instrumental Variables Diagnosticsiv_diagnostics
Sensitivity Analysis for Instrumental Variables: Exclusion Restrictioniv_sensitivity
Check a Figure or Table Against a Journal's Formatting Rulesjournal_check
List the Journals with Known Formatting Stylesjournal_list
Grayscale-Safe Colour Palette for a Journaljournal_palette
Official Guideline Sources Behind Each Journal Stylejournal_sources
Journal Formatting Styles for Tables and Figuresjournal_style
Build a Regression or Summary Table in a Journal's Stylejournal_table
Summarize Lee Bounds for Always-Takerslee_bounds
Love Plot for Covariate Balance Visualizationlove_plot
Minimum Detectable Effect (MDE) Calculatormde_calc
Estimate Mediation Indirect Effectsmed_ind
Causal Mediation Analysis with ACME and ADE Estimationmediation_analysis
Multiverse / Specification Curve Analysismultiverse_analysis
Nice Tabulation Functionnice_tab
Overlap Weights and Trimming for Propensity Score Analysisoverlap_weights
Panel Data Diagnostic Testspanel_diagnostics
Panel Estimate Functionpanel_estimate
Parallel Trends Plot for DiDparallel_trends_plot
Randomization Inference and Placebo Tests for Treatment Effectsplacebo_test
Compare Treatment Effect Estimates Across Modelsplot_coef_comparison
Plot Coefficients of Parallel Trendsplot_coef_par_trends
Plot Covariate Balance Over Pre-Treatment Periodplot_covariate_balance_pretrend
Plot Density by Treatmentplot_density_by_treatment
Plot Event Study Coefficients from Multiple Estimatorsplot_event_coefs
Plot Estimated Effects of Treatment Over Timeplot_PanelEstimate plot_panel_estimate
Plot Parallel Trendsplot_par_trends
Propensity Score Overlap Diagnostic Plotplot_pscore_overlap
Plot RD Always-assigned Shareplot_rd_aa_share
Plot number of treated units over time or return a dataframe.plot_treat_time
Custom Faceted Line Plot with Optional Standard Errorplot_trends_across_group
Monte Carlo Power Simulation for Causal Designspower_sim
Pre-trend Sensitivity Analysis (HonestDiD)pretrend_sensitivity
Process Panel Estimateprocess_panel_estimate
Propensity Score Diagnostics Panelpropensity_diagnostics
Qini Curve and AUUC for Uplift / Policy Evaluationqini_curve
Comprehensive RD Assumption Testsrd_assumption_tests
RD Bandwidth Sensitivity Analysisrd_bandwidth_sensitivity
Binned Scatter Plot for RD Analysisrd_binscatter
RD Covariate Balance Testrd_covariate_balance
RD Placebo Cutoff Testrd_placebo_cutoffs
Publication-Ready Regression Discontinuity Plotrd_plot
Bounds on a Treatment-by-Moderator Interaction Under Priming or Post-Treatment Biasrole_bounds
Monte Carlo Comparison of Rules for Classifying a Third Variablerole_simulation
Is a Third Variable a Moderator, a Mediator, Both, or Neither?role_test
Gap Plot for Synthetic Control Analysissc_gap_plot
Synthetic Control Gaps and Inference Plotsc_inference_plot
Colour and Fill Scales Following a Journal's Figure Rulesscale_color_journal scale_colour_journal scale_fill_journal
Plot Treatment Effect Sensitivity to Unobserved Confoundingsensitivity_plot
Randomization Test That Treatment Left a Variable Unchangedshift_test
Simulate Experiments With a Known Third-Variable Rolesimulate_role_data
Specification Curve Analysisspec_curve
Stacked Data for Staggered DiD Analysisstack_data
Stacked Difference-in-Differencesstacked_did
Summarize Staggered Adoption Panel Designsstaggered_summary
Synthetic DID Estimation Using synthdid Packagesynthdid_est
Estimate the SynthDiD ATEs and Standard Errorssynthdid_est_ate
Estimate Treatment Effects for Each Periodsynthdid_est_per
Create ATE Plot Using ggplot2synthdid_plot_ate
Calculate Jackknife Standard Errors for Synthetic DIDsynthdid_se_jacknife
Calculate Placebo Standard Errors for Synthetic DIDsynthdid_se_placebo
Unified Pre-Trends Testing for Event Study Modelstest_pretrends
ggplot2 Theme for a Journal's Figure Rulestheme_journal
Tidy Output from Causal Inference Model Objectstidy_causal
Treatment Calendar Heatmap for Staggered Adoption Designstreatment_calendar