plot.longiPenal: Plot Method for a joint model for longitudinal data and a...

plot.longiPenalR Documentation

Plot Method for a joint model for longitudinal data and a terminal event.

Description

Plots estimated baseline survival and hazard functions for a terminal outcome from an object of class 'longiPenal'. If available, plot the estimated quantities related to a mediation analysis. Confidence bands are allowed.

Usage

## S3 method for class 'longiPenal'
plot(x, type.plot = "Hazard",plot.mediation="All", 
conf.bands=TRUE,pos.legend= "topright", cex.legend=0.7, main, color, 
median=TRUE, Xlab = "Time", Ylab = "Hazard function", ...)

Arguments

x

A joint model for longitudinal outcome and a terminal event, i.e. a longiPenal class object (output from calling longiPenal function).

type.plot

a character string specifying the type of curve for the terminal event. Possible value are "Hazard", or "Survival". The default is "Hazard". Only the first words are required, e.g "Haz", "Su"

plot.mediation

A character string specifying the desired plot. Possible values are "All", "PTE" or "Effects". The default is "All" which displays both plots.

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

main

title of plot

color

color of the curve (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 for the terminal event of the joint model for a longitudinal and survival data.

See Also

longiPenal

Examples



## Not run: 
###--- Joint model for longitudinal data and a terminal event ---###

data(colorectal)
data(colorectalLongi)

# Survival data preparation - only terminal events 
colorectalSurv <- subset(colorectal, new.lesions == 0)

# Baseline hazard function approximated with splines
# Random effects as the link function

model.spli.RE <- longiPenal(Surv(time1, state) ~ age + treatment + who.PS 
+ prev.resection, tumor.size ~  year * treatment + age + who.PS ,
colorectalSurv,	data.Longi = colorectalLongi, random = c("1", "year"),
id = "id", link = "Random-effects", left.censoring = -3.33, 
n.knots = 7, kappa = 2)
pdf(file = "/home/agareb1/etudiants/al10/newpack/test/plot_longi.pdf")

# Plot the estimated baseline hazard function with the confidence intervals
plot(model.spli.RE)	

# Plot the estimated baseline hazard function with the confidence intervals
plot(model.spli.RE, type = "Survival")	

## End(Not run)



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