In the quest for reproducible research tools

Print Friendly, PDF & Email

Since most of what we do at the Census Bureau is done in SAS, having a tool to combine \LaTeX and SAS is very useful:

http://support.sas.com/rnd/app/papers/statrep.html

In essence,

  1. Download the zip package, and extract statrep_macros.sas, statrep_tagset.sas, longfigure.sty, statrep.sty
  2. Put these files into your \LaTeX paper directory
  3. Write your \LaTeX document, and insert the SAS code you need between
    \begin{Datastep}
    \end{Datastep}
    

    and

    \begin{Sascode}
    \end{Sascode}
    
  4. Reference your output and graphics with \Listing and \Graphic references.
  5. Compile your \LaTeX document
  6. Run the SAS code that was generated
  7. Compile your \LaTeX document again (2x, 3x,…)
  8. Done.

For easy reference, the manual that is distributed with the CTAN package or the SAS package (they are the same) is embedded below. (Original version here)

#LaTeX#Reproducible research#SAS