View source: R/ComparisonSurv.R
Survival.plot | R Documentation |
A function used to plot the survival curves.
Survival.plot(time,status,group,...)
time |
The follow up time for right censored data. |
status |
The status indicator, normally 1=event, 0=alive or right censored. |
group |
The group indicator for comparison, and the elements of this vector must take either 0 or 1. Normally, 0= control group, 1= treatment group. |
... |
Parameters in function plot() |
None
Survival.plot is based on the survival package, more details can be found in package "survival", the function of plot.survfit.
Cumhazard.plot
,Hazard.plot
#get 'Crossdata' from package data(Crossdata) data1<-Crossdata # #get survival plot Survival.plot(data1$time, data1$status, data1$group, xlab = "Time", ylab = "Survival" , col = c(1, 4), lwd = c(3, 3), lty= c(1, 1)) legend(2.5, 1, c("group0", "group1"), col = c(1, 4), lwd = c(3, 3), lty= c(1, 1), bty="n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.