Graphical Reporting for Clinical Trials

Contains many functions useful for monitoring and reporting the results of clinical trials and other experiments in which treatments are compared. LaTeX is used to typeset the resulting reports, recommended to be in the context of 'knitr'. The 'Hmisc', 'ggplot2', and 'lattice' packages are used by 'greport' for high-level graphics.

Statisticians and statistical programmers spend a great deal of time analyzing data and producing reports for clinical trials, both for final trial reports and for interim reports for data monitoring committees. Point and Click interfaces and copy-and-paste are now believed to be bad models for reproducible research. Instead, there are advantages to developing a high-level language for producing common elements of reports related to accrual, exclusions, descriptive statistics, adverse events, time to event, and longitudinal data.

It is well appreciated in the statistical and graphics design communities that graphics are much better than tables for conveying numeric information. There are thus advantages for having statistical reports for clinical trials that are almost completely graphical. For those reviewers of clinical trial reports who insist on seeing tables, and for those who occasionally like to have tables to see "exact" figures for certain data elements, supporting tables can be placed in an appendix. These tables are hyperlinked to the main graphics. Small tables can also pop-up when one hovers the mouse over a graphic. These two approaches are facilitated by features of Adobe Acrobat Reader. Reviewers who prefer printed reports can print the appendix in order to have a complete document.

greport marries R, the R Hmisc and lattice packages, knitr, and LaTeX to produce reproducible clinical trial reports with a minimum of coding. greport composes all figure captions and makes heavy use of analysis file annotations such as variable labels and units of measurement. Some new graphical elements are introduced such as special dot charts that replace tables, extended box plots, split violin plots for longitudinal continuous variables, half confidence intervals for differences, new charts for representing patient flow, and pop-up tooltips. Supporting tables are hyperlinked to graphics, and the graphics are hyperlinked back from the tables. Figure captions contain supporting table numbers, and tables contain figure numbers.

Current Goals

  • In accrual report cumulative randomized plots add text for deficit at last recorded randomized subject
  • Add Svetlana Eden's function in rreport package for graphically summarizing adverse events by major and minor categories (e.g., body system and preferred term)
  • Add function similar to that in rreport for group sequential monitoring boundary presentation
  • Need executable tests in tests/
  • See if current tests should become vignettes

Web Sites


Changes in version 0.7-1 (2016-04-08)

  • dReport: added stable argument for suppressing backup tables
    • startPlot: stopped suppressing arguments for spar that are not in par
    • survReport: added opts argument, mylim argument
    • survReport: reduced font size of ylab when long, added markevent argument
    • accrualReport: added studynos argument
    • greport.sty: attach ocg-p LaTeX package so that ocgtools no longer needs ocg, asymptote, acrotex
    • greport.sty: added poptype=3 to use tiny tables and no actual pop-ups
    • survReport: changed default markevent to TRUE

Changes in version 0.7-0 (2015-12-02) * survReport: plot cumulative incidence estimates when left hand side of formula contains Surv objects for competing risks * upFirst: removed function; added to Hmisc

Changes in version 0.6-0 (2015-08-30)

  • accrualReport: put zoomed cumulative distribution on same graph as regular
    • exReport: added option plotExRemain to suppress 2-panel dot chart, solved problem with collisions of labels on vertical cumulative exclusion plot
    • NAMESPACE: import base functions used
    • exReport: avoided collisions in vertical dot chart, excluded actually randomized subjects from exclusion frequencies
    • exReport: fixed exclusion table so that even though exclusion counts for numerators exclude any randomized subjects, special conditions (indented) use all enrolled subjects in the denominator

Changes in version 0.5-3 (2015-04-20)

  • putFig: add \clearpage after every appendix table
  • exReport: fine-tuned vertical dot plot
  • dReport: rotated strip labels
  • Added new greport option nontx.col and use that in other functions, for non-treatment groups
  • dReport: changed strip label font size
  • dReport: run ggplot.summaryP output through colorFacet (new in Hmisc)
  • upFirst: leave all words with > 1 upper case letter unchanged (for acronyms)
  • accrualReport: changed denominator to randomized subjects for table corresponding to box plots of days to randomization
  • all reporting functions: use upFirst(lower=TRUE) for captions
  • appsection: new function
  • sampleFrac: capped fraction at 1.0, issued warning if > 1 and assumes this indicates that analysis is to compare randomized with non-randomized subjects
  • test.Rnw, report.Rnw: switch to using changepage style instead of chngpage
  • Misc: use gsub instead of translate()
  • survReport: added aehaz argument, fixed caption for when differences don't apply (no strata)
  • startPlot: ignored non-par parameters in ...
  • survReport: changed default y.n.risk to 0 (used if what='1-S')
  • exReport: added short caption when using app
  • survReport: added times argument
  • nriskReport: changed any(duplicated()) to anyDuplicated()

Changes in version 0.5-2 (2014-11-21)

  • accrualReport: axis.Date was not positioning axis labels containing only 4-digit years at Jan 1 so wrote customized axisDate function
  • Better escaping of special characters
  • dReport: handle special characters in table captions
  • dReport: added append=TRUE in call to latex() for proportions
  • exReport: added apptail argument for appendix table of IDs
  • All functions: checked that panel and subpanel containing only legal LaTeX macro name characters (A-Z a-z -); . are auto-removed

Changes in version 0.5-1 (2014-04-15)

  • survReport: changed to use npsurv instead of survfit.formula
    • exReport: changed order of output so that analysis of randomized patients marked for exclusions appears last; use LaTeX chngpage package to allow detailed table to go into left margin so as to be centered on page
  • exReport: added adjustwidth argument
    • accrualReport: allowed enrollment target N to be omitted
  • exReport: fine tuning
  • nriskReport: new report to show number of subjects still being followed at each day
    • Merge: added support for data.table
  • nriskReport: added id() variable
  • exReport: fixed bug when there is an exclusion with 0 frequency
  • accrualReport: improved graphics formatting, added minrand argument
  • accrualReport: added enrollmax argument, clarified notation
  • exReport: added ignoreExcl, ignoreRand arguments
  • all: added greportOption texwhere; default is 'gentex'; can specify texwhere='' to write non-appendix LaTeX code to console as for knitr
  • dReport: for byx for discrete Y, sense when Y is binary and use Wilson interval instead of bootstrap; adjust SE using confidence interval if proportion is 0 or 1
  • dReport: changed discreteness non-binary classification to use maximum number of unique values or Y instead of minimum
  • add globalVariables call to nriskReport

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


0.7-2 by Frank E Harrell Jr, 2 years ago,

Browse source code at

Authors: Frank E Harrell Jr <[email protected]>

Documentation:   PDF Manual  

GPL (>= 2) license

Imports rms, lattice, latticeExtra, ggplot2, Formula, survival, methods, data.table

Depends on Hmisc

See at CRAN