Online Program

Return to main conference page

All Times EDT

Friday, June 5
Practice and Applications
Practice and Applications Posters, Part 2
Fri, Jun 5, 2:00 PM - 5:00 PM
TBD
 

An R Markdown Template for CMS Statistical Reports: The Labyrinth of R Markdown and Microsoft Word (308491)

*Carina Spicer, Merck 

Keywords: R Markdown

In the Center for Mathematical Sciences (CMS) in Merck’s Manufacturing Division (MMD), most statistical analyses are documented by a formal Word document report according to a standardized template. In the creation of this report, tables and figures are typically copied from statistical software, such as R, and pasted into the Word document, creating potential for user error. In addition, each report undergoes a second scientist review (SSR) process where a second statistician reviews the report contents and attempts to match the values in the written report with the lengthy outputs of statistical software. Matching the output with the report contents can be a time-intensive task for a reviewer, with a high level of variability in code organization and ease of understanding between statisticians.

I have created a template in R Markdown to generate the Word document report directly from the script for the statistical analysis. By defining the report properties and text styles in a reference template document passed to the script, this ensures the Word document produced by R Markdown is consistent with the standardized CMS report template. This eliminates the potential for human error in copying-and-pasting, as the statistical output is immediately written to the statistical report. As the report text and code are intuitively organized in the R Markdown script in the same order as they appear in the report, this drastically simplifies the time and labor for an SSR. In addition, the employment of inline code in the text sections of the report allows for statistical values to be seamlessly updated as the analysis data set changes. This process for automating the generation of statistical reports introduces a high level of reproducibility and consistency into the reporting process and minimizes the potential for human error.