# import and attach the data example
data(dataHepatology)
attach(dataHepatology)
# computation of the summary survivals
results<-survival.summary(study, time, n.risk, survival, confidence="Greenwood")
results
# plot the estimated summary survival curve against the extracted ones
RandomEffectSummary<- results$summary.random
plot(time, survival, type="n", col="grey", ylim=c(0,1),xlab="Time",
ylab="Survival")
for (i in unique(sort(study)))
{
lines(time[study==i], survival[study==i], type="l", col="grey")
points(max(time[study==i]),
survival[study==i & time==max(time[study==i])], pch=15)
}
lines(RandomEffectSummary[,1], RandomEffectSummary[,2], type="l",
col="red", lwd=3)
points(RandomEffectSummary[,1], RandomEffectSummary[,3], type="l",
col="red", lty=3, lwd=3)
points(RandomEffectSummary[,1], RandomEffectSummary[,4], type="l",
col="red", lty=3, lwd=3)
Run the code above in your browser using DataLab