Skip to contents

tna is an R package for the analysis of relational dynamics through Transition Network Analysis (TNA). TNA provides tools for building TNA models, plotting transition networks, calculating centrality measures, and identifying dominant events and patterns. TNA statistical techniques (e.g., bootstrapping and permutation tests) ensure the reliability of observed insights and confirm that identified dynamics are meaningful. See (Saqr et al., 2025) for more details on TNA.

Resources

Book chapters

The book Advanced Learning Analytics Methods has three chapters on TNA, each with an online tutorial:

Dynalytics

tna is part of Dynalytics, a framework for the rigorous analytics of dynamical systems. The Dynalytics site gathers the packages, tutorials, papers, and book chapters behind it, and pak.dynasite.org hosts the documentation of every package.

  • Nestimate: dynamic, probabilistic, and higher-order network analysis.
  • htna: heterogeneous transition network analysis.
  • codyna: complex dynamic systems, with sequence patterns, outcomes, and indices (tutorial).
  • cograph: analysis and visualization of complex networks.
  • transitiontrees: trajectories and dynamics of variable-length pathways and sequences.
  • lagdynamics: lag sequential analysis and lag transition networks.
  • VaSSTra: from variables to states, sequences, and trajectories.
  • Snakeplot: serpentine plots for long timelines and sequential data.

TNA without code

Installation

You can install the most recent stable version of tna from CRAN or the development version from GitHub by running one of the following:

install.packages("tna")

# install.packages("devtools")
# devtools::install_github("sonsoleslp/tna")

Example

#> <environment: namespace:cograph>

Prepare the data

prepare_data() turns an event log into sequences, here one sequence per student ordered by time.

prepared <- prepare_data(
  group_regulation_long,
  action = "Action",
  actor = "Actor",
  time = "Time"
)
plot_sequences(prepared, type = "distribution")

Build and plot the network

model <- tna(prepared)
plot(model, minimum = 0.05)

Validate the edges

bootstrap() resamples the sequences and keeps the edges that are stable across the resamples.

set.seed(265)
boot <- bootstrap(model, iter = 1000)
plot(boot)

Centralities and their stability

cent <- centralities(model)
plot(cent, ncol = 3)

estimate_cs() drops cases to test whether the centrality ranking holds.

set.seed(265)
stability <- estimate_cs(model)
stability
#> Centrality Stability Coefficients
#> 
#>  InStrength OutStrength Betweenness 
#>         0.9         0.9         0.9
plot(stability)

Communities and cliques

plot(cliques(model, size = 3, threshold = 0.05))

Compare groups

group_model() builds one network per group, here high and low achievers.

groups <- group_model(prepared, group = "Achiever")
plot(groups, minimum = 0.05)

permutation_test() tests every edge and centrality difference between the groups.

set.seed(265)
permutation <- permutation_test(
  groups,
  iter = 1000,
  measures = c("InStrength", "OutStrength")
)
plot(permutation, minimum = 0.01)

plot_mosaic() shows which states each group uses more than expected. The students work in teams, so actor = "Group" adjusts the test for the nesting; mosaic_test() gives the other tests that allow for it.

plot_mosaic(groups, actor = "Group")

The tutorials cover each step in depth, together with sequence clustering, model comparison, and the other model types (frequency, co-occurrence, and attention TNA).

Papers using TNA

  • Saqr, M., Lopez-Pernas, S., Tormanen, T., Kaliisa, R., Misiejuk, K., & Tikka, S. (2025). Transition Network Analysis: A Novel Framework for Modeling, Visualizing, and Identifying the Temporal Patterns of Learners and Learning Processes. Proceedings of the 15th International Learning Analytics and Knowledge Conference (LAK ’25), 351–361. ACM. https://doi.org/10.1145/3706468.3706513
  • Tikka, S., Lopez-Pernas, S., & Saqr, M. (2025). tna: An R Package for Transition Network Analysis. Applied Psychological Measurement (online ahead of print). doi:10.1177/01466216251348840
  • López-Pernas, S., Misiejuk, K., Kaliisa, R., & Saqr, M. (2025). Capturing the process of students’ AI interactions when creating and learning complex network structures. IEEE Transactions on Learning Technologies, 1–13. https://doi.org/10.1109/tlt.2025.3568599
  • Törmänen, T., Saqr, M., López-Pernas, S., Mänty, K., Suoraniemi, J., Heikkala, N., & Järvenoja, H. (2025). Emotional dynamics and regulation in collaborative learning. Learning and Instruction, 100, 102188. https://doi.org/10.1016/j.learninstruc.2025.102188
  • López-Pernas, S., Misiejuk, K., Oliveira, E., & Saqr, M. (2025). The dynamics of the self-regulation process in student-AI interactions: The case of problem-solving in programming education. Proceedings of the 25th Koli Calling International Conference on Computing Education Research, 1–12. https://doi.org/10.1145/3769994.3770043
  • Misiejuk, K., Kaliisa, R., Lopez-Pernas, S., & Saqr, M. (2026). Expanding the Quantitative Ethnography Toolkit with Transition Network Analysis: Exploring Methodological Synergies and Boundaries. In Advances in Quantitative Ethnography. ICQE 2025, CCIS vol. 2677. Springer. https://doi.org/10.1007/978-3-032-12229-2_10
  • Lopez-Pernas, S., Misiejuk, K., Tikka, S., & Saqr, M. (2026). Role Dynamics in Student-AI Collaboration: A Heterogeneous Transition Network Analysis Approach. SSRN preprint. https://doi.org/10.2139/ssrn.6082190