# How to interpret p-values in output of seqecmpgroup()?

The seqecmpgroup() function returns a table that, among other things, include p-values for each identified subsequence. How should these be interpreted?

I can see two options:

1. Is the null hypothesis that the subsequence does not discriminate at all between the groups?
2. Or is the null hypothesis that the support value is zero? If so, what does the support value indicate?

The output can be seen below:

      Subsequence     Support     p.value statistic index      Freq.1
1      (FA)-(IN)-(FA) 0.004807692 0.002293660 12.155213   538 0.000000000
2 (NR)-(TR)-(EX)-(IN) 0.004807692 0.002293660 12.155213   685 0.000000000
3 (NR)-(TR)-(IN)-(IN) 0.004807692 0.002293660 12.155213   687 0.000000000
4      (IS)-(IS)-(NR) 0.019230769 0.006788125  9.985161    98 0.040322581
5      (FA)-(NR)-(QU) 0.012820513 0.009031434  9.414088   172 0.008064516
Freq.2     Freq.3    Resid.1   Resid.2   Resid.3
1 0.000000000 0.02419355 -1.0919284 -1.100699  3.113347
2 0.000000000 0.02419355 -1.0919284 -1.100699  3.113347
3 0.000000000 0.02419355 -1.0919284 -1.100699  3.113347
4 0.007936508 0.00000000  2.3951978 -1.292885 -1.544220
5 0.003968254 0.04032258 -0.6614769 -1.241085  2.704727

Computed on 624 event sequences
Constraint Value
countMethod  COBJ

• Rather than voting to close, can you provide feedback to improve the question? I think asking about the specific interpretation of these parameters is a valid question. Jan 28 '15 at 18:04

The p-value is for testing the null hypothesis that the subsequence is not discriminating.

Actually, the discrimination is tested with the Pearson Chi-square of the table that cross tabulates the presence/absence of the subsequence (row of the displayed table) and the group factor (which has 3 levels in your example). A low Chi-square value (in column 'statistic') means that the distribution among the levels of the factor is independent of the presence or not of the subsequence, and therefore, that the subsequence is not discriminating. A low p-value, say less than 5%, means that the observed Chi-square is too large to accept the null hypothesis. The lower the p-value, the more discriminating is the subsequence.

As for the shown support, it is the relative support of the subsequence in the whole data set, i.e., the proportion of all sequences that contain the subsequence. It would be the same whatever the group factor and is by noway an indicator of the discrimination power. The support in each group are given in columns 'Freq.i' and it may instructive to compare them with the overall support.

If you go to page 109 of the User Guida ( http://mephisto.unige.ch/pub/TraMineR/doc/TraMineR-Users-Guide.pdf ) they say that they use a chi-squared test. A chi-squared test has a null hypothesis that the statistic follows a chi-distribution. Meaning that the lower the p-value is more likely it does not follow a chi-squared. I believe it means that the null hipothesis is that the subsequence does not discriminate.

Also there is a statement in the function description http://mephisto.unige.ch/traminer/doc/seqecmpgroup.html :

pvalue.limit -> Can be used to filter the results. Only subsequences with a p-value lower than this parameter are selected. If NULL all subsequences are returned (regardless of their p-values).

If you can set a upper bound for p-limits, in a function that aims on retrieving discriminating subsequences, is it is likely that low p-values imply discriminating sequences. Reassuring that the null hipothesis is that the subsequence does not discriminate (hence it's rejection, by low p-value, brings evidence of discrimination).

Hope it helps

• In general it makes sense that the low p-value indicates a "discriminating subsequence". However, just as likely an explanation is that the p-value in this case is a test of the "Support" parameter, which also indicates how discriminating a subsequence is. However, the exact definition of the support parameter is unknown to me. Jan 28 '15 at 18:37