| plot.stslist.statd {TraMineR} | R Documentation |
This is the plot method for output produced by the seqstatd function, i.e objects of class stslist.statd.
## S3 method for class 'stslist.statd': plot(x, type = "d", cpal = NULL, ylab = NULL, yaxis = TRUE, xaxis = TRUE, xtlab = NULL, cex.plot = 1, space=0, ...)
x |
an object of class stslist.statd as produced by the seqstatd function. |
type |
if "d" (default), a state distribution plot is produced. If "Ht" an entropy index plot is produced. |
cpal |
alternative color palette to use for the states. If user specified, a vector of colors with number of elements equal to the number of states in the alphabet. By default, the 'cpal' attribute of the x object is used. |
ylab |
an optional label for the y axis. If set to NA, no label is drawn. |
yaxis |
if TRUE or "cum", the y axis is plotted with a label showing the cumulated percentage frequency of the displayed sequences. If "pct", the percentage value for each sequence is displayed. |
xaxis |
if TRUE (default) the xaxis is plotted. |
xtlab |
optional labels for the x axis ticks. If unspecified, the names attribute of the input object is used. |
cex.plot |
expansion factor for setting the size of the font for 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. |
space |
the space between the stacked bars. Default to 0, i.e. no space. |
... |
further graphical parameters. For example border=NA to remove the bars borders, space=0 to remove space between sequences. For more details about the graphical parameter arguments, see barplot and par. |
This is the plot method for the output produced by the seqstatd function, i.e. objects of class stslist.statd. If type="d"it produces a state distribution plot presenting the sequence of the states frequencies for each time point, as computed by the seqstatd function. If type="Ht", the series of state distribution entropies is plotted.
This method is called by the generic seqplot function (if type="d" or type="Ht") that produces more sophisticated plots, allowing grouping and automatic display of the states legend. The seqdplot and seqHtplot functions are shortcuts for calling seqplot with type="d" or type="Ht" respectively.
## 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 distribution
biofam.statd <- seqstatd(biofam.seq)
## State distribution plot (default type="d" option)
plot(biofam.statd)
## Entropy index plot
plot(biofam.statd, type="Ht")