View source: R/plot.stslist.surv.R
plot.stslist.surv | R Documentation |
This is the plot method for objects of class stslist.surv produced by
the seqsurv
function.
## S3 method for class 'stslist.surv'
plot(x, cpal = NULL, ylab = NULL, xlab = NULL,
xaxis = TRUE, yaxis = TRUE, xtstep = NULL, tick.last = NULL,
...)
x |
An object of class |
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 |
ylab |
Optional label for the y axis. If set as |
xlab |
Optional label for the x axis. If set as |
xaxis |
Logical. Should the x-axis be plotted. Default is |
yaxis |
Logical. Should the y-axis be plotted. Default is |
xtstep |
Optional interval at which the tick-marks of the x-axis are
displayed. For example, with |
tick.last |
Logical. Should a tick mark be enforced at the last position on the x-axis? If unspecified, the |
... |
Further graphical parameters. For more details about the graphical parameter
arguments, see |
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.
Matthias Studer, Gilbert Ritschard, Pierre-Alexandre Fonta
seqsurv
, seqsplot
, survfit
.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.