Questions tagged [traminer]

The R TraMineR library is a toolbox for exploring and rendering categorical sequence data such as sequences describing family life trajectories or professional careers. This "traminer" tag is intended for questions related to the usage including data preparation and output handling of TraMineR and its companion TraMineRextras, WeightedCluster, and PST packages.

TraMineR is an R-package for mining, describing and visualizing sequences of states or events, and more generally discrete sequential data. Its primary aim is the analysis of biographical longitudinal data in the social sciences, such as data describing careers or family trajectories. Most of its features also apply to non-temporal data such as text or DNA sequences. The package includes:

  • Handling of longitudinal data and conversion between various sequence formats
  • Plotting sequences (density plot, frequency plot, index plot etc.)
  • Individual longitudinal characteristics of sequences (length, time in each state, longitudinal entropy, turbulence, complexity etc.)
  • Sequence transversal characteristics by age point (transversal state distribution, transversal entropy, modal state)
  • Other aggregated characteristics (transition rates, average duration in each state, sequence frequency)
  • Dissimilarities between pairs of sequences (optimal matching, longest common subsequence, Hamming, Dynamic Hamming, Multichannel etc.)
  • Centro-type and heterogeneity measure of a set of sequences
  • Discovering and plotting representative sequences
  • ANOVA-like analysis of sequences and tree structured ANOVA from dissimilarities
  • Extracting frequent event subsequences
  • Identifying most discriminating event subsequences
  • Association rules between subsequences

Resources:

218 questions
7
votes
1 answer

Find specific patterns in sequences

I'm using R package TraMineR to make some academic research on sequence analysis. I want to find a pattern defined as someone being in the target company, then going out, then coming back to the target company. (simplified) I've define state A as…
Pedro Braz
  • 2,261
  • 3
  • 25
  • 48
7
votes
2 answers

Problem with big data (?) during computation of sequence distances using TraMineR

I am trying to run an optimal matching analysis using TraMineR but it seems that I am encountering an issue with the size of the dataset. I have a big dataset of European countries which contains employment spells. I have more than 57,000 sequences…
7
votes
1 answer

Displaying TraMineR (R) dendrograms in text/table format

I use the following R code to generate a dendrogram (see attached picture) with labels based on TraMineR sequences: library(TraMineR) library(cluster) clusterward <- agnes(twitter.om, diss = TRUE, method = "ward") plot(clusterward, which.plots = 2,…
histelheim
  • 4,938
  • 6
  • 33
  • 63
6
votes
1 answer

Creating a sequence object from SPELL data

I am trying to create a sequence object with seqdef using SPELL format. Here is an example of my data: spell <- structure(list(ID = c(1, 3, 3, 4, 5, 5, 6, 8, 9, 10, 11, 11, 12, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15,…
Maxim.K
  • 4,120
  • 1
  • 26
  • 43
6
votes
1 answer

An "asymmetric" pairwise distance matrix

Suppose there are three sequences to be compared: a, b, and c. Traditionally, the resulting 3-by-3 pairwise distance matrix is symmetric, indicating that the distance from a to b is equal to the distance from b to a. I am wondering if TraMineR…
POTENZA
  • 1,377
  • 3
  • 17
  • 20
6
votes
1 answer

Using Time Diary Data with TraMineR

I am trying to do sequence analysis using time-diary data (American Time Use Survey) using TraMineR in R. I have the data as SPELL data (id, start time, stop time, event) but I receive the following error when trying to convert it to STS or SPS…
mCorey
  • 295
  • 2
  • 9
5
votes
2 answers

Sequence index plots in ggplot2 using geom_tile( )

I'm trying to use ggplot to create sequence plots, for the sake of keeping the same visual style within my paper using sequence analysis. I do: library(ggplot2) library(TraMineR) library(dplyr) library(tidyr) data(mvad) …
Kenji
  • 571
  • 4
  • 20
5
votes
1 answer

Pretty dendrograms in R?

My dendrograms are horribly ugly, on the verge of unreadable, and usually look like this: library(TraMineR) library(cluster) data(biofam) lab <- c("P","L","M","LM","C","LC","LMC","D") biofam.seq <- seqdef(biofam[1:500,10:25], states=lab) ccost <-…
histelheim
  • 4,938
  • 6
  • 33
  • 63
5
votes
1 answer

Variable indel costs for sequences of unequal length

I am doing Sequence Analysis in TraMineR using the Optimal Matching algorithm. Unfortunately, my sequences are of unequal length due to right-censored data. The minimum length of my sequences is 5, the maximum length 11. The variations in length are…
5
votes
1 answer

Parallel computing for TraMineR

I have a large dataset with more than 250,000 observations, and I would like to use the TraMineR package for my analysis. In particular, I would like to use the commands seqtreeand seqdist, which works fine when I for example use a subsample of…
Flow
  • 735
  • 2
  • 7
  • 17
5
votes
2 answers

Multiple events in traminer

I'm trying to analyse multiple sequences with TraMineR at once. I've had a look at seqdef but I'm struggling to understand how I'd create a TraMineR dataset when I'm dealing with multiple variables. I guess I'm working with something similar to the…
maycobra
  • 417
  • 7
  • 15
5
votes
2 answers

Using "by" for creating multiple graph titles

I am trying to use "by" of "for" in order to create many subgraphs using one or two group variables. Both group variables are a factor variables (sex is a dummy and father's social status has multiple levels). How can I add the level (aka the name)…
user1870829
4
votes
1 answer

Optimal number of clusters TramineR

My problem may seem trivial to most of you. I'm working on hierarchical clustering using warde method with my data and would I like to identify the optimal number of clusters. This is the plot that shows hierarchical clustering from an optimal…
Rstudent
  • 887
  • 4
  • 12
4
votes
1 answer

Traminer: Mean time barplot with number of observations

Because I am still new to TraMineR, my problem may seem trivial to most of you. I'm working on meantime plots with my data and would I like to plot on the bar charts the mean time spent in different states. is there a command in TramineR?
Rstudent
  • 887
  • 4
  • 12
4
votes
1 answer

Figure margins too large on TraMineR plot

Im trying to graph types as shown here http://traminer.unige.ch/preview-typology.shtml I can only fit 8 types in my screen until i get the error Error in plot.new() : figure margins too large. That´s as far as my UI goes, I can't make the graph…
1
2 3
14 15