This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS Propensity Score Matching module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, mathematical derivations, and user guidance are provided separately in the official module documentation.
Any issues or updates required please comment here
Logistic regression of the binary treatment indicator on the selected covariates, via stats::glm(family = binomial)
Predictors
All user-selected qualitative and quantitative covariates entered additively (no interaction terms by default); the outcome variable is never included as a predictor
Distance measure
distance = "glm": the fitted propensity score itself (predicted probability of treatment) is used as the distance metric for matching
Variable requirements
Treatment column must have exactly two levels; rows with a covariate that is constant (a single level) across the whole sample cause the model fit to be rejected with an on-screen error
Matching
Method
User-selectable: nearest-neighbor (default), optimal, full, subclassification, exact, or coarsened exact matching, via MatchIt::matchit()
Ratio
1:1 matching (one control matched to each treated unit)
Caliper
Optional, user-specified between 0.1 and 0.5 (in standard-deviation units of the propensity score); when set, a treated unit is left unmatched rather than matched to a control outside the caliper. No caliper is applied if left blank
Balance
Assessment
Metric
Standardized mean difference (SMD) of each covariate between treated and control groups, computed before and after matching via summary.matchit()
Practical thresholds
|SMD| < 0.1: well balanced; 0.1-0.25: borderline; > 0.25: meaningfully imbalanced (the RA-One assistant and the app narrative apply these same thresholds)
Model
Diagnostics
Model fit
Log-likelihood, likelihood-ratio chi-square test, and McFadden's pseudo R-squared, reported for the propensity-score model both before matching (original fit) and after matching (the same model refit, weighted, on the matched sample)
Mean standardized bias
Mean of the absolute standardized mean differences across all covariates, reported before and after matching as a single summary diagnostic
Plots
Before/After distribution
Kernel density of the estimated propensity score by treatment group, before matching (from the fitted model) and after matching (on match.data())
Love plot, jitter plot, balance plot
Rendered directly from the MatchIt match object via cobalt::love.plot(), plot(m.out, type = "jitter"), and cobalt::bal.plot() respectively - no statistics are recomputed outside these functions
5 R Code for Key Analytical Steps
The code blocks below demonstrate the exact computation behind each reported result, using the built-in Organic_Adoption dataset bundled with the module (a farm-level observational dataset on organic-farming adoption, covariates, and yield).
5.1 Propensity-Score Model
dat <-read.csv("Organic_Adoption.csv")dat$Education <-as.factor(dat$Education)form <- Adoption ~ Farm_Size_ha + Rainfall_mm + Farmer_Age + Education + Extension_Contact + Credit_Accessps_mod <-glm(form, data = dat, family = binomial)
5.3 Covariate Balance (Standardized Mean Difference)
library(cobalt)bal <-summary(m.out)bal$sum.all[, "Std. Mean Diff."] # before matchingbal$sum.matched[, "Std. Mean Diff."] # after matchinglove.plot(m.out, stars ="std", abs =TRUE) # Love plotbal.plot(m.out, var.name ="distance", which ="both") # balance plot
library(broom); library(margins)broom::tidy(ps_mod) # coefficient, SE, p-value, odds ratio = exp(estimate)summary(margins::margins(ps_mod)) # average marginal effect of each covariate
RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.
7 Package References
R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/
Ho, D., Imai, K., King, G., & Stuart, E. (2011). MatchIt: Nonparametric Preprocessing for Parametric Causal Inference. Journal of Statistical Software, 42(8), 1-28. https://doi.org/10.18637/jss.v042.i08
Greifer, N. (2024). cobalt: Covariate Balance Tables and Plots (R package version 4.6.2). https://CRAN.R-project.org/package=cobalt
Rosenbaum, P. R., & Rubin, D. B. (1983). The Central Role of the Propensity Score in Observational Studies for Causal Effects. Biometrika, 70(1), 41-55. https://doi.org/10.1093/biomet/70.1.41