guyot.method: Go from KM curve data from published figures into...

Description Usage Arguments References Examples

View source: R/guyot.R

Description

This function is a simple adaptation of code given by Guyot et al.

Usage

1
2
3
4
5
6
7
8
9
guyot.method(
  x,
  y,
  t,
  r,
  km_write_path = NULL,
  ipd_write_path = NULL,
  tot.events = NA
)

Arguments

x

X axis coordinates taken from the digitised Kaplan-Meier curve

y

Y axis coordinates taken from the digitised Kaplan-Meier curve; same length as x

t

times at which number at risk r is given

r

number at risk; same length as t

tot.events

total number of events reported (integer)

References

Guyot, Patricia, AE Ades, Mario JNM Ouwens, and Nicky J. Welton. “Enhanced Secondary Analysis of Survival Data: Reconstructing the Data from Published Kaplan-Meier Survival Curves.” BMC Medical Research Methodology 12, no. 1 (February 1, 2012): 9. https://doi.org/10.1186/1471-2288-12-9.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Make up some data:
ipd_curve1 <- guyot.method(x = seq(0, 100), y = 1-pexp(seq(0, 100), rate = 1/50), 
             t=c(0, 10, 50), r = c(1000, 800, 250))
ipd_curve2 <- guyot.method(x = seq(0, 100), y = 1-pexp(seq(0, 100), rate = 1/30), 
             t=c(0, 10, 50), r = c(1000, 700, 100))
library(survival)
ipd_curve1$patient$treatment <- "active"
ipd_curve2$patient$treatment <- "chemo"
ipd <- rbind(ipd_curve1$patient, ipd_curve2$patient)
survival_fit <- survfit(Surv(time, event) ~ treatment, data = ipd)
survival_fit
plot(survival_fit, col = c("blue", "red"))      

certara/survivalnma documentation built on Oct. 17, 2020, 12:34 a.m.