The StatRep package is an open‑source system designed to support reproducible research using SAS and LaTeX. It addresses one of the most persistent challenges in analytical publishing: ensuring that reported results are generated directly from the code that produces them. By combining LaTeX typesetting with SAS execution, StatRep enables analysts to create documents where code, output, and narrative remain tightly synchronized.
What StatRep Does and How It’s Used
At a high level, StatRep lets you write a single LaTeX document that contains both your analysis narrative and your SAS code. When the document is compiled, StatRep automatically generates a SAS program that executes the embedded code and captures results using the SAS Output Delivery System (ODS). These results—tables, listings, graphics, and even log output—are written to external files and then pulled back into the LaTeX document during a subsequent compilation pass. This workflow ensures that every figure and table in the final PDF is produced directly from the code shown in the document. Changes to data or analysis logic are made in one place, and regenerated outputs are automatically reflected in the final report. The result is a repeatable, transparent workflow suitable for technical papers, regulatory documentation, and long‑lived analytical reports.
Documentation and Source Code
For complete details, including installation instructions, configuration options, and advanced customization techniques, refer to The StatRep System for Reproducible Research: User’s Guide and Reference Manual (original attached to this article, but see references below for the latest updates). The StatRep package, including the LaTeX files, SAS macros, and examples, is maintained as an open‑source project on GitHub.
You can find the StatRep package with the most recent enhancements here:
This contains contributions from Martial Phélippé-Guinvarc'h ( @MartialPhelippe ), building on the work from the original authors, Tim Arnold and Warren Kuhfeld (now retired from SAS).