Life-course plot for event life data with recurrent events
lifecourse(
formula,
data,
id = "id",
group = NULL,
type = "l",
lty = 1,
col = 1:10,
alpha = 0.3,
lwd = 1,
recurrent.col = NULL,
recurrent.lty = NULL,
legend = NULL,
pchlegend = NULL,
by = NULL,
status.legend = NULL,
place.sl = "bottomright",
xlab = "Time",
ylab = "",
add = FALSE,
...
)
Formula (Event(start,slut,status) ~ ...)
data.frame
Id variable
group variable
Type (line 'l', stair 's', ...)
Line type
Colour
transparency (0-1)
Line width
col of recurrence type
lty's of of recurrence type
position of optional id legend
point type legends
make separate plot for each level in 'by' (formula, name of column, or vector)
Status legend
Placement of status legend
Label of X-axis
Label of Y-axis
Add to existing device
Additional arguments to lower level arguments
data = data.frame(id=c(1,1,1,2,2),start=c(0,1,2,3,4),slut=c(1,2,4,4,7),
type=c(1,2,3,2,3),status=c(0,1,2,1,2),group=c(1,1,1,2,2))
ll = lifecourse(Event(start,slut,status)~id,data,id="id")
ll = lifecourse(Event(start,slut,status)~id,data,id="id",recurrent.col="type")
ll = lifecourse(Event(start,slut,status)~id,data,id="id",group=~group,col=1:2)
op <- par(mfrow=c(1,2))
ll = lifecourse(Event(start,slut,status)~id,data,id="id",by=~group)
par(op)
legends=c("censored","pregnant","married")
ll = lifecourse(Event(start,slut,status)~id,data,id="id",group=~group,col=1:2,status.legend=legends)