*! version 1.0.0 12aug2014
help ipdfc

Title

ipdfc -- Reconstruct individual participant data (IPD) from a published Kaplan-Meier curve

Syntax

ipdfc, required_options [ optional_options ]

required_options

surv(varname) survival percentages extracted from y-coordinates
of a Kaplan-Meier curve

tstart(varname) times from randomization extracted from the
x-coordinates of a Kaplan-Meier curve

trisk(varname) time intervals specified in the risk table

nrisk(varname) number of patients at risk at each value of trisk()

generate(varname1 varname2) generates the time
to event and event indicator from the input information

saving(filename[, replace]) saves the reconstructed survival data

optional_options

probability states that values in surv(varname) are
probabilities. Default is percentages

failure states that values in surv(varname) are
failure percentages or failure probabilities. Default is survival

isotonic use isotonic regression to correct monotonicity violators

totevents(#) total number of events in the sample

Description

ipdfc reconstructs patient-level survival (time-to-event) data from a
Kaplan-Meier curve. For example, Kaplan-Meier estimates may have been obtained by
digitizing a published graphical image. The risk table, that is the numbers of
patients at risk at particular time points, if available, may be used to
improve the accuracy of the reconstructed data. If the risk table is not available, the total
number of participants in the sample at time origin should be specified (see description
below for trisk and nrisk). The total number of events, if known,
may also be used to improve the reconstruction.

ipdfc makes use of the x- and y-coordinates of the Kaplan-Meier curve.
In a randomized trial, the x-coordinates are times since randomization. The
y-coordinates are the percentages or probabilities of survival or
failure.

Through the generate() option, ipdfc creates two new variables:
individual-level time to an event or censoring, and a censoring indicator
(1 = event, 0 = censored) for each patient contributing to the
Kaplan-Meier curve.

It should be noted that ipdfc does not handle more than one sample at once.
When dealing with a trial having more than one arm, the syntax converts data extracted
from one curve at a time to time-to-event data for the respective arm. This should be
done for all arms one by one.

Options

surv(varname) specifies the data extracted from the ordinate (y-axis) of
a published Kaplan-Meier curve. It can be survival probabilities, survival percentages,
failure probabilities or failure percentages. By default, varname is assumed
to contain survival percentages. See also options probability and failure.

tstart(varname) specifies the time since randomization as extracted from the abscissa (x-axis)
of a published Kaplan-Meier curve. The time could be in any units (e.g. days, months, years)
as specified in the publication.

trisk(varname) specifies the times corresponding to the numbers of
patients at risk in nrisk(). If the risk table is available, the values in
trisk are strictly increasing and the values in nrisk are strictly non-increasing.
Set varname = 0 if only the total number of patients in the sample is known.
See also nrisk().

nrisk(varname) supplies the number of patients at risk for each time in
trisk(). Both nrisk() and trisk() may often be found
in a 'risk table' displayed beneath published Kaplan-Meier curves. If no
risk table is available, specify nrisk() as the number of patients in
the sample and trisk() as 0. In any case, nrisk should be specified
only once for each value of trisk.

generate(varname1 varname2) generates the time-to-event outputs extracted from the
input information. varname1 varname2 specify two new variables, the time to an event and
varname2 an event indicator(1 = event, 0 = censored).For example,
generate(time event) would create time as the time to event
and event as the event indicator.

saving(filename[, replace]) saves the reconstructed
survival data to file filename.dta. replace allows the file to be
replaced if it already exists.

probability signifies that varname in surv(varname) contains probabilities
rather than the default percentages.

failure signifies that varname in surv(varname) contains failure information
rather than the default survival information.

isotonic invokes use of isotonic regression to adjust values which violate
the time-related monotonicity in surv(varname). By default, an alternative,
simpler method is used to correct the values of violators, by
replacing the value of a violator by the value of its adjacent violator.

totevents(#) is the total number of events and is used to adjust the
number of observations censored in the final interval of the risk table.

Examples

Example 1: Head and neck cancer trial

This example is from a two-arm randomised controlled trial comparing
radiotherapy plus cetuximab with radiotherapy for squamous-cell carcinoma
of the head and neck (Bonner et al., 2006). The example was used
by Guyot et al.(2012) to demonstrate the reconstruction of
individual-level time-to-event data. Survival percentages were extracted
across 60 months of follow up. The following code shows how to use ipdfc
to convert the extracted survival percentages to time-to-event data.

Read data extracted from the Kaplan-Meier curve for the control arm:

. import delimited using "Head_and_neck_arm0.txt", clear

Reconstruct time-to-event data for the control arm and store the reconstructed data in temp0.dta:

. ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) isotonic generate(t_ipd event_ipd) saving(temp0)

Read data extracted from the Kaplan-Meier curve for the treatment arm:

. import delimited using "Head_and_neck_arm1.txt", clear

Reconstruct time-to-event data for the treatment arm and store the reconstructed data in temp1.dta:

. ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) isotonic generate(t_ipd event_ipd) saving(temp1)

Now amalgamate the data from both arms:

. use temp0, clear

. gen byte arm = 0

. append using temp1

. replace arm = 1 if missing(arm)

. label define ARM 0 "Radiotherapy" 1 "Radiotherapy plus Cetuximab"

. label values arm ARM

. stset t_ipd, failure(event_ipd)

Run the Cox proportional hazards model on the reconstructed data:

. stcox arm

Using the reconstructed data, obtain the Kaplan-Meier curves:

. sts graph, by(arm) title("") xlabel(0(10)70) ylabel(0(0.2)1) ///

xtitle("Months") l2title("Locoregional Control") legend(off) ///

text(0.52 53 "Radiotherapy plus Cetuximab") text(0.20 60 "Radiotherapy") ///

risktable(0(10)50, order(2 "Radiotherapy" 1 "Radiotherapy plus" bottom(msize(5)))) ///

text(-0.38 -9 "Cetuximab")

Now suppose that the risk table is not available but the total number of participants
in each arm is known. The following code shows how to use ipdfc to convert the extracted data
to time-to-event data.

Read in extracted data assuming the risk table is not available but
the total number of participant for the control arm is known.

import delimited using "Head_and_neck_arm0_no_risk_table.txt", clear

Check that the total number of participant in the radiotherapy group is specified for the time origin.

list trisk nrisk if trisk == 0

Reconstruct time-to-event data for the radiotherapy group assuming the risk
table is not available, and restore the reconstructed data in temp0.dta. Use saving(temp0, replace) instead of
saving(temp0) if temp0.dta has been defined before.

ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) isotonic generate(t_ipd event_ipd) saving(temp0)

The following code read in the extracted data for the treatment arm, check that the
total number of participants is specified for the time origin, reconstruct time-to-event data and
restore the time-to-event data in temp1.dta.

import delimited using "Head_and_neck_arm1_no_risk_table.txt", clear

list trisk nrisk if trisk == 0

ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) isotonic generate(t_ipd event_ipd) saving(temp1)

The code to amalgamate the data from both arms is the same as described above.

Example 2: ICON7 trial

This example is from ICON7, a two-arm randomized controlled trial of
bevacizumab in advanced ovarian cancer (Perren et al. 2011). Survival
probabilities instead of percentages were extracted across 30 months
of follow up. The following code shows how to use ipdfc to convert the
extracted survival probabilities to time-to-event data.

. local tot0 464

. local tot1 470

. import delimited using "ICON7_data_arm0.txt", clear

. ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) probability iso totevents(`tot0') ///

generate(t_ipd event_ipd) saving(temp0)

. import delimited using "ICON7_data_arm1.txt", clear

. ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) probability iso totevents(`tot1') ///

generate(t_ipd event_ipd) saving(temp1)

The following code amalgamates the data from both arms and then conducts survival analysis.

. use temp0, clear

. generate byte arm = 0

. append using temp1

. replace arm = 1 if missing(arm)

. stset t_ipd, failure(event_ipd)

. stcox arm

. sts graph, by(arm) xlabel(0(3)30) ylabel(0(0.2)1) ///

risktable(0(6)30, order(1 "Bevacizumab" 2 "Standard chemo-" )) legend(off) ///

xtitle("Months since Randomization") l2title("Alive without progression") ///

plot1opts(lpattern(solid) lcolor(gs12)) plot2opts(lpattern(solid) lcolor(black)) ///

text(-0.38 -3.2 "therapy") text(0.75 14 "Bevacizumab", place(e)) text(0.5 10 "Standard chemotherapy")

Example 3: EUROPA trial

This example is from a two-arm randomized placebo-controlled trial in
evaluating the efficacy of perindopril in reduction of cardiovascular events
among patients with stable coronary artery disease (Fox et al. 2003).
Failure percentages instead of survival percentages were extracted from
the published Kaplan-Meier curves across 5 years of follow-up. The following
shows how to convert the extracted failure percentages to time-to-event data
for each arm of the trial.

. import delimited using "europa_data_arm0.txt", clear

. ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) failure iso ///

generate(t_ipd event_ipd) saving(temp0)

. import delimited using "europa_data_arm1.txt", clear

. ipdfc, surv(s) tstart(ts) trisk(trisk) nrisk(nrisk) failure iso ///

generate(t_ipd event_ipd) saving(temp1)

The following code amalgamates the data from both arms and conducts survival
analysis:

. use temp0, clear

. generate byte arm = 0

. append using temp1

. replace arm = 1 if missing(arm)

. stset t_ipd, failure(event_ipd)

. stcox arm

. sts graph, by(arm) failure title("") ylabel(0(0.04)0.14) ///

risktable(0(1)5, order(1 "Placebo" 2 "Perindopril")) ///

xtitle("Time(years)") ytitle("Probability of composite events") ///

text(0.07 4.5 "Perindopril") text(0.125 4.6 "Placebo") legend(off)

Authors

Yinghui Wei, Plymouth University, Plymouth.

yinghui.wei@plymouth.ac.uk

Patrick Royston, MRC Clinical Trials Unit at UCL, London.

j.royston@ucl.ac.uk

References

J.A. Bonner,P.M. Harari, J. Giralt, N. Azarnia, D.M. Shin, R.B. Cohen,
C.U. Jones, R. Sur, D. Raben, J. Jassem, R. Ove, M.S. Kies, J. Baselga,
H. Youssoufian, N. Amella, E.K. Rowinsky and K.K. Ang (2006) Radiotherapy
plus cetuximab for squamous-cell carcinoma of the head and neck.
New England Journal of Medicine, 354: 567-578.

K.M. Fox, EURopean trial On reduction of cardiac events with Perindopril
in stable coronary Artery diseases investigators (2003) Efficacy of perindopril
in reduction of cardiovascular events among patients with stable coronary
artery disease: randomised, double-blind, placebo-controlled, multicentre
trial. Lancet, 362: 782-788.

P. Guyot, A.E. Ades, M. Ouvwens and N.J. Welton (2012) Enhanced secondary
analysis of survival data: reconstructing the data from published Kaplan-Meier
survival curves. BMC Medical Research Methodology, 12: 9.

T.J. Perren, A.M. Swart, J. Pfisterer, J.A. Ledermann, E. Pujade-Lauraine,
G. Kristensen, M.S. Carey, P. Beale, A. Cervantes, C. Kurzeder, A. du Bois,
J.Sehouli, R. Kimig, A. Stahle, F. Collinson, S. Essapen, C. Gourley,
A. Lortholary, F. Selle, M.R. Mirza, A. Leminen, M. Plante, D. Stark,
W. Qian, M.K.B. Parmar and A.M. Oza (2011) A phase 3 trial of bevacizumab in
ovarian cancer. New England Journal of Medicine, 365: 2484—2496.

Also see

Online: help for sts graph