Stata 18 is a major statistical software release that continues StataCorp’s long-standing focus on providing a unified environment for data management, statistical analysis, graphics, and reproducible research. Designed for researchers across economics, epidemiology, biostatistics, social sciences, and public policy, Stata 18 expands functionality, improves performance, and introduces new tools that simplify complex workflows.
Stata’s built-in Do-file Editor has been modernized to compete with RStudio and VS Code. Stata 18
Stata 18 also introduces Project (.stprj) files, which bundle all datasets, do-files, logs, and outputs into a single workspace, making collaboration far easier. Stata 18 is a major statistical software release
* At top of every do-file
version 18
clear all
set more off
set linesize 80
* Set working directory relative to do-file (requires do-file location)
cd `c(pwd)'
Yes, but computationally intensive tasks like Bayesian MCMC will be slow. For large projects, 16 GB of RAM and an SSD are strongly recommended. Stata 18 also introduces Project (
For high-dimensional control variable selection, pdslasso implements the Belloni, Chernozhukov, and Hansen (2014) method. It uses Lasso to select relevant controls from a large set and then performs valid inference on a single treatment variable—perfect for situations with more potential confounders than observations.
Previously, fitting a Bayesian hierarchical model required third-party software or complex coding. Now, Stata 18 introduces bayes: meglm for multilevel generalized linear models. This allows you to incorporate random intercepts and slopes with full posterior sampling.
Example use case: A public health researcher analyzing patient outcomes across 200 hospitals can now model hospital-level random effects with credible intervals that are far more intuitive than classical confidence intervals.