Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Transition Network Analysis R package

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
NotificationsYou must be signed in to change notification settings

sonsoleslp/tna

Repository files navigation

Project Status: Active – The project has reached a stable, usable state and is being actively developed.R-CMD-checkCodecov test coveragetna CRAN badgeLicense: MIT

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

Resources

Check out our tutorials:

You can also try ourShinyapp.

Installation

You can install the most recent stable version oftna fromCRAN or the developmentversion fromGitHub by running one of thefollowing:

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

Example

Load the package

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

# Default plotplot(tna_model)

# Optimized plotplot(tna_model,cut=0.2,minimum=0.05,edge.label.position=0.8,edge.label.cex=0.7)

Calculate the centrality measures
cent<- centralities(tna_model)
stateOutStrengthInStrengthClosenessInClosenessOutClosenessBetweennessBetweennessRSPDiffusionClustering
adapt1.0000.34513.4062.33318.54617.0001.0005.5860.337
cohesion0.9730.8123.6512.79113.8130.00019.0005.2090.300
consensus0.9182.6670.7984.34411.4810.000103.0004.6600.161
coregulate0.9770.5674.5472.3095.9745.00027.0005.1480.306
discuss0.8051.1881.9542.6817.3080.00053.0004.6280.240
emotion0.9230.8941.5683.13314.5390.00036.0005.0700.290
monitor0.9820.3466.2432.2107.7573.00011.0005.1570.289
plan0.6261.1945.4752.91417.59310.00061.0003.4880.287
synthesis1.0000.19212.2712.18415.90114.0003.0005.5830.359

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_trueeffect_sizep_value
adaptInStrength-0.23693341-6.68088530.000999001
cohesionInStrength0.016349870.32550560.749250749
consensusInStrength0.536807937.47413410.000999001
coregulateInStrength-0.25275371-7.46234090.000999001
discussInStrength-0.09009651-1.80012850.076923077
emotionInStrength0.192883764.00669310.000999001
monitorInStrength-0.09192991-3.33806250.001998002
planInStrength0.122259882.69705340.009990010
synthesisInStrength-0.04909607-3.25548510.002997003

About

Transition Network Analysis R package

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp