Learn R Programming

TraMineR (version 1.6-2)

seqecmpgroup: Identifying discriminating subsequences

Description

Identify and order the most discriminating subsequences according to a given statistical test.

Usage

seqecmpgroup(subseq, group, method="chisq", pvalue.limit=NULL)

Arguments

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).

Value

  • An objet of type subseqelistchisq (subtype of subseqelist) with the following elements
  • subseqSorted list of found discriminating subsequences
  • seqeThe event sequence object on which the tests were computed
  • constrainttime constraints used for searching the subsequences (see seqeconstraint)
  • labelslevels (value labels) of the target group variable
  • typeType of test used
  • dataA data frame with columns support, index (original order of the subsequence) and a pair of frequency and Pearson residual columns for each group

Details

The following test functions are implemented chisq Pearson Independence Chi squared test. bonferroni Pearson Independence Chi squared test with Bonferroni correction.

See Also

See Also plot.subseqelistchisq to plot the results

Examples

Run this code
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])

Run the code above in your browser using DataLab