Description Usage Arguments See Also Examples
Function for plotting parametric estimates of the cumulative incidence function based on incidence rates. If individual patient data is available, the function also enables to plot the non-parametric, Aalen-Johansen estimates using etm
.
1 2 |
x |
|
event.code |
A character or numerical value that specifies the respective competing events for which the CIF shall be plotted. If |
covar.code |
A character or numerical value that specifies the respective covariate vlaues for which the CIF shall be plotted. If |
indiv.times |
Timepoints corresponding to event status for each individual (vector or factor). Only relevant if individual patient data is available. Defaults to |
indiv.events |
Event status for each individual (vector or factor). Only relevant if individual patient data is available. Defaults to |
indiv.covar |
Event status for each individual (vector or factor). Only relevant if individual patient data is available. Defaults to |
xlim |
The x limits (x1, x2) of the plot. Defaults to c(0, 30) |
ylim |
The y limits (y1, y2) of the plot. If |
xlab |
A title for the x axis. Defaults to “Time” |
ylab |
A title for the y axis. Defaults to “CIF” |
legend |
Adds a legend to the plot. Defaults to |
... |
Further arguments for plot |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | ### Example data.frame with aggregated count data
dat <- data.frame(
times = c(7948,2899),
no.event = c(6,8),
event.1 = c(589,68),
event.2 = c(55,21),
row.names = c("covar0","covar1"))
### Compute irates object from dat
ir <- irates(dat)
### Compute the cumulative incidence function from irates object
### here: timespan is specified by xlim (default: xlim = c(0,30))
CIFplot(x = ir)
### sir.adm: Individual patient data
data(sir.adm)
### aggregate data
agg.sir.adm <- data.reshape(
times = sir.adm$time,
events = sir.adm$status,
covar = sir.adm$pneu,
no.event.code= "0")
### Plot parametric and non-parametric CIF estimates
CIFplot(
x = irates(agg.sir.adm),
indiv.times = sir.adm$time,
indiv.events = sir.adm$status,
indiv.covar = sir.adm$pneu)
### okiss: Individual patient data
### here: e.g. just event of interest 1 (infection) is plotted
data(okiss)
### aggregate data
agg.okiss <- data.reshape(
times = okiss$time,
events = okiss$status,
covar = okiss$allo,
no.event.code= "11")
### Plot parametric and non-parametric CIF estimates
CIFplot(
x = irates(agg.okiss),
event.code = "1",
indiv.times = okiss$time,
indiv.events = okiss$status,
indiv.covar = okiss$allo)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.