Visualizing Summary Data

Samer Mouksassi

2024-01-15

In this vignette we will demo how to visualize data which is only available in summary format as it is coming from a published paper table or figure for example Figure 3 from this paper:

“Remdesivir for the Treatment of Covid-19 — Final Report”

JH Beigel et al. N Engl J Med 2020. DOI: 10.1056/NEJMoa2007764
JH Beigel et al. N Engl J Med 2020. DOI: 10.1056/NEJMoa2007764

Published Data

The data has been made available in a csv data file named remdesivirfig3.csv

library(ggquickeda) #load ggquickeda
remdesivirdata <- read.csv("./remdesivirfig3.csv") # in vignette folder
knitr::kable(remdesivirdata)
Subgroup Subgroupvalue Subgroupvalueorder N.of.patients Recovery.Rate.Ratio RRLCI RRUCI
All Patients 1 1062 1.29 1.12 1.49
Geographic Region North America 2 847 1.30 1.10 1.53
Geographic Region Europe 3 163 1.30 0.91 1.87
Geographic Region Asia 4 52 1.36 0.74 2.47
Race White 5 566 1.29 1.06 1.57
Race Black 6 226 1.25 0.91 1.72
Race Asian 7 135 1.07 0.73 1.58
Race Other 8 135 1.68 1.10 2.58
Ethnic group Hispanic or Latino 9 250 1.28 0.94 1.73
Ethnic group Not Hispanic or Latino 10 755 1.31 1.10 1.55
Age 18 to < 40 yr 11 119 1.95 1.28 2.97
Age 40 to < 65 yr 12 559 1.19 0.98 1.44
Age >= 65 yr 13 384 1.29 1.00 1.67
Sex Male 14 684 1.30 1.09 1.56
Sex Female 15 278 1.31 1.03 1.66
Symptoms duration <= 10 days 16 676 1.37 1.14 1.64
Symptoms duration > 10 days 17 383 1.20 0.94 1.52
Baseline Ordinal Score 4 (not receiving oxygen) 18 138 1.29 0.91 1.83
Baseline Ordinal Score 5 (receiving oxygen) 19 435 1.45 1.18 1.79
Baseline Ordinal Score 6 (receiving high-flow oxygen) 20 193 1.09 0.76 1.57
Baseline Ordinal Score 7 (receiving mv or ECMO) 21 285 0.98 0.70 1.36

Load the Data into the app

# from R launch the app with the data 
#run_ggquickeda(remdesivirdata) 
# if you have access the the app on a server browse to the file and load it

X/Y Mappings and Splitting Options

Summary Data Mapping
Summary Data Mapping
Graph Splitting
Graph Splitting

Facets Options

We still have to set text formatting options using the group of subtabs in the lower part of the page:

At this point you should have this graph:

Facet Options
Facet Options

Ordering of Variables and Values

reordering of subgroup
reordering of subgroup

While you can add another variable and manually drag and drop we will demo next another possibility to reorder yvalues using a statistic (e.g. median) of another variable (Subroupvalueorder):

reordering of Subgroupvalue
reordering of Subgroupvalue

Remove Default Points and add a Point Interval

Median/PI options
Median/PI options

Setting Titles, Captions and Logging the X axis

And now you should get the below plot !: xy label options

Example of what is Possible with ggquickeda

As an example of even more advanced features consider the screenshot below where the Intervals Values are shown while the point Size is proportional to the N of patients. Some theme adjustments to customize the plot and legend were also done.

more options
more options