plot.trivPenalNL: Plot Method for a Non-Linear Trivariate Joint Model for...

plot.trivPenalNLR Documentation

Plot Method for a Non-Linear Trivariate Joint Model for Recurrent Events and a Terminal Event with a Biomarker Described with an ODE.

Description

Plots estimated baseline survival and hazard functions of a joint model (output from an object of class 'trivPenalNL') for each type of event (terminal or recurrent). Confidence bands are allowed.

Usage

## S3 method for class 'trivPenalNL'
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 trivPenalNL.

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

trivPenalNL

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)

frailtypack documentation built on Oct. 20, 2024, 1:08 a.m.