BookmarkSubscribeRSS Feed

Using the StatRep Package for LaTeX

Started Friday by
Modified Friday by
Views 87
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).

Version history
Last update:
Friday
Updated by:

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags