Clinical — Kaplan–Meier survival (PFS and OS)
Kaplan–Meier progression-free and overall survival for a two-arm trial, with numbers at risk, censoring ticks, medians and the log-rank test computed from per-patient follow-up. Typed FlowScript for clinical trials. Keywords: CONSORT, randomised, randomized, trial, RCT, flow diagram, PRISMA, cohort.
Make it your own.
// Kaplan–Meier progression-free and overall survival for a two-arm trial, with numbers at risk, censoring ticks, medians and the log-rank test computed from per-patient follow-up.
//
// Every string below is EXAMPLE text from a fictional trial: replace it.
//
// Each arm lists ONE follow-up time per patient (months from
// randomisation) and a matching 0/1 flag: 1 = the event happened at that
// time, 0 = censored there (alive and event-free at last contact or at the
// data cut-off). The curves, the censoring ticks, the numbers-at-risk row,
// the medians with their intervals and the log-rank test are all computed
// from those two vectors; nothing on the figure is typed. Put your own
// patients in, in any order, and every number moves with them.
//
// Progression was assessed by CT every 8 weeks, so PFS events cluster near
// 1.8, 3.7, 5.5 and 7.4 months. That clustering is how interval-assessed
// progression really looks; keep it rather than smoothing it away.
//
// The hazard ratio is the one number a Kaplan–Meier panel cannot give, so
// the figure does not print one. It is stated beside each survival block as
// an estimate, with its model named, and was fitted to these same patients:
// Cox proportional hazards, arm as the only covariate, Breslow ties.
survival pfs {
title: "Progression-free survival"
time_unit: "months"
risk_table: true
censor_marks: true
level: 0.95
group fx101 {
label: "FX-101 + gem/nab-P"
times: [
14.7, 9.3, 9.3, 5.6, 20.1, 0.9, 11.1, 16.6, 1.7, 5.5, 1.9, 7.4, 3.8, 25.7, 5.6,
3.7, 3.6, 1.7, 3.6, 14.8, 3.6, 7.4, 1.7, 24, 5.6, 11.1, 1.9, 5.5, 7.4, 1.5,
9.1, 1.7, 7.4, 11.1, 14.8, 5.4, 1.8, 3.7, 14.6, 20, 14.6, 12.3, 5.5, 7.2, 13.4,
7.3, 1.8, 1.9, 5.7, 3.6, 9.1, 1.8, 3.7, 16.5, 3.7, 9.1, 7.3, 7.3, 25.7, 14.8
]
events: [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
]
}
group placebo {
label: "Placebo + gem/nab-P"
times: [
12.8, 5.5, 1.9, 7.3, 3.7, 9.2, 3.5, 7.4, 3.7, 3.7, 12.8, 0.8, 7.3, 5.4, 3.7,
7.3, 9.3, 1.7, 1.7, 1.9, 7.4, 1.9, 5.4, 3.8, 0.7, 1.8, 16.6, 1.8, 11.1, 1.9,
0.6, 3.6, 14.6, 4, 1.8, 5.6, 13, 1.7, 3.5, 3.6, 1.7, 5.7, 5.5, 1.8, 9.2,
5.4, 13, 12.1, 12.8, 1.7, 5.5, 5.4, 5.4, 0.6, 3.5, 5.5, 1.9, 3.7, 1.9, 14.8
]
events: [
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
]
}
estimate hr_pfs {
label: "Hazard ratio, FX-101 versus placebo"
measure: hr
scale: log
point: 0.59
lo: 0.40
hi: 0.86
level: 0.95
model: "Cox proportional hazards, unstratified, Breslow ties"
n: 120
events: 114
}
}
survival os {
title: "Overall survival"
time_unit: "months"
risk_table: true
censor_marks: true
level: 0.95
group fx101_os {
label: "FX-101 + gem/nab-P"
times: [
18.5, 24.2, 19, 16.2, 21.2, 0.9, 12.6, 16.7, 16, 6.1, 4.7, 9.7, 6.9, 25.7, 8.3,
5.7, 7.1, 5.8, 4.3, 15.9, 5.9, 13.5, 3.2, 24.1, 25.4, 12.1, 3.7, 7.8, 9.7, 1.5,
13.7, 6.8, 12, 15.7, 23.6, 8.7, 3.4, 6.4, 22.9, 20, 29, 12.3, 11.5, 7.3, 13.4,
7.6, 4.9, 4.4, 17.4, 9.6, 14, 3, 26.1, 21.3, 5, 11.2, 11.7, 8.3, 29.5, 23.7
]
events: [
1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0,
0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0
]
}
group placebo_os {
label: "Placebo + gem/nab-P"
times: [
18.8, 20.6, 11.1, 7.3, 8.7, 12.3, 4.6, 19, 6.2, 4.3, 15.4, 0.8, 8, 12.7, 12.8,
12.6, 10.3, 7.9, 18, 2.1, 11.9, 15.2, 6.3, 9.1, 0.7, 18.5, 19.3, 3, 17.5, 10.5,
0.6, 9.8, 20.6, 4, 2.9, 15.6, 17.7, 5, 14, 7.2, 15.8, 11.1, 9.1, 10.9, 9.3,
5.7, 14.7, 12.1, 16.4, 7.5, 9.4, 8.2, 14.6, 0.6, 12.7, 19, 9.2, 6.9, 25.6, 16.7
]
events: [
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0
]
}
estimate hr_os {
label: "Hazard ratio, FX-101 versus placebo"
measure: hr
scale: log
point: 0.78
lo: 0.51
hi: 1.18
level: 0.95
model: "Cox proportional hazards, unstratified, Breslow ties"
n: 120
events: 92
}
}
view progression_free: km(pfs)
view overall: km(os)