I tried (unsuccessfuly) to identify the individual corresponding to a representative
sequence, using function seqrep()
from the R package TraMineR.
I read Gabadinho, A., and G. Ritschard (2013), "Searching for typical life trajectories applied to childbirth histories", In Levy, R. & Widmer, E. (eds) Gendered life courses - Between individualization and standardization. A European approach applied to Switzerland, pp. 287-312. Vienna: LIT.
I was able to visualize the representative sequence(s) of my sequence data using seqrplot()
, with different parameters in seqrep
("freq", "density",...
).
My aim is to identify in the associated survey database the individual(s) to whom the representative sequence(s) correspond(s) in order to describe their (i.e. social) characteristics.
I wasn't able to do this step.
Thank you for your help. Best regards, Jacques-Antoine
If I understand well, you want the indexes of the representative sequences. Since the representative sequences are taken from the dataset, they belong to the dataset. We can identify them by searching for the sequences that are at a distance 0 from the representative. However, a representative sequence may occur several times in a same dataset, i.e., there may be more than one sequence at a distance 0 from the representative.
Here I show using the
biofam
data how you can identify the indexes of the first occurrence of each representative in the dataset.The first occurrence of the first representative sequence corresponds to the case 60, the second representative to case 31, the third to case 1, and the fourth to case 163.
Each representative sequence occurs more than once. For example the occurrences of the first representative are: