Learn R Programming

TraMineR (version 1.8-9)

seqdiff: Position-wise discrepancy analysis between groups of sequences

Description

The function analyses how the differences between groups of sequences evolve along the positions. It runs a sequence of discrepancy analyses on sliding windows.

Usage

seqdiff(seqdata, group, cmprange = c(0, 1),
    seqdist_arg=list(method="LCS",norm=TRUE),
    with.missing = FALSE, weighted = TRUE, squared = FALSE)

Arguments

seqdata
a state sequence object created with the seqdef function.
group
The group variable.
cmprange
The time range of the sliding window on which subsequences are compared.
seqdist_arg
List of arguments passed to seqdist for computing the distances.
with.missing
Logical. If TRUE, missing values are considered as an additional state. If FALSE subsequences with missing values are removed from the analysis.
weighted
Logical. If TRUE, seqdiff uses the weights specified in seqdata.
squared
Logical. If TRUE the dissimilarities are squared for computing the discrepancy.

Value

  • A seqdiff object, with the following items:
  • statA data.frame with three statistics (PseudoF, PseudoR2 and PseudoT) for each time stamp of the sequence, see dissassoc
  • discrepancyA data.frame with, at each time stamp, the discrepancy within each group defined by the group variable and for the whole population.

encoding

latin1

Details

The function analyses how the part of discrepancy explained by the group variable evolves along the position axis. It runs successively discrepancy analyses within a sliding time-window of range cmprange). At each position, the method uses seqdist to compute a distance matrix over the time-window and then derives the explained discrepancy on that window with dissassoc. There are print and plot methods for the returned value.

References

Studer, M., G. Ritschard, A. Gabadinho and N. S. M�ller (2010) Discrepancy analysis of complex objects using dissimilarities. In F. Guillet, G. Ritschard, D. A. Zighed and H. Briand (Eds.), Advances in Knowledge Discovery and Management, Studies in Computational Intelligence, Volume 292, pp. 3-19. Berlin: Springer. Studer, M., G. Ritschard, A. Gabadinho and N. S. M�ller (2009) Analyse de dissimilarit�s par arbre d'induction. In EGC 2009, Revue des Nouvelles Technologies de l'Information, Vol. E-15, pp. 7-18.

See Also

dissassoc to analyse the association of the group variable with the whole sequence

Examples

Run this code
## Define a state sequence object
data(mvad)
## First 24 months trajectories
mvad.seq <- seqdef(mvad[, 17:40])

## Position-wise discrepancy analysis
mvad.diff <- seqdiff(mvad.seq, group=mvad$gcse5eq)
print(mvad.diff)
plot(mvad.diff, stat=c("Pseudo R2", "Levene"), xtstep=6)
plot(mvad.diff, stat="discrepancy")

Run the code above in your browser using DataLab