nwcommands (core)

The core package, version 3.12.1, handles networks in Stata: it imports and exports them, generates them, describes and analyzes them, and plots them. It is the base for the model packages (nwsaom, nwergm, nwdynam, nwrem), which need it but are installed separately.

Install Start with Tutorial 1 Command reference

Install

. net install nwcommands, from(https://nwcommands.org/net/) replace
. nwinstall, everything

nwinstall, everything installs the core (every command, all help files and every dialog box) and the four model packages. nwinstall, all installs the core only; nwinstall, models adds the model packages later. Add nwinstall, gui for a “Network Analysis” menu in Stata. Requires Stata 17 or later (tested with Stata 17 and 18; Stata BE is enough). nwversion shows the core version and which model packages are installed. See the Installation & Setup tutorial for details.

Where to go

  • Tutorials (all tutorials): installation, core concepts, importing and exporting, visualization, generating and manipulating networks, centrality, paths and ego networks.
  • Command reference (all commands): every command with its syntax and options.
  • Size limits (how large a network can be): which commands finish in seconds, which need minutes and which are refused at which number of nodes.
  • Speed (the model packages against R): run times of nwergm, nwsaom, nwdynam and nwrem against ergm, RSiena, goldfish and relevent, and the cases where they are not faster.
  • Valued networks (which commands use tie values): when a network is valued, which commands use the values by default, which ignore them, and the option binary.
  • Two-mode networks (what the commands do with a two-mode network): how a two-mode network is declared and kept, which commands use the two modes, which accept the bipartite graph as it is and which stop.
  • Network types (the table of all commands): for every command, what it does with binary, valued, two-mode and directed networks.
  • Model packages: the statistical models have their own sections in the menu: nwsaom (stochastic actor-oriented models), nwergm (exponential random graph models), nwdynam (dynamic network actor models) and nwrem (relational event models).

What the core contains

  • Import / export: edgelists, adjacency matrices, UCINET/Pajek-style formats.
  • Generators: random, small-world, preferential-attachment, lattice and expression-based networks.
  • Structural analysis: centrality, components, cliques, k-cores, cohesive subgroups, community detection, structural equivalence, QAP and more.
  • Visualization: static plots and network movies.
  • Dialog boxes: 120 dialogs for nearly every command.

Every command works alongside ordinary Stata variables. Two backends, a sparse native Mata representation and compiled C kernels, are chosen automatically.

Version and license

The core is version 3.12.1 (28 October 2026). It is free software under the GNU General Public License, version 3; the source is on GitHub. The model packages are separate packages under the same license.


Table of contents


Back to top

nwcommands is free software under the GNU General Public License, version 3, as are the model packages nwsaom, nwergm, nwdynam and nwrem. Citing and licenses · Get help · GitHub. Issues with the core go to the nwcommands repository; issues with a model package go to that package's own repository.

This site uses Just the Docs, a documentation theme for Jekyll.