Following the ICH E3 guidance, primary and secondary efficacy endpoints need to be summarized in Section 11.4, Efficacy Results and Tabulations of Individual Participant.
In this chapter, we illustrate how to create a simplified Kaplan-Meier plot in a study. For the survival analysis in efficacy, time to dermatologic event (TTDE) will be analyzed.
To prepare the analysis, the
adtte dataset is required.
adtte <- read_sas("data-adam/adtte.sas7bdat")
First, to prepare the analysis ready data,
filter all records for the efficacy endpoint of time to event of interest (
PRAMN), then select the survival analysis related variables:
TRTP: treatment arm (using corresponding numeric code
TRTANto re-order the levels, “Placebo” will be the reference level)
AVAL: time-to-event analysis value
CNSR: event (censoring) status
survival package is used to obtain the K-M estimate.
We save the simplified K-M plot into a
.png file using code below.
Now, we can use the
r2rtf package to create a formatted RTF figure.
More details can be found on the r2rtf website.
# Create RTF figure rtf_read_figure("tlf/fig_km.png") %>% # Read the PNG file from the file path rtf_title( "Kaplan-Meier Plot for Time to First Dermatologic Event by Treatment Group", "All Participants" ) %>% # Add title or subtitle rtf_footnote("footnote") %>% # Add footnote rtf_source("[datasource: adam-adtte]") %>% # Add data source rtf_figure(fig_width = 6, fig_height = 4) %>% # Set proportional figure size to the original PNG figure size rtf_encode(doc_type = "figure") %>% # Encode figure as rtf write_rtf(file = "tlf/tlf_km.rtf")
In conclusion, the steps to create a K-M plot are as follows.
- Step 1: Read the data
- Step 2: Define the analysis-ready dataset. In this example, we define the analysis dataset for the TTDE endpoint
- Step 3: Save figures into
pngfiles based on required analysis specification.
- Step 4: Create RTF output using the