Clinical Reporting with R

March 11, 2010

(This article was first published on Revolutions, and kindly contributed to R-bloggers)

One of the main goals of analyzing clinical data is to produce a report. (What, you thought it was to make the world a better place?) The R Project has, of course, all the tools you need to perform the statistical analysis, calculate the tables of results, and present conclusions graphically. But how can you assemble all of that into a report that someone can, you know, read?

You could go the cut-and-paste route: write the text in Word, export the data from R to format the tables in Excel, dress up the saved charts in Photoshop. But that’s a complex, manual process, and manual processes can introduce errors. Worse yet, if the data ever changes, you’ve got to go through the whole process again to update the report. That means no interim reports, and conversely, a big barrier to correcting the data and the report after it’s published.

Vanderbilt Biostatistics professor Frank Harrell has a different solution: the rreport package for R. (See an overview slide deck here.) It’s designed to produce statistical reports for clinical trials, and is especially useful for producing interim reports for data monitoring committees (DMCs). You can use it to create a complete report document, fully automating the process of generating tables from your R analyses like this:


and integrating R graphics into the document, like this:


The rreport system is an example of literate programming: the tables and reports are interwoven into the narrative text in a single source document in the open-source LaTeX typesetting language, and the entire report can be redone, with all results recalculated and all charts regenerated from the source data, in a single step. Using LaTeX does take some getting used to — it’s not a WYSIWYG environment like Word — but does make for very attractive reports and the ability to easily typeset the Greek-laden mathematical equations so prevalent in clinical trial reports. You can download rreport from the Vanderbilt CVS repository at the link below.

Department of Biostatistics, Vanderbilt University: rreport package

To leave a comment for the author, please follow the link and comment on their blog: Revolutions. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: ,

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Dommino data lab

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)