View source: R/assoc.domains.R
assoc.domains | R Documentation |
Computes various measures of association between dimensions of multidimensional sequence data.
assoc.domains(dlist, names, djsa)
dlist |
A list of dissimilarity matrices or dist objects (see |
names |
A character vector of the names of the dimensions of the multidimensional sequence data |
djsa |
A dissimilarity matrix or a dist object (see |
Nicolas Robette
Piccarreta R. (2017). Joint Sequence Analysis: Association and Clustering, Sociological Methods and Research, Vol. 46(2), 252-287.
library(TraMineR)
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)
## Using Hamming distance
mcdist <- seqdistmc(channels=list(child.seq, marr.seq, left.seq),
method="HAM")
child.dist <- seqdist(child.seq, method="HAM")
marr.dist <- seqdist(marr.seq, method="HAM")
left.dist <- seqdist(left.seq, method="HAM")
## Association between domains
asso <- assoc.domains(list(child.dist,marr.dist,left.dist), c('child','marr','left'), mcdist)
asso
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.