Stata Packages for Research

January 12, 2026 ยท View on GitHub

DOI License: MIT

A collection of Stata packages for research, data analysis, and visualization. Developed and maintained by Benjamin Daniels.

View Full Documentation

Installation

Install any package directly from this repository using Stata's net install:

net install packagename, from("https://raw.githubusercontent.com/bbdaniels/stata/main/")

For example:

net install forest, from("https://raw.githubusercontent.com/bbdaniels/stata/main/")

Package Categories

Visualization

PackageDescription
betterbarBar graphs with standard error bars and cross-group comparisons
forestForest plots visualizing results from multiple regressions
bstrappolyBootstrapped confidence intervals for local polynomial regression

Regression & Analysis

PackageDescription
outwriteExport regression results to Excel, CSV, or LaTeX
crossfoldK-fold cross-validation for model evaluation
manskiManski bounds for selection bias
rctregRCT regression tables with treatment/control means
easyirtEasy Item Response Theory estimation
speccSpecification curve analysis automation
bivregBivariate regression tables
reftabSummary statistics and regression results by category

Summary Statistics & Tables

PackageDescription
sumstatsSummary statistics tables with conditional restrictions
tabstatoutSummary statistics tables with export capability
weightabWeighted cross-group comparison tables
statflowDynamic flowcharts and tables in Excel

Data Management

PackageDescription
freeshapeFlexible reshape without numbered variable stubs
labelcollapseCollapse data while preserving variable labels
makeidGenerate unique hierarchical IDs
tabgenSplit categorical variables into labeled binaries
rencodeEncode string variables in place
strpropCase formatting for string variables
dayofweekGenerate labeled day-of-week variables
anycatCreate indicators from categorical variable sets
multicatCompile indicators into descriptive strings

Specialized Tools

PackageDescription
knapsack0/1 Knapsack Problem solver
txt2qrGenerate QR codes from text
dta2kmlExport data to KML for geographic visualization
devkitDeveloper toolkit with utility functions

Citation

If you use these packages in your research, please cite:

@software{daniels_stata_packages,
  author       = {Benjamin Daniels},
  title        = {Stata Packages for Research},
  year         = {2024},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.6263355},
  url          = {https://doi.org/10.5281/zenodo.6263355}
}

Contributing

Contributions are welcome! Please see the Code of Conduct and submit issues or pull requests on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.