seqhandbook (version 0.1.0)

seqsmooth: Smoothing sequence data

Description

Smoothing of sequence data, using for each sequence the medoid of the sequences in its neighborhood. The results can be used to get a smoothed index plot.

Usage

seqsmooth(seqdata, diss, k=20, r=NULL)

Value

A list with the following elements:

seqdata

a sequence object (see seqdef function)

R2

pseudo-R2 measure of the goodness of fit of the smoothing

S2

stress measure of the goodness of fit of the smoothing

Arguments

seqdata

a sequence object (see seqdef function).

diss

a dissimilarity matrix, giving the pairwise distances between sequences.

k

size of the neighborhood. Default is 20.

r

radius of the neighborhood. If NULL (default), the radius is not used for smoothing.

Author

Nicolas Robette

References

Piccarreta R. (2012). Graphical and Smoothing Techniques for Sequence Analysis, Sociological Methods and Research, Vol. 41(2), 362-380.

Examples

Run this code
data(trajact)
seqact <- seqdef(trajact)
dissim <- seqdist(seqact, method="LCS")
mds <- cmdscale(dissim, k=1)
smoothed <- seqsmooth(seqact, dissim, k=30)$seqdata
seqIplot(smoothed, sortv=mds, xtlab=14:50, with.legend=FALSE, yaxis=FALSE, ylab=NA)

Run the code above in your browser using DataLab