Skip to contents

1 Introduction

Nestimate is a unified network estimation package for R. It provides a single entry point — build_network() — that accepts sequence data, wide-format behavioral data, or numeric matrices and estimates networks using any of 10 built-in methods. The result is a netobject that inherits cograph_network, so every object produced by Nestimate can be plotted with splot() directly.

The core design principle is that estimation and visualization are separate concerns: Nestimate handles all computation (network construction, bootstrapping, permutation testing, clustering, multi-cluster analysis), while cograph handles all rendering. This separation means the analyst writes estimation code once and gets publication-ready figures without adapter code or manual class conversion.

Beyond single-network estimation, Nestimate provides a complete statistical toolkit:

  • Bootstrap stability analysis (bootstrap_network) — identifies which edges survive resampling and which are sampling artifacts.
  • Permutation-based group comparison (permutation) — tests whether edges differ significantly between conditions.
  • Multi-cluster multi-level analysis (cluster_summary, build_mcml) — aggregates node-level networks into cluster-level summaries for hierarchical visualization.
  • Centrality stability (centrality_stability) — assesses whether centrality rankings are robust to case dropping.
  • Group-level operations — bootstrapping, permutation testing, and plotting work on grouped networks with no additional code.

This tutorial walks through the full pipeline with the group_regulation_long dataset shipped with Nestimate.


2 Data

group_regulation_long is a long-format dataset of collaborative regulation behaviors coded across student groups. Each row is one coded action in a session, with columns identifying the actor, the group, achievement level, course, timestamp, and the regulation behavior.

data("group_regulation_long", package = "Nestimate")
head(group_regulation_long)
  Actor Achiever Group Course                Time    Action
1     1     High     1      A 2025-01-01 08:27:07  cohesion
2     1     High     1      A 2025-01-01 08:35:20 consensus
3     1     High     1      A 2025-01-01 08:42:18   discuss
4     1     High     1      A 2025-01-01 08:50:00 synthesis
5     1     High     1      A 2025-01-01 08:52:25     adapt
6     1     High     1      A 2025-01-01 08:57:31 consensus

The nine regulation behaviors are: adapt, cohesion, consensus, coregulate, discuss, emotion, monitor, plan, and synthesis. These form the nodes of the networks we estimate below.


3 Estimating Networks

3.1 A single network

build_network() estimates a network from raw data. The method argument selects the estimation algorithm. Here we use "relative", which computes row-normalized transition probabilities — the standard approach in transition network analysis (TNA). Unlike constructing a TNA model manually (preparing wide-format data, computing the transition matrix, normalizing), build_network() handles all data preparation internally.

net <- build_network(
  group_regulation_long,
  action = "Action", actor = "Actor",
  method = "relative"
)
net
Transition Network (relative probabilities) [directed]
  Weights: [0.001, 0.498]  |  mean: 0.116

  Weight matrix:
             adapt cohesion consensus coregulate discuss emotion monitor  plan
  adapt      0.000    0.273     0.477      0.022   0.059   0.120   0.033 0.016
  cohesion   0.003    0.027     0.498      0.119   0.060   0.116   0.033 0.141
  consensus  0.005    0.015     0.082      0.188   0.188   0.073   0.047 0.396
  coregulate 0.016    0.036     0.135      0.023   0.274   0.172   0.086 0.239
  discuss    0.071    0.048     0.321      0.084   0.195   0.106   0.022 0.012
  emotion    0.002    0.325     0.320      0.034   0.102   0.077   0.036 0.100
  monitor    0.011    0.056     0.159      0.058   0.375   0.091   0.018 0.216
  plan       0.001    0.025     0.290      0.017   0.068   0.147   0.076 0.374
  synthesis  0.235    0.034     0.466      0.044   0.063   0.071   0.012 0.075
             synthesis
  adapt          0.000
  cohesion       0.004
  consensus      0.008
  coregulate     0.019
  discuss        0.141
  emotion        0.003
  monitor        0.016
  plan           0.002
  synthesis      0.000

  Initial probabilities:
  consensus     0.214  ████████████████████████████████████████
  plan          0.204  ██████████████████████████████████████
  discuss       0.175  █████████████████████████████████
  emotion       0.151  ████████████████████████████
  monitor       0.144  ███████████████████████████
  cohesion      0.060  ███████████
  synthesis     0.019  ████
  coregulate    0.019  ████
  adapt         0.011  ██

The returned net is a netobject (which inherits cograph_network), so splot() renders it directly:

splot(net)
Figure 1: Collaborative regulation network — row-normalized transitions (relative method)

3.2 Available estimators

Nestimate ships with 10 built-in estimators. Each is selected via the method argument to build_network():

                name                                                description
1          attention                       Decay-weighted attention transitions
2      co_occurrence                             Co-occurrence within sequences
3                cor                               Pairwise correlation network
4          frequency                            Raw transition frequency counts
5             glasso                EBICglasso regularized partial correlations
6              ising             Ising model (L1-penalized logistic regression)
7                mgm Mixed Graphical Model (nodewise lasso, EBIC, LW threshold)
8               pcor                         Unregularized partial correlations
9           relative                    Row-normalized transition probabilities
10              wtna                     Window-based TNA transitions (one-hot)
11 wtna_cooccurrence                   Window-based TNA co-occurrence (one-hot)
   directed
1      TRUE
2     FALSE
3     FALSE
4      TRUE
5     FALSE
6     FALSE
7     FALSE
8     FALSE
9      TRUE
10     TRUE
11    FALSE

Different estimators answer different research questions. Directed methods (relative, frequency, attention) model sequential transitions — which behavior follows which. Undirected methods (glasso, pcor, cor, co_occurrence, ising) model co-occurrence or partial correlation structures — which behaviors tend to appear together. The choice of method should be driven by the theoretical question, not by convenience.

frequency_net    <- build_network(group_regulation_long, action = "Action",
                                  actor = "Actor", method = "frequency")
attention_net    <- build_network(group_regulation_long, action = "Action",
                                  actor = "Actor", method = "attention")
co_occurrence_net <- build_network(group_regulation_long, action = "Action",
                                   actor = "Actor", method = "co_occurrence")

Each of these is a netobject that works with splot():

splot(frequency_net)