Two people may both experience education, employment, and unemployment yet follow very different life courses: one enters employment early, while the other first spends a longer period unemployed. Sequence analysis records each person's states over time as a trajectory and compares trajectories as a whole. Optimal matching (OM) provides a distance: the minimum cost of editing one state sequence into another. The resulting distance matrix can then be used to cluster and describe types of trajectories.[1]

First define the trajectories to compare

A state sequence records one state for each person at each successive time position. Begin by defining the state alphabet, the time unit, and the observation window. For example, a study might distinguish education, employment, and unemployment each month over the five years after leaving school. Alignment matters too: aligning by age compares people at the same age; aligning by time since leaving school compares their paths after a common starting event; aligning by calendar time places the same historical period at the same position. These choices determine what the distance compares.[1]

A state can last for several time units. With monthly observations, three consecutive months in employment appear as three consecutive employment states, preserving both order and duration. Collapsing consecutive repetitions instead retains the order of distinct states but loses the duration of each spell and the original time alignment. The two representations therefore answer different questions.[1]

When preparing trajectories, retain personal identifiers and any sample weights needed for the analysis. Distinguish missing information before observation begins, gaps during observation, and positions after observation ends. Time lost to follow-up or not yet observed cannot simply be coded as employment or unemployment. Decide how to handle these positions alongside the observation window, since the rules change the sequences being compared.[1]

How minimum edit cost becomes a distance

Optimal matching permits three edits: substituting one state for another, inserting a state, and deleting a state. Assign costs to these operations, then find the least costly sequence of edits that transforms one trajectory into the other. That minimum total is their OM distance. A smaller distance means the trajectories are more similar under the chosen cost rules.[1]

For an illustration, let E mean education and W mean employment, and compare E-E-W-W with E-W-W-W. Suppose each substitution between different states costs 1, as does each insertion or deletion. Substituting W for the second E costs 1. The sequences are different, so at least one positive-cost edit is needed; their minimum cost is therefore 1. This number describes the difference between the whole trajectories under the stated rules.

An insertion or deletion shifts subsequent positions, so its cost relative to substitution controls how much timing differences the comparison permits. A lower insertion or deletion cost more readily aligns similarly ordered experiences that occur at different times; a higher cost favors comparison at the original matching positions. Edits are a device for calculating distance, not events that a person actually experienced.[1]

Costs define similarity

Substitution costs can be specified using the research question and substantive knowledge, or constructed from observed transition rates. One common transition-rate rule assigns two different states i and j the cost 2 − p(i|j) − p(j|i), where p(i|j) is the rate of transition from j to i; substituting a state for itself costs zero. More common transitions in the two directions produce a lower substitution cost. The cost is not itself a transition probability: the formula gives a symmetric cost even when the two directional transition rates differ.[1]

Choose costs in light of the question. If being in the same state at the same age matters, consider carefully how much shifting to permit. If the order of experiences matters more, a relatively lower cost for timing shifts may be appropriate. Substantive and transition-rate-based costs express different judgments, so the resulting distance has no single objective meaning independent of those choices. Report the substitution matrix and insertion and deletion costs, and compare the main results under reasonable alternatives.[1]

From a distance matrix to interpretable types

Calculate a distance for each pair of people to obtain a distance matrix, then use a clustering method to group similar trajectories. Interpret the groups using their states, durations, and order of change, and explain the choice of clustering method and number of groups. In their TraMineR paper, Gabadinho and colleagues illustrate Ward clustering with four groups. Four was an analytical choice for that example, not a set of fixed social types automatically discovered by OM.[1]

To interpret a group, one can display a medoid—a central trajectory that actually occurs in the sample—while also examining differences among the other trajectories in the group. A medoid differs from a sequence assembled from the most common state at each time point: that sequence summarizes position-specific modes and may belong to no individual. A plot of state proportions at each time point can also show changing group composition, but it cannot by itself reconstruct each person's order of transitions.[1]

Finally, examine whether the typology depends on key choices. Change substantively plausible costs, missing-data treatments, or numbers of groups, and compare group membership, representative trajectories, and interpretations. If observation lengths differ, explain how the distance handles the difference; the choice of normalization also affects comparisons. Reporting these choices and their effects alongside the types makes clear why trajectories were grouped as similar.[1]

References

  1. [1] Gabadinho A, Ritschard G, Müller NS, Studer M. Analyzing and Visualizing State Sequences in R with TraMineR. Journal of Statistical Software. 2011;40(4):1–37. https://doi.org/10.18637/jss.v040.i04

  2. Analyzing and Visualizing State Sequences in R with TraMineR