Learn R Programming

Biograph (version 2.0.6)

plot.MSLT.S: Plots survival function.

Description

Plot method for object of class 'MSLT.S' using the ggplot2 package. It plots the multistate survival function by as estimated by MSLT.S

Usage

"plot"(x, e0, order,colours,title,area,xmin,xmax,...)

Arguments

x
The multistate survival function. An object of class MSLT.S produced by the MSLT.S function. It is one of two components of the object produced by the MSLT.S function.
e0
Life expectancy at reference age (e.g. at birth)
order
Desired sequence of states in plot
colours
Colours
title
Title for multistate survival plot
area
Graph type: area (area=TRUE) or bar (area=FALSE)
xmin
Minimum value on x-axis
xmax
Maximum value on x-axis
...
Further arguments to plot

Value

S
The multistate survival function (values used in the plot)
plot
The plot produced by the ggplot2 package.

See Also

MSLT.S

Examples

Run this code
# The multistate life table based on occurrence-exposure rates
    data (GLHS)
    param <- Parameters (GLHS)
    cr <- Cumrates (irate=3,Bdata=GLHS)
    S <- MSLT.S(cr$oe)
    radix <- c(10000,0)
    mslt <- MSLT.e (S,radix)
    
# Plot the multistate survival function (object of class 'MSLT.S' )
    z<- plot (x=S$S,e0=mslt$e0,title="Multistate survival function",area=TRUE,order=c("N","J"))

Run the code above in your browser using DataLab