Solved – How to describe multi-channel sequence objects in TraMineR

rsequence analysistraminer

I have created a multi-channel object here:

https://github.com/aronlindberg/VOSS-Sequencing-Toolkit/blob/master/creating_multichannel_object.R

However, when I try to use various functions to describe the multi-channel sequences, I get errors saying that what I'm trying to process is not a sequence object.

I created my sequence object with seqdistmc(). Is it OK to then convert this object to a common sequence object using seqdef()? This would allow me to use other TraMineR functions to describe my sequences.

Best,
Aron

P.S. Can someone with over 300 in reputation create the tag "traminer" please?

Best Answer

TraMineR has no multichannel object.

The seqdistmc function does not create a multichannel sequence object but computes a matrix of pairwise dissimilarities between multichannel sequences, which you pass as a list of state sequence objects (each being a channel). This matrix can be used for dissimilarity based analyses such as clustering or discrepancy analysis.

If I understand well, what you want is displaying the list of state sequence objects. Currently there is no function to display such a collection in a single step. You have to do that yourself. As an example, I use the three channels created in the example of the seqdistmc online help.

data(biofam)
## Building one channel per type of event left, children or married
bf <- as.matrix(biofam[, 10:25])
children <-  bf==4 | bf==5 | bf==6
married <- bf == 2 | bf== 3 | bf==6
left <- bf==1 | bf==3 | bf==5 | bf==6
## Building sequence objects
child.seq <- seqdef(children)
marr.seq <- seqdef(married)
left.seq <- seqdef(left)

layout(matrix(c(1,2,3,4,5,6),3,2,byrow=TRUE))
seqdplot(child.seq, withlegend=FALSE)
seqlegend(child.seq)
seqdplot(marr.seq, withlegend=FALSE)
seqlegend(marr.seq)
seqdplot(left.seq, withlegend=FALSE)
seqlegend(left.seq)

Instead of layout you can indeed use par(mfrow=c(3,2)) to split the graphical area. In any case you have to specify withlegend=FALSE and display the legend separately as in the example.

Hope this helps.

Gilbert

Related Question