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
I assume that you are using sampling weights to correct for representativity bias. Please note that some "data providers" require you to use the weights in your publications.
In my opinion, you should always use weights for descriptive analysis in order to get unbiased results. I think that there are more consensus for this kind of analysis. Descriptive analysis includes cluster analysis, sequences visualization, computation of transitions rates (and hence substitution costs based on them), for instance. For weighted cluster analysis, you can have a look at the WeightedCluster
library and manual.
Regarding the weights to use, I would recommend to use longitudinal weights, since the sequences are defined for the whole period, but it depends on the exact weight definition. For a more general answer, you need to answer the following questions:
- What sample do I have (at what time, and so on)?
- to which population do I want to generalize?
In some panels, longitudinal weights use the sample defined by wave t and generalize it to the population at wave one. This is what you want if you want to follow the evolution at wave one.
Best Answer
This is possible as long as your sequence objects share a same alphabet.
You do it by merging the two sequence objects into a pooled object, and then using
dissassoc
with the indicator of the original set as group argument. To illustrate, I first create two separate objects of female and male from the mvad sequence object:and merge the two objects into a single one
We create an indicator of the originating set (that should comply with the order of the sequences in
pooled.seq
)Now, we compute pairwise dissimilarities from the pooled object and get the discrepancy analysis by means of
dissassoc