ipd | R Documentation |
Generate individual patient data (IPD) from digitized survival curve data using the method described by Guyot (2012).
ipd(
time,
prob,
t.atrisk,
n.atrisk,
total = NA,
arm = "arm",
tau = max(time, t.atrisk),
interpolate = FALSE
)
time , prob |
vectors of survival time and probabilities |
t.atrisk , n.atrisk |
vectors of times and number at-risk |
total |
(optional) total number of events |
arm |
(optional) arm label |
tau |
maximum follow-up time |
interpolate |
logical or integer; if |
Guyot, Patricia, et al. Enhanced secondary analysis of survival data: reconstructing the data from published Kaplan-Meier survival curves. BMC Medical Research Methodology 2012, 12:9.
## Not run:
xy <- system.file(
'etc', 'init', 'Checkmate_067_S3A_Nivolumab.csv',
package = 'kmdata'
)
ar <- system.file(
'etc', 'init', 'Checkmate_067_At_Risk.csv',
package = 'kmdata'
)
dd <- read.csv(xy)
ar <- read.csv(ar)
## generate the patient-level censored data
ipd1 <- ipd(dd$T, dd$S, ar$trisk, ar$nrisk, arm = 'Nivo')
with(ipd1, tapply(time, event, summary))
## convenience function to plot
kmplot(ipd1, xaxis.at = ar$trisk)
## overlay raw coordinates from digitization
lines(dd$T, dd$S, col = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.