MyNixOS website logo
Description

Transition Network Analysis (TNA).

Provides tools for performing Transition Network Analysis (TNA) to study relational dynamics, including functions for building and plotting TNA models, 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., 2024) <doi:10.48550/arXiv.2411.15486> for more details on TNA.

tna: An R package for Transition Network Analysis

R-CMD-check Codecov testcoverage License:MIT

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., 2024) for more details on TNA.

Installation

You can install tna from GitHub with:

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

Example

Load the library

library("tna")

Example data

data("group_regulation", package = "tna")

Build a Markov model

tna_model <- tna(group_regulation)
summary(tna_model)
metricvalue
Node Count9.00
Edge Count78.00
Network Density1.00
Mean Distance0.05
Mean Out-Strength1.00
SD Out-Strength0.81
Mean In-Strength1.00
SD In-Strength0.00
Mean Out-Degree8.67
SD Out-Degree0.71
Centralization (Out-Degree)0.02
Centralization (In-Degree)0.02
Reciprocity0.99

Plot the transition network

plot(tna_model, cut = 0.3)

Calculate the centrality measures

cent <- centralities(tna_model)
StateOutStrengthInStrengthClosenessInClosenessOutClosenessBetweennessBetweennessRSPDiffusionClustering
adapt1.00000000.344577813.4060252.33306518.5463091715.5862920.3369839
cohesion0.97286140.81164783.6513212.79107513.8127390115.2086330.2996487
consensus0.91799652.66721850.7975024.34406211.4810980494.6597280.1607773
coregulate0.97664970.56658114.5468762.3088675.9737985155.1479380.3057842
discuss0.80511261.18823151.9542852.6809967.3083770304.6275770.2397108
emotion0.92315830.89413121.5682893.13278514.5386350185.0698880.2904793
monitor0.98185620.34571506.2430452.2100397.757314355.1568370.2888819
plan0.62579181.19378435.4745332.91379817.59305710203.4875290.2874904
synthesis1.00000000.191539412.2706502.18392715.9009271435.5825020.3586136

Plot the centrality measures

plot(cent, ncol = 3)

Estimate centrality stability

estimate_centrality_stability(tna_model)
#> Centrality Stability Coefficients
#> 
#>  InStrength OutStrength Betweenness 
#>         0.9         0.9         0.7

Identify and plot communities

coms <- communities(tna_model)
plot(coms)

Find and plot cliques

cqs <- cliques(tna_model, threshold = 0.12)
plot(cqs)

Compare high achievers (first 1000) with low achievers (last 1000)

tna_model_start_high <- tna(group_regulation[1:1000, ])
tna_model_start_low <- tna(group_regulation[1001:2000, ])
comparison <- permutation_test(
  tna_model_start_high, 
  tna_model_start_low,
  measures = c("InStrength")
)

Simple comparison vs. permutation test comparison

plot_compare(tna_model_start_high, tna_model_start_low)
plot(comparison)

Compare centralities

print(comparison$centralities$stats)
StateCentralitydiff_truep_value
adaptInStrength-0.236933410.000
cohesionInStrength0.016349870.753
consensusInStrength0.536807930.000
coregulateInStrength-0.252753710.000
discussInStrength-0.090096510.050
emotionInStrength0.192883760.000
monitorInStrength-0.091929910.001
planInStrength0.122259880.007
synthesisInStrength-0.049096070.003
Metadata

Version

0.3.0

License

Unknown

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows