Blogs

CLINICAL TRIALS WITH INTERACTIVE HTML GRAPHICS USING R

 

Author: Genpro Statistical Programming Team

 

These days, an immense measure of information is gathered during any clinical trial and it is basic for pharmaceutical sponsors to comprehend this information in extraordinary detail to settle on precise choices. Analysts and programmers invest a lot of energy examining data and creating reports for clinical trials, both for conclusive trial reports and break data monitoring advisory groups. Point and Click interfaces and copy-paste are presently accepted to be terrible models for reproducible exploration. 

All things considered, these are favorable circumstances to build an elevated level language for delivering basic components of reports such as accrual, exclusions, descriptive statistics, adverse events, time to the event, and longitudinal data. 

Statistical reports in clinical trials are mostly graphical. Graphics are better than tables to understand numeric information. Reviewers of clinical trial reports who demand seeing tables, and those who are interested to have tables to see figures of certain elements, supporting tables and some required numeric information can show up as pop-up tooltips when the mouse is drifting over a graphical element. 

Role of R in Clinical Trial Reporting  

The importance of R programming in clinical trials is getting upturned day by day. R can be an ideal platform for measurable investigation and data perception. To biostatisticians and programmers in the pharmaceutical and biotech industry, it offers a wide and rapidly growing range of user-created packages containing capacities that can proficiently control complex data sets and create tables, figures, and postings. While SAS remains a critical device in these industries, the popularity of RStudio in both the scholarly community and the clinical industry increased dramatically over the most recent decade since it is free and open-source, has powerful measurable support, and progressed representation through its immense user base and augmentation packages. As RStudio is acquiring popularity and given that regulatory organizations have not endorsed a particular software for clinical trial examination and submission, understanding the competency of R and being very much situated to utilize it in a clinical data reporting environment is a worthy endeavor. 

R Package : harrelfe/hreport 

harrelfe/hreport package contains many functions useful for monitoring and reporting the results of clinical trials and other experiments in which treatments are compared. The ‘Hmisc’, ‘plotly’, ‘ggplot2’, and ‘lattice’ packages are used by ‘greport’ for high-level graphics. Some high-level function in hreport are,  

v accrualReport – Accrual Report 

v dNeedle – Draw Needles 

v dReport – Descriptive Statistics Report 

v eReport – Event Report 

v exReport – Exclusion Report 

v gethreportOption – Get hreport Options 

v mfrowSuggest – Compute mfrow Parameter 

v nriskReport – Number at Risk Report 

v sampleFrac – Compute Sample Fractions 

v sethreportOption – Set hreport Options 

v survReport – Survival Report 

Interactive HTML graphs  

Figures are important for any submission to a regulatory authority in clinical trials, in any case, these generally do exclude interactive clinical data perceptions. Interactive data representation is an incredible asset to examine data and effectively offer definite bits of knowledge. It permits slicing and drilling through the data and intuitively changing the degree of detail you need to see. The thought is not to supplant the normal detailing of a clinical trial but rather help it by 

  • Monitoring and investigating clinical trial data. 
  • Distinguishing data issues or areas that require extraordinary consideration. 
  • Expanding the quality of clinical data. 
  • Examining potential covariates and performing specially appointed investigations.  
  • Sharing and introducing results at (regulatory) meetings. 

To demonstrate these advantages, two examples of interactive HTML clinical data visualization will be discussed:  

1. Demographic data,  

2. Adverse events data  

Our first example (Figure 1-4) visualizing demographic data from an SDTM DM dataset. Our second example (Figure 5-6) presents adverse event data from an SDTM AE dataset.  

Overall frequencies of demographic variables race and sex.

Figure 1

The above graph shows the overall proportion of the demographic variables race and sex.

 

Demographics stratified by country.

Figure 2

Figure 2 presents the country-wise proportion of demographic variables race and sex.

 

Demographics stratified by planned arm code.

Figure 3

Figure 3 describes the proportion of demographic variables race and sex by planned arm code.

 

Demographics with a race for females stratified by country.

Figure 4

Figure 4 explains the proportion of demographic variables race for females which are stratified by country 

 

Stacked bar chart of proportions for a pattern of adverse event stratified by severity/intensity.

Figure 5

Figure 5 is a stacked bar chart of proportions for a pattern of adverse events stratified by severity/intensity.

 

Reported adverse events stratified by severity/intensity and pattern of an adverse event.

Figure 6

Figure 6 expressing adverse events in the study stratified by severity/intensity and pattern of an adverse event.

 

R Code

require(hreport) # add to above: results=’hide’

knitrSet(lang=’markdown’, fig.path=’figure/’)

options(prType=’html’)

mu <- markupSpecs$html # in Hmisc – HTML markups

frac <- mu$frac

mu$styles() # define HTML styles, functions

dm1<- read_sas(“dm.sas7bdat”, NULL)

ae1<-read_sas(“ae.sas7bdat”, NULL)

den <- c(enrolled=120, randomized=120)

sethreportOption(denom=den)

dReport(RACE + SEX ~ 1,head=’Overall frequencies of demographic variables race and sex’, data=dm1, w=4, h=4.5)

dReport(RACE + SEX ~ COUNTRY, data=addMarginal(dm1, COUNTRY, SEX),w=4.75, h=3.75, head=’Demographics’)

dReport(RACE + SEX ~ ARMCD, data=addMarginal(dm1, ARMCD, SEX),

        w=4.75, h=3.75, head=’Demographics’)

dReport(RACE + SEX + pBlock(RACE, subset=SEX==’F’, label=’Race: Females’) ~ COUNTRY, data=dm1, groups=’COUNTRY’, head=’Demographics with race for females’)

dReport(AEPATT ~ AESEV , groups=’AESEV’, what=’stacked’, data=ae1, w=800, h=400)

dReport(AETERM + AESER ~ 

AESEV + AEPATT ,

        data=ae1, groups=’AESEV’,

        head=’Reported adverse events’)

 

Conclusion

The interactive HTML data visualization tools in R allow you to thoroughly investigate and understand SDTM and ADaM datasets in an efficient manner and to easily identify potential sources of data inconsistencies. Also, interactive HTML data visualization can be a valuable tool to share results with study team members and regulatory authorities. harrelfe/hreport package contains many functions useful for monitoring and reporting the results of clinical trials and other experiments in which treatments are compared.

The hreport, Hmisc, ggplot2 and plotly packages, rmarkdown, and HTML to deliver reproducible clinical trial reports with at least coding. It is suggested that you use HTML in RStudio so that code can be specifically appeared in the report utilizing catches to view and hide singular pieces or for the whole report. hreport makes all figure subtitles and utilizes examination record comments, for example, factor marks and units of estimation. Some new graphical components are presented, for example, unique speck diagrams that supplant tables, extended box plots, half confidence intervals for contrasts, charts for representing patient flow, etc.

Reference

Tags:

  • Clinical Trials
  • R programming in clinical trials
You may also like:

close