Description Usage Arguments Value References Examples
This function derives or extracts IPD when only number at risk table information are available
1 |
t.risk.T |
vector of time points from the number at risk table |
n.risk.T |
vector of patients' number at risk at time points from the table |
group.name |
name of treatment group |
data |
data frame with 2 columns; 1st column has digitised time information and 2nd column has digitised survival rate information |
data frame with time to event, censoring, and group name information
guyot2012enhancedextractKM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | df <- ex.table[,1:2]
df <- df[!is.na(df$x1) & !is.na(df$y1),] # only valid data
res1 <- km.table(t.risk.T = c(0,25,50,75,100,125),
n.risk.T = c(22,18,10,7,5,2),
group.name="group1",
data=df);res1
df <- ex.event[,3:4]
df <- df[!is.na(df$x2) & !is.na(df$y2),]
res2 <- km.table(t.risk.T = c(0,25,50,75),
n.risk.T = c(5,1,1,0),
group.name="group2",
data=df);res2
library(survival)
result <- rbind(res1,res2);
km <- survfit(Surv(Surv.Time, Censor) ~ Group, data=result);km
plot(km)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.