seqecmpgroup {TraMineR} | R Documentation |
Identify and order the most discriminating subsequences according to a given statistical test.
seqecmpgroup(subseq, group, method="chisq", pvalue.limit=NULL)
subseq |
A subseqelist object (list of subsequences) such as produced by seqefsub |
group |
Variable or factor defining the membership to the groups to discriminate |
method |
The required test, one of bonferroni or chisq |
pvalue.limit |
Can be used to filter the results. Only subsequences with a p-value lower than the value set for this parameter will be selected. If NULL all subsequences are returned (regardless their p-values). |
The following test functions are implemented
chisq
Pearson Independence Chi squared test.
bonferroni
Pearson Independence Chi squared test with Bonferroni correction.
An objet of type subseqelistchisq
(subtype of subseqelist
) with the following elements
subseq |
Sorted list of found discriminating subsequences |
seqe |
The event sequence object on which the tests were computed |
constraint |
time constraints used for searching the subsequences (see seqeconstraint ) |
labels |
levels (value labels) of the target group variable |
type |
Type of test used |
data |
A data frame with columns support, index (original order of the subsequence) and a pair of frequency and Pearson residual columns for each group |
See Also plot.subseqelistchisq
to plot the results
data(actcal.tse) actcal.seqe <- seqecreate(actcal.tse) ##Searching for frequent subsequences, that is, appearing at least 20 times fsubseq <- seqefsub(actcal.seqe, pMinSupport=0.01) ##searching for susbsequences discriminating the most men and women data(actcal) discr <- seqecmpgroup(fsubseq, group=actcal$sex, method="bonferroni") ##Printing discriminating subsequences print(discr) ##Plotting the six most discriminating subsequences plot(discr[1:6])