Using sequence analysis to visualize and validate model transitions

We illustrate a novel datadriven way of visualizing paths of labor market transitions. The proposed technique is used in many fields of science when analyzing transitions longitudinally. The statistical method applied in this study is based on sequence analysis (SA) used to identify similar and dissimilar individual transition patterns over longitudinal measurements. We briefly introduce the statistical basis of SA and discuss its use in the dynamic microsimulation context. We also report our results from the Finnish ELSI model to illustrate labor market transitions near retirement. SA is available in many popular statistical software packages such as R and Stata. The programming code for SA and data simulations are also given. Our conclusion is that SA is a useful tool also in a microsimulation context, in visualizing and validating simulated model transitions when statistically more sophisticated mixture modeling are not applicable. JEL classification: C63, C10, J26 DOI: https:// doi. org/ 10. 34196/ ijm. 00218


Introduction
This study is a continuum to the study by Salonen et al. (2019) and aims to introduce established statistical techniques from other fields of science, such as empirical life course analysis, to a microsimulation context. This paper has two goals. First, we present a statistical technique called sequence analysis (SA) and demonstrate its use in microsimulation modeling. We use SA to visualize transitions, which can yield valuable new information that may not be easily accessible by other means. Second, we use SA to show how this technique, among others, can validate models and reveal possible misspecification of the microsimulation model. SA was first introduced in computer science (Levenshtein, 1966), then in molecular biology to study DNA and RNA sequences (Levitt, 1969). Years later it was further developed by sociologist Andrew Abbott (Abbott, 1983;Abbott, 1984;Abbott and Forrest, 1986) to study the social processes occurring in sequences over a long time period (see Courgeau, 2018, p. 19). Since then, the analysis has been extensively used also in sociology and in a number of fields of science, including life course studies (e.g., Riekhoff, 2018;Piccarreta and Studer, 2019). There is a long tradition of using SA also in the fields of medicine, history and cultural analysis. However, to our knowledge, SA has rarely been used in the context of microsimulation.
SA is somewhat sensitive to underlying philosophical assumptions about the life course in general. In fact, there is an ongoing discussion among sociologists of how to aggregate transition sequences using optimal matching techniques. The discussion stems from critical papers by Wu (2000) and Levine (2000). However, in a microsimulation context, the usefulness of any statistical technique is evaluated in practical conditions of a given simulation model: does the technique make sense? Sociological theories of the life course are important in empirical research, but microsimulation practitioners can also benefit from practical approach to useful statistical techniques.
The backbone of SA is in optimal matching analysis (OMA), which is the statistical background of aggregating individual transition sequences into more general groups (e.g., Ritschard and Studer, 2. Sequence analysis 2.1. Modeling sequences In SA, OMA is applied to longitudinal data. It can be used for modeling the heterogeneity of individual transitions measured longitudinally. The idea is to represent each individual longitudinal measurement by a sequence string. The string indicates the duration and order of states that an individual occupies. The measures can be, for example, months or years. Because there are numerous possible individual sequences, aggregation is needed. OMA is a technique often used to reduce the number of sequences. According to Mikolai and Lyons-Amos (2017) OMA measures the dissimilarity between individual sequences by identifying similar pairs of sequences. Similarity is defined in terms of the number, order, and duration of states within sequences. The OMA algorithm calculates the similarity/dissimilarity between two sequences by taking into account three possible operations: replacement (one state is replaced by another), insertion (an additional state is added to the sequence), and deletion (a state is deleted from the sequence). The fewer operations needed to turn one sequence into the other, the more similar the two sequences are, and vice versa. Furthermore, a certain cost can be attached to each operation. Therefore, identifying the relative cost of all operations is critical in determining the similarity or dissimilarity between individual sequences. These steps of OMA require an ex ante definition by the researcher, with little objective measures of the correct specification. The results can be highly sensitive to these specifications (see Brzinsky-Fay and Kohler, 2010). Finally, the distance between two sequences is defined by the minimum cost of the operations that are necessary to transform one sequence into the other (Abbott and Tsay, 2000). The distances are recorded in a dissimilarity matrix. A more technical discussion on the details of SA and OMA are found in Studer and Ritschard (2014). Mikolai and Lyons-Amos (2017) further define that, in order to find existing patterns in the data, hierarchical cluster analysis (HCA), or hierarchical clustering, is performed on the dissimilarity matrix. The main aim of the HCA is to minimize the within-cluster cluster distance by combining clusters hierarchically. The researcher needs to specify the number of clusters to be extracted from the data either heuristically (e.g., visually inspecting) or by using fit statistics. Once the clusters are determined, they can be described with respect to the variables (model states) required to create the clusters. The clusters can be used both as independent and dependent variables in further analyses. However, they should be used with caution, since there is no generally accepted definition of a cluster and therefore also a different clustering technique can easily yield to a completely different clustering structure.
After performing OMA with equal, user-defined costs assigned to indel operations (i.e., insertion and deletion), individuals are allocated to clusters based on a distance measure (such as Ward's distance). Because the results can be sensitive to the chosen indel and substitution costs, it is good practice to perform sensitivity analyses with various indel costs (e.g., 0.5, 1.0 and 1.5), and to use both a constant substitution matrix as well as a matrix based on the frequency of transitions. The number of clusters can be assessed by two measures of average cluster linkage: the Calinski-Harabasz pseudo-F index (Caliński and Harabasz, 1974) and the Duda-Hart index (Duda et al., 2001). These statistics help determine the optimal number of clusters by comparing the ratio of the within-cluster distances to the between-cluster distances. The Duda-Hart index could be preferred as it also produces a pseudo T-statistics. Once the optimal number of clusters is established, cluster assignment can be further applied as the response variable in a multinomial logistic regression model. For further discussion on clustering, see Brzinsky-Fay et al. (2006).
This study demonstrates most of the above steps of SA. We analyze labor market transition sequences over a period of 16 years, from age 55 to 70. As an example, the sequence EEEEEEEUPPPP-POOO means that the individual was working and employed (E) for seven years, unemployed (U) for one year, drawing a partial old-age pension (P) for five years and, finally, on a full old-age pension (O) for three years. With a detailed microsimulation model, it is easy to see that there are several possible transition sequences, and few individuals experience identical ones. OMA is applied to aggregate sequences and to reduce the number of possible sequences. Clustering is also demonstrated, but without a detailed focus on the exact number of clusters.
In this study, the computations were carried out using the R software with an accompanying TraMineR application, a user-friendly and stable package for analyzing and visualizing life course sequences (see Gabadinho et al., 2011). We also used another R package TraMineRextras by Ritschard et al. (2019), which provides some additional functions. The auxiliary package includes several functions that can be useful for microsimulation practitioners. Both R packages offer analysis and visualization tools for either state or event sequences. Appendix A.1 gives an example of the R programming code.

Overplotting
Due to individual visualizations of the sequences, like the sequence index plot (Figure 1), there are limits to the number of observations that can be graphically displayed on a computer screen without blurring. It is possible to render thousands of individual transition sequences, but detailed information can get distorted. Therefore, it is good practice to take a small sample of the possibly high-frequency simulated dataset. Brzinsky-Fay (2014, p. 270) advises that, to show full information, the sequence index plot should contain 400 individuals at most. With a high-frequency sample, the TraMineR package automatically displays the most common sequences.

Clustering the sample
The sample can be clustered by using an optimal matching technique that is employed to compute the optimal matching distances, using substitution costs based on transition rates observed in the data. The clustering is done with the R package WeightedCluster, which includes some further options for clustering. There are six clustering methods for different applications. In this study we have used Ward (1963) method to illustrate this functionality.

Sequence analysis compared to trajectory analysis
As was demonstrated in Salonen et al. (2019), trajectory analysis (TA) can be useful in illustrating dynamic microsimulation outcomes. Which technique -SA or TA -is preferred if both give similar possibilities in visualizing simulation model transitions and testing results? Although both techniques can be used to study similar questions, they differ in many respects.
TA has its roots in finite mixture modeling, which gives a sound statistical foundation for dividing the sample into sub-populations. Since finite mixture modeling is based on well-established statistical theory, statistical inferential tools such as information criteria BIC can be used to select the correct number of latent sub-populations. SA on the other hand uses a hierarchical clustering approach to subset the sample. The technique does not include exact objective criteria to select the correct number of sub-populations. In fact, selecting the number of sub-populations in SA is slightly more heuristic.
The range of possible probability distributions is wide in TA. It can handle many kinds of distributions: normal distribution, but also other members of the exponential family are in frequent use, among others. In SA, the analytical focus is on nominal outcomes. In order to use it, the outcome of interest must be a specifically nominal variable or transformed into such. Another issue related to the nature of the outcomes is related to the interleaving of states. In typical univariate TA, one outcome (e.g. employed) is analyzed at a time. However, multivariate TA modeling allows several outcomes to be analyzed simultaneously (e.g. employed, studying, unemployed, on sick leave). In SA, the question of interleaving states is more complicated. The obvious practical approach then is to define an exact unambiguous state for every relevant labor market state that an individual can have (employed, studying, employed while studying, etc.) during a single observation period or time point. This can potentially lead to a range of classes.
In essence, TA is about modeling the mean, where a regression mean model is fitted into subpopulations. All the common statistical properties of the regression model are available for further analysis, such as model estimates and confidence limits. There are also further possibilities in analyzing the group probabilities using multinomial logistic regression. SA on the other hand focuses on grouping the similar individual transition sequences, without concepts of mean modeling.
Dynamic microsimulation sets the landscape for longitudinal study-designs. The two techniques differ in this respect. TA grouping and mean trajectories are influenced by the number of longitudinal measurements and number of individuals in the sample. For example, the information content of a short follow-up is different compared to in a long follow-up (e.g. working life), affecting the trajectory solution. SA shows the individual transition sequences in detail regardless of follow-up time. It is further noted that in SA, the clustering is made hierarchically, that is, if the number of clusters is increased from k to k+1, one of the k clusters is split into two parts. In TA, when increasing the number of clusters a new solution is calculated and the solution is not strictly hierarchical.
Due to visualization of results, SA is in practice limited to a relatively small sample of hundreds of observations. TA on the other hand can easily handle large datasets, though a high-frequency dataset including millions of individuals is not recommended due to model solving issues and processing time. The precondition for using both methods is good sample design, for example simple random sampling.
Regarding the model validation or model testing, both techniques can reveal possible misspecification of the microsimulation model. TA gives overall developmental information even in small subgroups, while SA gives information that is much more visually detailed.

The ELSI microsimulation MODEL
ELSI is a dynamic microsimulation model (Tikanmäki et al., 2014;Tikanmäki and Lappo, 2020;Dekkers and Van den Bosch, 2016) that is used to assess the development of the statutory pensions in Finland over years 2012-2085. The dynamic ageing model has been developed and maintained at the Finnish Centre for Pensions.
The ELSI model has been designed to assess future earnings-related and national pensions. An example of its use is found in Tikanmäki et al. (2019). The model can also be used to analyze changes in a pension system and in the underlying demographic or macroeconomic conditions. Among other things, the ELSI model has been applied to assess the distributional effects of the Finnish pension reform in 2017 (Tikanmäki et al., 2015). The Finnish pension system is mainly based on pension rights accrued on the basis of life-time earnings. The ELSI model is based on individual-level information and calculations of pensions received in one's own right. The model comprises both retirees and those still working. It simulates each individual's adult working life, that is, labor market transitions before retirement.
Most of the material is drawn from administrative records maintained by the Finnish Centre for Pensions and the Social Insurance Institution of Finland. Information on educational level from Statistics Finland is also added to the model. The ELSI model runs total Finnish adult population. Deceased people remain in the model and a new cohort as well as new immigrants enter the model each year. Consequently, the population increases over the course of the simulation.
The ELSI model has a modular structure. There are no feedback loops from later to earlier modules. The simulation starts from the population module, followed by the earnings module, the pension module, and the taxation module. The final module (the results module) brings the results together.
The population module has several functions. It simulates population and labor market transitions as well as changes in education. The population module is based on transition probabilities that are estimated from historical data for 2010-2017. The module also uses Statistics Finland's official population projection to replicate general trends in the sample population. Transition probabilities, with one-year time intervals, are by and large deterministic, that is, based on exogenous information.
In the population module, we simulate a new population or labor market state for each individual based on transition probabilities. There are 21 states in the model.
The labor market transitions are of the Markovian type, which means that the transition probabilities are based on the current state rather than former history. However, it is possible to add memory to a Markov process by extending the state space. For instance, there are three different active states in ELSI: one for those employed in the first year, another for those employed in the second year and a third one for the rest. Hence, unemployment risks may be higher for those who do not yet have an established labor market position. Other exceptions to the Markov principle are described in detail in Tikanmäki and Lappo (2020).
Education is also simulated in the population module. Post-basic education dynamics is based on age and gender-specific transition probabilities. Changes in education level are possible at any age, although they are not very common after the age of 35.
The transition probabilities are updated each simulation year using the population level information produced by the semi-aggregated long-term projection (LTP) model (see Tikanmäki et al., 2019). There is thus a simple alignment of microsimulation outcomes to macro level aggregates (see Tikanmäki and Lappo, 2020).
In a typical simulation, the population module is followed by the earnings module, the earningsrelated pension module, the national pension module and the income taxation module. In this study, we use the results of the population module only. Subsequent modules are described in detail in Tikanmäki and Lappo (2020).
After the simulation run, the results are analyzed in the results module, which calculates the aggregate results over the course of the simulation, based on individual-level outcomes. Measures of the distribution (mean, percentage points, Gini coefficient) of pensions can be produced by ex ante classifiers such as gender, level of education and year of birth. Aggregate measures on the duration of working life and partition of the life course into active and inactive stages are also calculated in the results module. The module collects individual-level output data containing information on, for example, labor market state, wage earnings, residence, education level, pension earnings, pension benefits, working life and pension accrual. Therefore, the material is also available for the statistical analysis illustrated in this study. The proposed statistical technique can be used with many other outcomes, as well. In the following analysis we use simulated individual-level data and illustrate the labor market transitions near retirement. With SA, it would be possible to analyze several cohorts at the same time, as long as the data is longitudinal. As similar longitudinal panel data is produced in many other dynamic microsimulation models, the proposed technique could be interesting also for other microsimulation practitioners.

Labor market transitions in ELSI
The individual labor market transitions over the simulation period 2012-2085 are stored in the output data. This data can be used to construct the life course for a range of cohorts. Initially the model included 21 labor market states, which were aggregated to 12 states for this study. Table 1 shows the states included in the subsequent analysis.
In this study, we focus on cohorts born in 1970, 1980, 1990 and 2000. For illustrative purposes we have obtained a subset of around 400 individuals per birth cohort by simple random sampling. We could illustrate various different phenomena over the life course, such as early career labor market attachment by gender and level of education, or labor market integration of simulated new individuals, such as immigrants. However, in this study we focus on the life stages near retirement. This late stage of a lifespan is modeled in detail in ELSI and is thus a natural and substantially interesting example.
The usual way to study model transitions is to count and inspect the distribution of cases in different model states at a certain age. A typical labor market state distribution by age, which is usually used to visually validate model transitions, is given in Appendix A.3. Such tables are laborious to work with, especially with several cohorts. In addition, the tables do not illustrate sub-populations within a cohort in detail.

Transition sequences in microsimulation
This section shows how to illustrate labor market transitions near retirement in simulated data. Earlier stages of the life course could be visualized, as well, but retirement is the most carefully modeled stage in ELSI, and thus an interesting case to demonstrate the proposed technique. SA can be visualized using several measures. For microsimulation practitioners interested in visualizing labor market transitions and validating model transitions in general, some useful functionalities are available. The programming statements yielding the following illustrations are given in Appendix A.1.

Sequence index plot
The first analysis shows the individual transitions (the tiny horizontal line in Figure 1). Figure 1 has three dimensions: individual, age and labor market status. The sequence index plot shows every individual as long as the total number of individuals (vertical axis) does not exceed 400. In this example, the number of individuals is 376, for whom the plot visualizes the true transitions from age 55 to 70 (horizontal axis). The individuals are sorted according to their labor market state at age 55. It would also be possible to sort individuals at age 70, which would yield a slightly different, retrospective view of the transition patterns. Figure 1 shows several things. First, the flexible retirement age for the cohort born in 1970 is 66 years; working is possible until age 69. We see that retirement at the earliest possible age is common, yet we also see some individuals postponing retirement because of positive economic incentives. Second, full employment is the mainstream state at age 55, but after that, there are several possible transition paths. Unemployment, sickness spells and other career breaks become more common before retirement. Retirement on a disability pension also increases after age 55. Along with disability, the share of the deceased increases by age. Finally, Figure 1 also reveals careers ending in unemployment some years before retirement (a persistent feature of the Finnish labor market.
For microsimulation practitioners, Figure 1 provides a quick overview of the actual transitions. It can be used to visually validate model assumptions and parameters. In validating ELSI, the share of the inactives after reaching the retirement age was discussed. However, the proportion is due to the handling of the model population and of the people living outside the country for whom the earningsrelated old-age pension is paid at the latest possible age. This is partly a technical assumption and partly an empirical fact, as illustrated by SA.

Most common transitions
The maximum number of sequences is defined by the number of individuals in a given cohort. The optimal matching technique uses aggregates and joins individuals into typical sequences. For example, the transition sequences of the cohort born in 1970 can be classified into 24 groups with more than two cases in each group. Table 2 shows the five most common sequences and their shares in the sample. The interpretation of the sequences requires clarification. The most frequent sequence (15.4%) for the 1970 cohort is that the individuals (58 cases) are employed for 11 years before retiring on an old-age pension for 5 years, so technically, the sequence is EEEEEEEEEEEOOOOO. Table 2 illuminates a number of substantial things. First, a transition from employment into old-age retirement is by far the most common sequence for the selected cohorts. State counts further indicate that the 1970 cohort will retire on an old-age pension at age 66, and subsequent cohorts one to two years later, as it should be according to the assumptions of the ELSI model. Second, the second most common sequence among the selected cohorts collects the inactive-to-old-age pension transitions. Finally, the sequences of later old-age retirement are also becoming more common among younger cohorts.
For microsimulation practitioners, Table 2 offers a more aggregated view of the model transition classes. A good way to validate simulated model transitions would be to look at a broader list of transition sequences of selected cohorts (or other classes) in order to check the shares and, thus, the logic of the model transitions.

Transition rates
Transition rates between states give numerical estimates of model transitions. Table 3 shows a matrix where each row gives a transition distribution from the associated original state in t to the states in t+1 (the figures add up to one in each row). The alphabets are explained in Table 1.
First, Table 3 implies that transition probabilities within the labor market state (diagonal elements) have values close to one, meaning that an individual in a given state at time t has a great probability to remain in the same state at time t+1. For example, transitions from bap to bap (drawing basic pension) over study ages are highly stable (97.0%), whereas transitions from UNE to UNE (staying unemployed) indicate higher instability (65.4%). The instability of transitions from EMP to EMP (staying employed) is 87.0%, indicating the various risks around the employed. Second, transition probabilities between states are also displayed in Table 3. Although a transition from UNE to UNE is the most likely one, there are also other possible transitions, such as from UNE to EMP (14.9%), from UNE to oap (10.8%) and from UNE to INA (6.3%). The probability of staying employed is high, yet there are notable transition probabilities from EMP to oap (5.2%), from EMP to INA (4.0%) and from EMP to UNE (2.4%). In validating microsimulation model transitions, similar tables could be useful in comparing simulated cohorts.

State distribution plot
The state distribution plot (or status proportion plot) offers another perspective on model states. The plot can be drawn by any interesting ex ante classification rule to make substantial comparisons within a cohort. Figure 2 show the shares of men (44.9%) and women (55.1%) in the sample. In essence, the plot shows the state distribution, that is, the share of statuses by time points (age). Age is shown  on the horizontal axis, whereas the vertical axis is defined by a percentage scale. Figure 2 shows the same cohort and individuals as Figure 1, but by gender. Beside gender, Figure 2 has two additional dimensions: age and labor market status. Here are not clustered and transition sequences are not part of this perspective. Figure 2 shows that the share of employed at age 55 is relatively high. The share is approximately 80 per cent for women and slightly smaller, about 65 per cent, for men. At age 66 (the retirement age), about 60 per cent of the men and women retire. At age 70, about 80 per cent of the men draw an old-age pension, 16 per cent are deceased and 4 per cent draw a national pension. For women, the shares are different. About 92 per cent draw an old-age pension, 7 per cent are deceased and about one per cent draw a national pension. The gender difference in the mortality assumption is visible here as the share of the deceased is greater already at age 55. Figure 2 also shows the increasing shares of disability pensioners with rising age.
For microsimulation practitioners the state distribution plot offers similar possibilities to validate model transitions as does Appendix table A.3. The share of cases in different model states at a given age can be compared to auxiliary information sources.

Mean time in state
A useful measure in comparing classes such as gender or level of education is the mean time spent in each state. Figure 3 shows the mean estimates by education. The dataset is split by the level of education. One group consists of individuals with at least a secondary education (Basic or Secondary ed.), and another group consists of people with a higher-level education (Low or High univ.). There are slightly more people with a lower-level education (54.5%) than a higher-level education (45.5%).
As expected, the employment attachment is stronger among the highly educated who have more than eight years of employed time (EMP). For those with a lower-level education the employed time is under six years. As a result, those with a lower-level education spend more time on a full disability pension (fdp) and as inactive (INA).

Clustering of the sample
The aforementioned sequence aggregation is preliminary clustering. The sample can be divided into sub-groups. To make a typology of the transition sequences, a Ward hierarchical clustering of the sequences from the optimal matching distances are made and for each individual sequence, the cluster membership of the four-group solution is retrieved. Naturally other groupings are possible, as well as a different number of clusters. The clustering makes it possible to focus on the possible latent groups within the sample. The clustering could also be useful in illustrating substantial topics. In the following, we have named the clusters heuristically. Figure 4 shows that the largest cluster (Employed 72.3%) consists mainly of those whose employment is strong when approaching retirement. There are two clusters of equals sizes. One consists of the deceased and individuals drawing a basic pension only (Deceased 10.9%) and another of the inactives (Inactives 10.1%). The smallest cluster (Disabled 6.6%) consists of cases with a disability pension before the old-age pension.

Trajectory analysis of employment
Trajectory analysis is a natural statistical reference point for sequence analysis, but what added value does SA provide compared to TA? As was shown in chapter 4, SA is a technique that can illuminate data contents such as model transitions in great detail. On the other hand, TA is commonly used in identifying latent sub-groups in sample and visualizing mean developments in outcome(s). Next, we will show how TA can be used to analyze the same labor market transition data.

Modeling developmental trajectories
Following the practices in Salonen et al. (2019), a TA was done for analyzing employment near oldage retirement for a cohort born in 2000. Using the example data (findata) and transforming the outcome variable (EMP transformed into binary variable: 1=Employed, 0=Not employed) and independent variables slightly, a univariate TA can  be done. Selecting the number of sub-groups using BIC criterion (k=2 to 6: -2316.8, -1980.4, 1888.8, 1832.7 and -1819.2) indicates that a six-group solution yields the best statistical model fit. By subjective evaluation of the solution, the results are reasonable. Figure 5 shows the employment trajectories, that is, the group averages of six sub-groups. We can see that there are two groups with sizes 27% and 7% with relatively high and stable probabilities of employment until old-age retirement. There are also two groups with sizes 11% and 24% with gradually decreasing probability of employment with age. Finally, there are groups with sizes 25% and 7% with persistently low probability of employment.
TA is most useful in this kind of analysis, focusing on one or just a couple of analysis variables. The analysis reveals the latent groups and associated developmental trajectories. It is possible to formulate a multivariate TA (e.g. Nagin et al., 2018;Nummi et al., 2017) to analyze several outcomes simultaneously. However, this kind of analysis was not successful with the available measures. Furthermore, with TA it would be possible to analyze the group composition and even model factors affecting group membership.
In analyzing model transitions, SA gives more detailed information (at individual level) compared to TA. SA also captures a range of model states in the figures (12 in the above examples). SA also provides interesting additional measures, as was shown in chapter 4, which are lacking in TA. If detailed individual-level information is not necessary, TA could be more useful with certain outcomes. For example, focusing on monetary measures, such as wages and pensions, could better be analyzed with TA. In addition to monetary measures, the TA can also be used to illuminate developmental trajectories in nominal variables such as level of education.

Conclusion
The results of dynamic microsimulation oftentimes include simulated dataset(s), which entail individual level information about labor market or population transitions over a simulated time-period. For example, the data contents could include labor market patterns related to employment, unemployment, sickness spells or retirement. Population patterns such as level of education, occupation selection, or family configurations are also common elements in dynamic microsimulation. All the information contents of simulation must be modeled sensibly and consciously, yielding credible heterogeneity within the simulated population. In fact, microsimulation is a controlled framework in which to create biographical trajectories.
Sequence analysis (SA) can be an interesting tool for microsimulation practitioners when investigating simulated heterogeneity and revealing possible latent transformation patterns. In a nutshell, SA includes three steps. First, the data is coded, divided into subsets, and formatted for the core program (e.g., R). Second, the sequences are counted and usually compared by means of optimal matching analysis. Finally, typologies of transformation sequences are obtained by clustering analysis. These steps were presented in this study.
This study showed, in detail, how to use SA with simulated data from the Finnish ELSI model. The examples given were based on transitions near retirement. Beside retirement modeling or labor market modeling in general, SA could also be applied with other dynamic models such as firm or farm models as long as the models simulate states in discrete time steps.
There is another statistical technique called trajectory analysis (TA), which can be used together with SA to analyze microsimulation outcomes. SA gives a detailed overview of individual model transitions, whereas TA is applicable in visualizing sub-population mean developmental trajectories. For microsimulation practitioners, the simulated outcomes determine which statistical technique is most useful. Certainly, SA and TA complement each other.
In practice SA can be used to visualize microsimulation results, and to validate simulation. The sequence index plots are a powerful tool in visualizing transition patterns. The model validation can also benefit from visual inspection of sequences, but more from the subsetting and grouping options, which allow for a study of the coherence of simulated groups.
SA did not reveal any serious misspecification in the ELSI model. The labor market transitions in ELSI are driven by ex ante defined transition probabilities. This kind of modeling is sensitive to misspecification. Therefore, a clustering technique like SA is useful in model validation.
This study showed certain possibilities and one practical application of the TraMineR and TraMineRextras packages in a microsimulation context. There are further useful functions, but they are beyond the scope of this study.  Total  100  100  100  100  100  100  100  100  100  100  100 100  100  100  100  100