plot.etmCIF: Plot cumulative incidence functions

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/plot.etmCIF.R

Description

Plot function for etmCIF objects. The function plots cumulative incidence curves, possibly with pointwise confidence intervals.

Usage

1
2
3
4
5
6
## S3 method for class 'etmCIF'
plot(x, which.cif, xlim, ylim,
    ylab = "Cumulative Incidence", xlab = "Time", col = 1, lty, lwd = 1,
    ci.type = c("none", "bars", "pointwise"), ci.fun = "cloglog",
    ci.col = col, ci.lty = 3, legend = TRUE, legend.pos, curvlab,
    legend.bty = "n", pos.ci = 27, ci.lwd = 3, ...)

Arguments

x

A etmCIF object

which.cif

A numeric vector indicating which CIFs should be plotted. When missing, only the CIF of interest is plotted (determined through the failcode argument in etmCIF.)

xlim

x-axis limits for the plot. By default, c(0, max(time))

ylim

y-axis limits. Default is c(0, 1)

ylab

Label for y-axis. Default is "Cumulative Incidence"

xlab

Label for x-axis. Default is "Time"

col

Vector describing colours used for the CIF curves. Default is black

lty

Vector of line type

lwd

Thickness of the lines

ci.type

One of c("none", "bars", "pointwise"). none plots no confidence interval, bars plots the confidence intervals in the form of a segment for one time point, and pointwise draws pointwise confidence intervals for the whole follow-up period.

ci.fun

Transformation used for the confidence intervals. Default is "clolog", and is a better choice for cumulative incidences. Other choices are "log" and "log-log"

ci.col

Colour for the pointwise confidence interval curves. Default is same as the CIF curves

ci.lty

Line type for the confidence intervals. Default is 3

legend

Logical. Whether to draw a legend. Default is TRUE

legend.pos

A vector giving the legend's position. See legend for further details

curvlab

A character or expression vector to appear in the legend. Default is CIF + event label

legend.bty

Box type for the legend. Default is none ("n")

pos.ci

If ci.type = "bars", vector of integers indicating at which time point to put the confidence interval bars. Default is 27

ci.lwd

Thickness of the confidence interval segment (for ci.type = "bars")

...

Further graphical arguments

Details

The function relies on plot.etm and lines.etm with more or less the same options. Exception is the drawing of the confidence intervals, for which several displays are possible.

Value

No value returned

Author(s)

Arthur Allignol arthur.allignol@gmail.com

See Also

etmCIF, plot.etm, lines.etm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(abortion)

cif.ab <- etmCIF(survival::Surv(entry, exit, cause != 0) ~ group, abortion,
                 etype = cause, failcode = 3)

cif.ab

plot(cif.ab, ci.type = "bars", pos.ci = 24,
     col = c(1, 2), lty = 1, curvlab = c("Control", "Exposed"))

plot(cif.ab, which = c(1, 2))

Example output

Call: etmCIF(formula = survival::Surv(entry, exit, cause != 0) ~ group, 
    data = abortion, etype = cause, failcode = 3)

Covariate:  group 
	levels:  0 1 


 group = 0 
      time          P       se(P) n.event
CIF 1   43 0.04015931 0.009257784      20
CIF 2   43 0.79905931 0.022186468     924
CIF 3   43 0.16078139 0.021326113      69

 group = 1 
      time         P      se(P) n.event
CIF 1   42 0.2851118 0.04249308      38
CIF 2   42 0.3525651 0.04213898      92
CIF 3   42 0.3623231 0.04947340      43

etm documentation built on Sept. 8, 2020, 5:06 p.m.