Learn R Programming

TraMineR (version 1.1)

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
The subsequences to order. To get a list of subsequence see seqefsub
group
The group variable to discriminate
method
The test, bonferroni or chisq
pvalue.limit
Can be used to filter the results. Only subsequences with p-value lower than this parameter will be kept. If NULL all subsequences are returned (regardless there p-value).

Value

  • Returns a specific objet of type subseqelistchisq (subtype of subseqelist) that can be plotted and printed.
  • subseqList of subsequences
  • labelslabels of groups variables
  • constrainttime constraints usued to compute subsequences see seqeconstraint
  • seqeThe event sequences that were used to compute the test
  • indexIndex of susequence
  • dataA data.frame with the support of each subsequence, index (original order), two column per group with frequencies and pearson residuals

Details

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

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