plot.dynin {TraMineRextras}R Documentation

Dynamic index plot

Description

Plot of dynamic (i.e. successive) cross-sectional summaries of an individual index. The successive values of the individual index for all sequences should be collected in a dynin table as produced by seqindic.dyn.

Usage

## S3 method for class 'dynin'
plot(x, fstat=weighted.mean, group=NULL, conf=FALSE,
     main="auto", col=NULL, lty=NULL, lwd=3.5, ylim=NULL,
     ylab=NULL, xlab=NULL, xtlab=NULL, xtstep=NULL, tick.last=NULL,
     with.legend=TRUE, glabels=NULL, legend.pos="topright",
     horiz=FALSE, cex.legend=1, bcol=NULL, na.rm=FALSE, ret=FALSE, ...)

Arguments

x

object of class dynin as produced by seqindic.dyn

fstat

function: summary function to compute the values plotted. Default is weighted.mean with weights taken from the weights attribute of x. When weighted.mean and x has no weights, mean is used instead.

group

factor or discrete vector: group membership; a curve is drawn for each group. If NULL (default) a single curve for the whole set is drawn.

conf

logical or numeric: If logical, should confidence bands be displayed? If numeric, confidence probability. TRUE is equivalent to .95. Applies only when fstat=mean or fstat=weighted.mean.

main

character string: Plot title. Default is "auto" that prints a default title. Set as NULL to suppress the title.

col

color vector. Group line colors. If NULL (default), colors are automatically assigned using qualitative_hcl with the 'Dark 3' palette (see hcl_palettes).

lty

string vector. Group line types (see lines). If NULL (default), types are automatically assigned.

lwd

integer vector: Group line widths (see lines). If NULL (default), set as 3.5.

ylim

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

ylab

character string: y axis label.

xlab

character string: x axis label.

xtlab

vector of strings defining the x-axis tick labels. If NULL, column names of the x table are used.

xtstep

integer: step between tick marks on the x-axis. If unspecified, attribute xtstep 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, attribute tick.last of the x object is used.

glabels

a vector of strings with the curve labels. If NULL curves are labeled with the levels of the group variable

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.

bcol

color vector. For confidence bands. If NULL (default), colors are automatically assigned using qualitative_hcl with the 'Pastel 1' palette (see hcl_palettes).

na.rm

logical. When fstat is mean or weighted.mean, should NA's be stripped before computation? Ignored for any other fstat function.

ret

logical: Should the plotted values be returned?

...

additional plot parameters (see par).

Details

Together with seqindic.dyn this function implements the dynamic sequence analysis approach of Pelletier et al. (2020).

The function first computes the summary table using the fstat function. Each row of the summary table is then plotted as a line, except rows that contain NAs. Setting na.rm=TRUE helps sometimes to prevent some NAs in the summary table.

Confidence bands are computed for a confidence level of 95% and assuming a normal distribution.

Value

If ret=TRUE, a matrix with the successive group summaries (One row per group) and, when conf=TRUE, the matrices with the lower and upper bounds of the confidence intervals as attributes L.grp and U.grp.

Author(s)

Gilbert Ritschard

References

Pelletier, D., Bignami-Van Assche, S., & Simard-Gendron, A. (2020) Measuring Life Course Complexity with Dynamic Sequence Analysis, Social Indicators Research doi:10.1007/s11205-020-02464-y.

See Also

See Also seqindic.dyn (with examples)

Examples

## See examples on 'seqindic.dyn' help page

[Package TraMineRextras version 0.6.7 Index]