Learn R Programming

ComparisonSurv (version 1.1.1)

Survival.plot: Plot for Cumulative Survival Function

Description

A function used to plot the survival curves.

Usage

Survival.plot(time,status,group,...)

Value

None

Arguments

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()

See Also

Cumhazard.plot,Hazard.plot

Examples

Run this code
#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")

Run the code above in your browser using DataLab