# minimum criteria for datasets used with TraMineR

I posted this to the TraMineR user list and it was suggested that it would be appropriate to post it here as well.

Any suggestions as to how to determine the minimum dataset size and missingness characteristics to which TraMineR may be applied sensibly would be helpful. I looked for information in documentation but did not see anything that I could use as a heuristic.

I am using TraMineR to analyze 5 years of BMI observations, coded as a four-level ordinal categorical variable for 5046 elementary school children (grades K-5). Only 414 of these have 5 observations ( ~ 56% of the K, 1 students measured at time 1 who could have had been measured in years 1 to 5). Here are have two related, if not well-stated, questions:

1. Is it legitimate to focus only on complete cases since I only have 5 data points and high cumulative natural attrition? Testing the complete cases against all cases reveals no substantive difference in values of predictors. The analyses from complete cases are informative, while including all cases, regardless of imputation choice, just makes things noisy. I tried admitting only sequences of 4 or 5, but results were still noisy.

2. Is five too short a sequence object to use with TraMineR, given the imputation patterns required by the full dataset, regardless of whether they are due to planned missingness or MAR?

3. Below is the number of cases with from 1 to 5 observations.

      1    2    3   4   5
1846 1287 869 630 414


TraMineR is a great tool. I want to make sure I am using it appropriately.

There are two aspects in that question, namely

1. What is the minimal dataset size for a sensible sequence analysis?
2. What is the maximum number (or proportion) of unknown elements that we can admit in each sequence?

And the answer depends largely on what you want to do.

Let us first discuss the dataset size.

The size of categorical sequence datasets includes three dimensions, namely

• the number $n$ of sequences
• sequence lengths $\ell$
• the size $a$ of the alphabet

TraMineR is basically an exploratory tool and as such is useful as soon as it can help discovering or highlighting non trivial characteristics of the observed sequences.

Longitudinal characteristics (number of transitions, longitudinal distribution, longitudinal entropy, complexity index, turbulence, ...) make sense for $n=1$, but will only be useful for sequences of some length, say $\ell=4$ or 5. Longitudinal measures may have limited interest when the alphabet contains only 2 elements.

For cross-sectional characteristics (modal state, entropy, ...) size conditions are similar to those required to give sense to the distribution of a categorical variable. Again, interest increases with the size of the alphabet.

Regarding dissimilarity-based analysis, the clustering of sequences is not different from the clustering of any other kind of data. It becomes very useful when $n$ exceeds say 100 or 150. Likewise, representative sequences prove useful when $n$ exceeds say 50 or 100, even though they can be computed and make sense for smaller sizes $n$. Discrepancy analysis is different. It is inferential and relies on statistical significance. It may be hard to find significant group distinction when $n$ is small.

If the sequences are analyzed with an inferential perspective, then the question becomes for which $n$ can we extend the characteristics of the observed sequences to the whole population. Assuming the (possibly weighted) sequences are representative of the population, the minimal required $n$ will depend on the variability of the sequences. The higher the variability across sequences, the larger the required $n$. With TraMineR, you can compute (with dissvar) a pseudo variance or pseudo deviance $s$ given the dissimilarity measure. For a given precision $r$ (maximal dissimilarity we may tolerate between two patterns to consider them as similar), a very rough solution could be $n> 2(r/s)^2$.

Regarding the number of unknown elements (missing values)

Plots (i-plot, d-plot, ...) can be useful just to highlight the presence and distribution of the unknown elements in the sequences.

Then, if the aim is to study trajectories, sequences with too many unknown elements would not carry any useful information. On the other hand, considering only complete sequences we may lose too many cases and even worth lose representativeness. A solution I have often adopted is to retain only sequences with at most a given percentage, say 30% of missing states.

An alternative that could be useful for the situation described in the question, would be to successively run a separate analysis by considering only sequences up to length 3, 4, 5, and interpret the results conditionally for sequences of at lest that length.

It depends on what you want to do with the sequences. You can generate index plots and sequence statistics using any of the samples and missing data. Clustering to define groups will work as well.

Perhaps a more important question is what are you trying to learn from sequences that cannot be done using the BMI percentiles as longitudinal numeric data? You lose information when categorizing the BMI percentiles. I also considered sequence analysis with my BMI data from kids and decided against categorical data analysis for this reason.

• The motivation for categorical analysis is twofold: Jan 22, 2014 at 22:08