Learn R Programming

TraMineRextras (version 0.6.8)

seqplot.tentrop: Plotting superposed transversal-entropy curves

Description

Functions to plot, in a same frame, transversal-entropy curves by group or multiple curves.

Usage

seqplot.tentrop(seqdata, group, main="auto",
    col=NULL, lty=NULL, lwd=3.5, ylim=NULL, xtlab=NULL,
    xtstep=NULL, tick.last=NULL, with.legend=TRUE, glabels=NULL,
    legend.pos="topright", horiz=FALSE, cex.legend=1, ...)

seqplot.tentrop.m(seqdata.list, main="auto", col=NULL, lty=NULL, lwd=3.5, ylim=NULL, xtlab=NULL, xtstep=NULL, tick.last=NULL, with.legend=TRUE, glabels=names(seqdata.list), legend.pos="topright", horiz=FALSE, cex.legend=1, ...)

Value

Number k of survival curves plotted.

Arguments

seqdata

a state sequence object (see seqdef).

seqdata.list

a list of state sequence objects.

group

a factor giving the group membership of each sequence in seqdata.

main

a character string giving the title of the graphic; if "auto", a default title is printed.

col

a vector of colors for the different curves.

lty

a vector of line types for the different curves. See lines.

lwd

numeric or vector of numerics: width of curve lines. See lines.

ylim

pair of numerics defining the range for the y-axis. If left NULL, the limits are defined from the data.

xtlab

vector of strings defining the x-axis tick labels.

xtstep

integer: step between tick marks on the x-axis. If unspecified, attribute xtstep of (first) seqdata is used.

tick.last

logical. Should a tick mark be enforced at the last position on the x-axis? If unspecified, attribute tick.last of (first) seqdata is used.

glabels

a vector of strings with the curve labels. If NULL curves are labeled with the levels of the group variable or, for seqplot.tentrop.m, as seq1, seq2, ...

with.legend

logical: Should the legend be plotted. Default is TRUE.

legend.pos

legend position: default is "topright". Seelegend .

horiz

logical: Should the legend be displayed horizontally. Set as FALSE by default, i.e., legend is displayed vertically.

cex.legend

Scale factor for the legend.

...

additional plot parameters (see par).

Details

Use seqplot.tentrop to plot curves of transversal entropies by groups of a same set of sequences, e.g. professional careers by sex.

Use seqplot.tentrop.m to plot multiple curves of transversal entropies corresponding to different sets of sequences such as sequences describing cohabitational and sequences describing occupational trajectories.

See Also

seqHtplot for an alternative way of plotting the transversal entropies and seqstatd to get the values of the entropies.

Examples

Run this code
## Using the biofam data which has sequences from
## ages 15 to 30 years in columns 10 to 25
data(biofam)
biofam <- biofam[1:200,]
biofam.seq <- seqdef(biofam[,10:25], xtlab=as.character(15:30), xtstep=3)

## Plotting transversal entropies by sex
seqplot.tentrop(biofam.seq, group=biofam$sex, legend.pos="bottomright")

slist <- list(woman = biofam.seq[biofam$sex=="woman",],
                man = biofam.seq[biofam$sex=="man",])
seqplot.tentrop.m(slist, legend.pos="bottomright")

## Plotting transversal entropies for women
## by father's social status
group <- biofam$cspfaj[biofam$sex=="woman"]
seqplot.tentrop(biofam.seq[biofam$sex=="woman",], group=group,
    main="Women, by father's social status", legend.pos="bottomright")

Run the code above in your browser using DataLab