# Towards reproducible econometric research: the Sweave framework

Towards reproducible econometric research: the Sweave framework 1. OVERVIEW The Sweave package for the R and S‐plus statistical computing environments enables the user to construct a single file which includes both the code to be run in R/S‐plus and the $\def\TeX{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\TeX$ / $\font\smc=cmr10 scaled 0700\def\sc#1{\hbox{\smc #1}}\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\LaTeX$ code comprising the text of the document. Files containing both types of code are referred to as .Rnw/.Snw files. The various sections (‘chunks’) of R/S‐plus and $\def\TeX{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\TeX$ / $\font\smc=cmr10 scaled 0700\def\sc#1{\hbox{\smc #1}}\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\LaTeX$ code are included in the file in the order in which they are to be employed in the final document. Sweave then weaves together the code chunks to produce a .tex file that may be compiled using $\def\TeX{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\TeX$ / $\font\smc=cmr10 scaled 0700\def\sc#1{\hbox{\smc #1}}\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\LaTeX$ . By using Sweave , an individual can create a dynamic document (Gentleman and Lang, 2004 ) which includes both the statistical analysis and the methods by which the output underlying the analysis is obtained. This process sidesteps a major source of research errors, namely, the misreporting of computer output. Sweave was developed by Friedrich Leisch and is written in the S language. 1 A directory containing the manual (Leisch, 2006 ), http://www.deepdyve.com/assets/images/DeepDyve-Logo-lg.png Journal of Applied Econometrics Wiley

# Towards reproducible econometric research: the Sweave framework

Journal of Applied Econometrics, Volume 24 (2) – Mar 1, 2009
9 pages

/lp/wiley/towards-reproducible-econometric-research-the-sweave-framework-CiTUrHAX0b
Publisher
Wiley
ISSN
0883-7252
eISSN
1099-1255
D.O.I.
10.1002/jae.1030
Publisher site
See Article on Publisher Site

### Abstract

1. OVERVIEW The Sweave package for the R and S‐plus statistical computing environments enables the user to construct a single file which includes both the code to be run in R/S‐plus and the $\def\TeX{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\TeX$ / $\font\smc=cmr10 scaled 0700\def\sc#1{\hbox{\smc #1}}\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\LaTeX$ code comprising the text of the document. Files containing both types of code are referred to as .Rnw/.Snw files. The various sections (‘chunks’) of R/S‐plus and $\def\TeX{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\TeX$ / $\font\smc=cmr10 scaled 0700\def\sc#1{\hbox{\smc #1}}\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\LaTeX$ code are included in the file in the order in which they are to be employed in the final document. Sweave then weaves together the code chunks to produce a .tex file that may be compiled using $\def\TeX{{\rm T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\TeX$ / $\font\smc=cmr10 scaled 0700\def\sc#1{\hbox{\smc #1}}\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{\sc A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}\LaTeX$ . By using Sweave , an individual can create a dynamic document (Gentleman and Lang, 2004 ) which includes both the statistical analysis and the methods by which the output underlying the analysis is obtained. This process sidesteps a major source of research errors, namely, the misreporting of computer output. Sweave was developed by Friedrich Leisch and is written in the S language. 1 A directory containing the manual (Leisch, 2006 ),

### Journal

Journal of Applied EconometricsWiley

Published: Mar 1, 2009

## You’re reading a free preview. Subscribe to read the entire article.

### DeepDyve is your personal research library

It’s your single place to instantly
that matters to you.

over 18 million articles from more than
15,000 peer-reviewed journals.

All for just $49/month ### Explore the DeepDyve Library ### Search Query the DeepDyve database, plus search all of PubMed and Google Scholar seamlessly ### Organize Save any article or search result from DeepDyve, PubMed, and Google Scholar... all in one place. ### Access Get unlimited, online access to over 18 million full-text articles from more than 15,000 scientific journals. ### Your journals are on DeepDyve Read from thousands of the leading scholarly journals from SpringerNature, Elsevier, Wiley-Blackwell, Oxford University Press and more. All the latest content is available, no embargo periods. DeepDyve ### Freelancer DeepDyve ### Pro Price FREE$49/month
\$360/year

Save searches from
PubMed

Create lists to

Export lists, citations