In this article, I introduce markstat, a command for combining Stata code and output with comments and annotations written in Markdown into a beautiful webpage or PDF file, thus encouraging literate programming and reproducible research. The command tangles the input separating Stata and Markdown code, runs the Stata code, relies on Pandoc to process the Markdown code, and then weaves the outputs into a single file. HTML documents may include inline and display math using MathJax. Generating PDF output requires access to LATEX and a style file from Stata but works with the same input file.
BarbaL. A.2016. The hard road to reproducibility. Science354: 142.
3.
GallupJ. L.1999. outreg: Stata module to write estimation tables to a Word or TEX file. Statistical Software Components S375201, Department of Economics, Boston College. https://ideas.repec.org/c/boc/bocode/s375201.html.
4.
GandrudC.2015. Reproducible Research with R and RStudio. 2nd ed. Boca Raton, FL: Chapman & Hall/CRC.
JannB.2005. Making regression tables from stored estimates. Stata Journal5: 288–308.
9.
JannB.2007. Making regression tables simplified. Stata Journal7: 227–244.
10.
JannB.2016a. webdoc: Stata module to create a HTML or Markdown document including Stata output. Statistical Software Components S375201, Department of Economics, Boston College. http://ideas.repec.org/c/boc/bocode/s458209.html.
11.
JannB.2016b. Creating LATEX documents from within Stata using texdoc. Stata Journal16: 245–263.
LeischF.2002. Sweave: Dynamic generation of statistical reports using literate data analysis. In COMPSTAT 2002, ed. HärdleW., and RönzB., 575–580. Physica Verlag: Heidelberg.
PengR. D.2009. Reproducible research and Biostatistics. Biostatistics10: 405–408.
16.
QuintóL., SanzS., De LazzariE., and AponteJ. J.2012. HTML output in Stata. Stata Journal12: 702–717.
17.
RisingW.2016. Dynamic documents in Stata: Many routes to the same goal. 2016 Oceania Stata Users Group meeting proceedings. University of Sydney. http://www.sugm.net.au/docs/papers2016/Rising.pdf.
18.
RodríguezG.2017a. bundle: Stata module to bundle image files in a web page using base64 encoding. Statistical Software Components S458317, Department of Economics, Boston College. https://ideas.repec.org/c/boc/bocode/s458317.html.
19.
RodríguezG.2017b. whereis: Stata module to keep track of ancillary programs and files. Statistical Software Components S458303, Department of Economics, Boston College. https://ideas.repec.org/c/boc/bocode/s458303.html.
20.
RossiniA. J.2001. Literate statistical practice. In Proceedings of the 2nd International Workshop on Distributed Statistical Computing.Vienna, Austria: DSC.
21.
WadaR.2005. outreg2: Stata module to arrange regression outputs into an illustrative table. Statistical Software Components S456416, Department of Economics, Boston College. https://ideas.repec.org/c/boc/bocode/s456416.html.