A static ggplot2 figure of the curves the stratified survival chart opens
on: each group's Kaplan-Meier curve on one endpoint, with its confidence
band, a mark at each censored time, and R's log-rank test, medians and hazard
ratio printed under the figure. The groups, who is drawn and the test are
those of Widget_StratifiedSurvival() at the same settings, and the test is
Analyze_Survival()'s on the same rows. The curves and their bands are R's
own: survival::survfit() on those rows, with the log-log interval
Analyze_Survival() reports its medians by.
Usage
Visualize_StratifiedSurvival(
dfResults,
dfParticipants = NULL,
lSettings = list(),
dfOutcomes = NULL
)Arguments
- dfResults
data.frameLong-format results, one row per participant, biomarker and visit. Column names are supplied bylSettings; the defaults expectUSUBJID/TEST/STRESN/VISIT/VISITNUM/STRESU, the columns of Synthetic_Results.- dfParticipants
data.frameOne row per participant, orNULL. With it the chart has filters, offers its category columns to the Groups control, and its numbers can be cut. Default:NULL.- lSettings
listbio.viz stratified survival settings, asWidget_StratifiedSurvival()takes them, andtitle,subtitleandfootnotes. Default:list().- dfOutcomes
data.frameThe outcomes table, asWidget_StratifiedSurvival()takes it. A figure needs one.
Titles and footnotes
The settings title, subtitle and footnotes are text with named
placeholders, as for Visualize_GroupComparison(). This figure fills
{endpoint} (by its label), {group} (what the groups are), {n} (the
participants drawn), {filters}, {date} and {version}.
See also
Widget_StratifiedSurvival(), its interactive twin.
Other figures:
Run_Specifications(),
Visualize_AssociationScatter(),
Visualize_BiomarkerScreen(),
Visualize_CorrelationMatrix(),
Visualize_CrossTab(),
Visualize_GroupComparison()
Examples
if (requireNamespace("ggplot2", quietly = TRUE)) {
Visualize_StratifiedSurvival(
Synthetic_Results,
Synthetic_Participants,
lSettings = list(
endpoint = "EFS",
group_by = list(measure = "CRP", visit = "Baseline", cut = "median"),
title = "{endpoint} by {group}"
),
dfOutcomes = Synthetic_Outcomes
)
}