plot.dfSim: Plots an event based data frame

Description Usage Arguments Details Value See Also Examples

View source: R/plot_dfSim.R

Description

Plots an event based data frame

Usage

1
2
## S3 method for class 'dfSim'
plot(dfSim, col = c("grey", "black"), ...)

Arguments

dfSim

a data.frame with time status and recruitmenttime = tn.

col

a vector of two colours. The first one defines the color of observations without an event and the second one the color of the observations with an event. Default is c("grey","black").

...

additional matplot() related arguments.

Details

The graph shows the observation time per patient from recruitment until administrative censoring.

Patients with an event are colored differently.

The Observations are sorted by observation time, status and group.

Value

Generates a new plot.

See Also

matplot simSurvData

Examples

1
2
3
4
5
6
7
8
N <- matrix(rep(50,10),ncol=2)
dfSim <- simSurvData(N=N, lambda=-log(1-.3)/24, sigma=1, theta=.7, gamma=-log(1-.2)/24, kappa=1, distS = "exponential",distC = "exponential",L=10)
plot(dfSim)

# to see the corresponding Kaplan-Meyer curve
require(survival)
fit <- survfit(Surv(time=time-tn, event = status) ~group,data = dfSim)
plot(fit)

Knusprikus/BSSRed documentation built on July 6, 2020, 11:02 p.m.