Description Usage Arguments References Examples
This function is a simple adaptation of code given by Guyot et al.
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
)
|
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 |
t |
times at which number at risk |
r |
number at risk; same length as |
tot.events |
total number of events reported (integer) |
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.
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"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.