plot.trivPenal {frailtypack} | R Documentation |
Plot Method for a trivariate joint model for longitudinal data, recurrent events and a terminal event.
Description
Plots estimated baseline survival and hazard functions of a joint model (output from an object of class 'trivPenal') for each type of event (terminal or recurrent). Confidence bands are allowed.
Usage
## S3 method for class 'trivPenal'
plot(x, event = "Both", type.plot = "Hazard", conf.bands =
FALSE, pos.legend="topright", cex.legend = 0.7, ylim, main, color = 2, median=TRUE, Xlab
= "Time", Ylab = "Hazard function", ...)
Arguments
x |
A joint model, an object of class |
event |
a character string specifying the type of curve. Possible value are "Terminal", "Recurrent", or "Both". The default is "Both". |
type.plot |
a character string specifying the type of curve. Possible value are "Hazard", or "Survival". The default is "Hazard". Only the first words are required, e.g "Haz", "Su" |
conf.bands |
logical value. Determines whether confidence bands will be plotted. The default is to do so. |
pos.legend |
The location of the legend can be specified by setting this argument to a single keyword from the list '"bottomright"', '"bottom"', '"bottomleft"', '"left"', '"topleft"', '"top"', '"topright"', '"right"' and '"center"'. The default is '"topright"' |
cex.legend |
character expansion factor *relative* to current 'par("cex")'. Default is 0.7 |
ylim |
y-axis limits |
main |
plot title |
color |
curve color (integer) |
median |
Logical value. Determines whether survival median will be plotted. Default is TRUE. |
Xlab |
Label of x-axis. Default is '"Time"' |
Ylab |
Label of y-axis. Default is '"Hazard function"' |
... |
other unused arguments |
Value
Print a plot of the baseline survival or hazard functions for each type of event or both with the confidence bands or not (conf.bands argument)
See Also
Examples
## Not run:
###--- Trivariate joint model for longitudinal data, ---###
###--- recurrent events and a terminal event ---###
data(colorectal)
data(colorectalLongi)
# Weibull baseline hazard function
# Random effects as the link function, Gap timescale
# (computation takes around 30 minutes)
model.weib.RE.gap <-trivPenal(Surv(gap.time, new.lesions) ~ cluster(id)
+ age + treatment + who.PS + prev.resection + terminal(state),
formula.terminalEvent =~ age + treatment + who.PS + prev.resection,
tumor.size ~ year * treatment + age + who.PS, data = colorectal,
data.Longi = colorectalLongi, random = c("1", "year"), id = "id",
link = "Random-effects", left.censoring = -3.33, recurrentAG = FALSE,
hazard = "Weibull", method.GH="Pseudo-adaptive", n.nodes = 7)
plot(model.weib.RE.gap)
plot(model.weib.RE.gap, type = "survival")
## End(Not run)