plot.stslist.surv: Plot method for objects produced by the seqsurv function

View source: R/plot.stslist.surv.R

plot.stslist.survR Documentation

Plot method for objects produced by the seqsurv function

Description

This is the plot method for objects of class stslist.surv produced by the seqsurv function.

Usage

## S3 method for class 'stslist.surv'
plot(x, cpal = NULL, ylab = NULL, xlab = NULL,
  xaxis = TRUE, yaxis = TRUE, xtstep = NULL, tick.last = NULL, 
  cex.axis = 1, ...)

Arguments

x

An object of class stslist.surv as produced by the seqsurv function.

cpal

Vector of colors. Alternative color palette to be used for the drawn lines. The vector should be of length equal to the number of drawn survival curves, i.e., the number of selected states or number of groups when x was obtained with per.state=TRUE. When cpal=NULL, the default colors assigned to the cpal attribute of x are used.

ylab

Optional label for the y axis. If set as NA, no label is displayed. If NULL, a default label is used.

xlab

Optional label for the x axis. If set as NA, no label is displayed. If NULL, a default label is used.

xaxis

Logical. Should the x-axis be plotted. Default is TRUE.

yaxis

Logical. Should the y-axis be plotted. Default is TRUE.

xtstep

Optional interval at which the tick-marks of the x-axis are displayed. For example, with xtstep = 3 a tick-mark is drawn at position 1, 4, 7, etc... The display of the corresponding labels depends on the available space and is dealt with automatically. If unspecified, the xtstep attribute of the x object is used.

tick.last

Logical. Should a tick mark be enforced at the last position on the x-axis? If unspecified, the tick.last attribute of the x object is used.

cex.axis

Expansion factor for the font size of the axis labels and names. The default value is 1. Values lesser than 1 will reduce the size of the font, values greater than 1 will increase the size.

...

Further graphical parameters. For more details about the graphical parameter arguments, see plot, plot.default and par.

Details

This is the plot method for the output produced by the seqsurv function, i.e., objects of class stslist.surv. It displays the survival curves fitted for states in sequences.

Author(s)

Matthias Studer, Gilbert Ritschard, Pierre-Alexandre Fonta

See Also

seqsurv, seqsplot, survfit.

Examples

## Defining a sequence object with the data in columns 10 to 25
## (family status from age 15 to 30) in the biofam data set
data(biofam)
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.seq <- seqdef(biofam, 10:25, labels=biofam.lab)

## State survival plot
biofam.surv <- seqsurv(biofam.seq)
plot(biofam.surv)

TraMineRextras documentation built on March 7, 2023, 5:54 p.m.