Skip to content
FlowScript templates

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.

Template previewFlowScript
Progression-free survivalFigure: Progression-free survival. Kaplan-Meier survival plot. Horizontal axis: Time (months), linear scale, from 0 to 30. Vertical axis: Survival probability (probability), linear scale, from 0 to 1. 2 series. FX-101 + gem/nab-P (7.25 months, interval 5.4 to 9.1, n = 60); Placebo + gem/nab-P (4.6 months, interval 3.5 to 5.5, n = 60). Observations: n = 120 subjects. Uncertainty: no uncertainty is shown. Comparison: FX-101 + gem/nab-P is higher than Placebo + gem/nab-P (log-rank test (Mantel 1966); p = 0.004). Estimator: Kaplan–Meier product-limit, 95% level (band not drawn). Test: log-rank (Mantel 1966), chi-square 8.25 on 1 degree(s) of freedom, P = 0.0041, over 33 event times and arms FX-101 + gem/nab-P versus Placebo + gem/nab-P. FX-101 + gem/nab-P: n = 60, 56 events, 4 censored, median 7.3 months (95% CI 5.4 to 9.1). Placebo + gem/nab-P: n = 60, 58 events, 2 censored, median 4.6 months (95% CI 3.5 to 5.5). Numbers at risk, FX-101 + gem/nab-P: 0: 60; 5: 39; 10: 18; 15: 7; 20: 5; 25: 2; 30: 0. Numbers at risk, Placebo + gem/nab-P: 0: 60; 5: 29; 10: 10; 15: 1; 20: 0; 25: 0; 30: 0.Progression-free survivalFX-101 + gem/nab-P (n = 60, 56 events)FX-101 + gem/nab-P: 4 censoredPlacebo + gem/nab-P (n = 60, 58 events)Placebo + gem/nab-P: 2 censored0.000.250.500.751.00Survival probability051015202530Time (months)Log-rank χ² = 8.25 (1 df), P = 0.0041FX-101 + gem/nab-P: median 7.3 months (95% CI 5.4 to 9.1)Placebo + gem/nab-P: median 4.6 months (95% CI 3.5 to 5.5)FX-101 + gem/nab-PPlacebo + gem/nab-PNumber at riskFX-101 + gem/nab-P6039187520Placebo + gem/nab-P6029101000Kaplan–Meier product-limit estimate. Confidence band not drawn.Numbers at risk are the subjects still under observation at each time-axis tick; a subject observed at exactly a tick is counted as at risk there.Ticks on the curves mark follow-up ending without the event (censoring).1 palette colour(s) darkened or lightened to clear 3:1 against the panel; each arm also carries its own dash pattern, so the figure survives greyscale.

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)