plot.MSLT.S: Plots survival function.

Description Usage Arguments Value Author(s) See Also Examples

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

1
2
## S3 method for class 'MSLT.S'
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

The function plot.MSLT.S returns the multistate survival function (S) and the plot. It returns an object with the following components:

S

The multistate survival function (values used in the plot)

plot

The plot produced by the ggplot2 package.

Author(s)

Frans Willekens

See Also

MSLT.S

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
   	
# 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"))

Biograph documentation built on May 1, 2019, 8:48 p.m.