Fig: The curves of Cumulative Cause-specific Hazard or Cumulative...

Description Usage Arguments Value Examples

View source: R/Fig.R

Description

Drawing the curves of Cumulative Cause-specific Hazard or Cumulative Incidence Function.

Usage

1
2
3
4
5
Fig(time, status, group, event.type = 1, fig = 1,
           x.lim = c(0, 10), y.lim = c(0, 1),
           x.space = seq(0, 10, 2), y.space = seq(0, 1, 0.2),
           group.lab = c("group 0", "group 1"),
           col = c("steelblue", "red"), lty = c(1, 2))

Arguments

time

The follow-up time for right censored data.

status

The status indicator, 1 = event of interest, 2 = competing event and 0 = right censored.

group

The group indicator for comparison. The elements of this vector take either 1 or 0. Normally, 0 = control group, 1 = active treatment group.

event.type

The indicator of event type, 1 = event 1, 2 = event 2.

fig

The indicator of curves, 1 = Cumulative incidence function, 2 = Cumulative Cause-specific Hazard.

x.lim

The range of x-axis.

y.lim

The range of y-axis.

x.space

The scale of x-axis.

y.space

The scale of y-axis.

group.lab

The labels of groups.

col

The color of curves.

lty

The type of curves.

Value

The curves of Cumulative Cause-specific Hazard or Cumulative Incidence Function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data(simdata)
time <- simdata$time
status <- simdata$status
group <- simdata$group
open <- par(no.readonly = TRUE)
par(mfrow = c(2, 2))
Fig(time, status, group, event.type = 1, fig = 1,
   x.lim = c(0, 6), y.lim = c(0, 0.8),
   group.lab = c("RT", "CRT"), col = c("steelblue", "red"), lty = c(1, 2))
Fig(time, status, group, event.type = 2, fig = 1,
   x.lim = c(0, 6), y.lim = c(0, 0.8),
   group.lab = c("RT", "CRT"), col = c("steelblue", "red"), lty = c(1, 2))
Fig(time, status, group, event.type = 1, fig = 2,
   x.lim = c(0, 6), y.lim = c(0, 0.8),
   group.lab = c("RT", "CRT"), col = c("steelblue", "red"), lty = c(1, 2))
Fig(time, status, group, event.type = 2, fig = 2,
   x.lim = c(0, 6), y.lim = c(0, 0.8),
   group.lab = c("RT", "CRT"), col = c("steelblue", "red"), lty = c(1, 2))
par(open)

hongji-wu/crRMTL documentation built on Jan. 16, 2022, 12:37 a.m.