Finding representative sets by group and their quality statistics.

Share:

Description

This function determines representative sequences by group and returns the representatives by group and/or the quality statistics of the representative sets. The function is a wrapper for the TraMineR seqrep function.

Usage

1
seqrep.grp(seqdata, group = NULL, mdis = NULL, ret="stat", ...)

Arguments

seqdata

state sequence object as defined by seqdef.

group

group variable. If NULL a single group is assumed.

mdis

dissimilarity matrix. If NULL the "LCS" dissimilarity matrix is computed.

ret

What should be returned? One of "stat" (default), "rep" or "both".

...

additional arguments passed to seqrep .

Details

The function is a wrapper for running seqrep on the different groups defined by the group variable.

Value

If ret="stat", a list with the quality statistics for the set of representatives of each group.

If ret="rep", a list with the set of representatives of each group.

If ret="both", a list with the two previous outcomes.

Note

This function is a pre-release and further testing is still needed, please report any problems.

Author(s)

Gilbert Ritschard

See Also

seqrep

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(biofam)
biofam <- biofam[1:100,]
biofam.lab <- c("Parent", "Left", "Married", "Left+Marr",
"Child", "Left+Child", "Left+Marr+Child", "Divorced")
biofam.short <- c("P","L","M","LM","C","LC","LMC","D")
biofam.seq <- seqdef(biofam[,10:25], alphabet=0:7, states=biofam.short, labels=biofam.lab)
dist <- seqdist(biofam.seq, method="HAM", with.missing=TRUE)

seqrep.grp(biofam.seq, group=biofam$plingu02, mdis=dist, trep=.2, tsim=.1)
seqrep.grp(biofam.seq, group=biofam$plingu02, mdis=dist, ret="rep", trep=.2, tsim=.1)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.