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
If you are going to talk about rreport, you should, at some point, highlight Sweave, which is what rreport is based on, as well as Frank's other highly useful package for literate programming, Hmisc.
Posted by: Abhijit Dasgupta | March 11, 2010 at 11:52
In that context, the R-package "reporttools" may also be helpful:
http://www.jstatsoft.org/v31/c01
It is aimed at displaying descriptive statistics of continuous, nominal and date variables.
Posted by: Kaspar Rufibach | March 12, 2010 at 06:55
Is anyone having difficulty downloading this from cvs at Vanderbilt? I keep getting a connection timed out message.
Posted by: Patrick | March 12, 2010 at 13:19
It is worth mentioning there is now an excellent (almost) WYSIG front end for LaTeX called LyX. Cross platform and works very nicely, I used for my last PhUSE paper on SAS 9.2 graphics. (PDF of paper is not up yet but should be soon).
So this gives you an easy way to edit LaTeX. (ie with all the tags hidden) so you can concentrate on your writing.
Posted by: DaveG | April 19, 2010 at 14:19
Use R-studio and knitr for this. It makes it a lot easier. All free of course.
Posted by: Rasmus Larsen | April 24, 2013 at 06:58