Command reference

All nwcommands commands, grouped as in help nwtopical.

nwsaom, nwergm, nwdynam and nwrem are not part of the core. They are separate GPL-3 packages with their own sections (see the menu); the entries below only point to them. The complete syntax is in each package’s own Stata help (help nwsaom etc.).

Concepts

Import/Export

  • nw2fromedge — Import two-mode network data from edgelist
  • nw2set — Declare data to be two-mode network data
  • nw2toedge — Convert two-mode network to edgelist
  • nwappend — Append network dataset
  • nwexport — Export network as Pajek or Ucinet file
  • nwfromedge — Imports network data from edgelist
  • nwimport — Import network
  • nwsave — Save network data in file
  • nwset — Declare data to be network data
  • nwtoedge — Convert network to edgelist
  • nwuse — Load Stata network dataset
  • nwwebuse — Load network data over the web

Generators

  • nwbridges — Calculate bridges
  • nwdissimilar — Generate node dissimilarities
  • nwduplicate — Duplicate a network
  • nwdyadprob — Generate a network based on tie probabilities
  • nwexpand — Expand variable to network
  • nwgen — Network extensions to generate
  • nwgenerate — Network extensions to generate
  • nwgenvar — Network extensions to generate
  • nwgeodesic — Calculate shortest paths between nodes
  • nwhomophily — Generate a homophily network
  • nwlattice — Generate a lattice network
  • nwpath — Calculate paths between nodes
  • nwpermute — Generate permutation of a network
  • nwpref — Generate a preferential-attachment network
  • nwrandom — Generate a random network
  • nwreach — Calculate reachability network
  • nwring — Generate a ring-lattice network
  • nwsimilar — Generate node similarities
  • nwsmall — Generate a small-world network
  • nwstack — Stack several networks into one block-diagonal network
  • nwsubset — Subset the nodes of a network
  • nwtranspose — Transpose a network

Information

Manipulation

Analysis

Centrality

  • nw2degree — Two-mode (bipartite) degree centrality
  • nwbetween — Calculate betweenness centrality
  • nwcentrality — Node centrality measures
  • nwcloseness — Calculate closeness centrality
  • nwdegree — Degree centrality and distribution
  • nwevcent — Calculate eigenvector centrality
  • nwinduced — Induced, endogenous and exogenous centrality
  • nwkatz — Calculate a Katz-inspired distance-decay centrality
  • nwpagerank — PageRank centrality

Cohesion, Components & Subgroups

Community Detection

  • nwcommunity — Detect communities via the Louvain method or label propagation
  • nwmodularity — Score an existing node partition using Newman’s modularity
  • nwspectral — Graph Laplacian spectral analysis

Positions, Roles & Equivalence

  • nw2clustering — Clustering coefficient (transitivity) of a two-mode network
  • nwassortativity — Newman’s assortativity coefficient
  • nwbalance — Structural balance of a signed network
  • nwbrokerage — Gould-Fernandez brokerage roles
  • nwburt — Calculate Burt structural hole measures
  • nwclustering — Clustering coefficient (transitivity) of a network
  • nwconcor — CONCOR structural-equivalence blockmodel
  • nwconstraint — Calculate Burt’s constraint
  • nwcoreperiphery — Discrete core-periphery detection
  • nwdissimilar — Generate node dissimilarities
  • nwfactions — Partition nodes into a specified number of cohesive factions
  • nwhierarchy — Hierarchical clustering of nodes (role/position analysis)
  • nwlambda — Edge (line) connectivity matrix between all node pairs
  • nwmatching — Maximum-cardinality bipartite matching
  • nwmixing — E-I index and mixing table for a categorical node attribute
  • nwshared — Calculate number of shared neighbors between nodes and saves information in network
  • nwsimilar — Generate node similarities
  • nwsimindex — Common-neighbor similarity indices between all node pairs

Paths, Reachability & Ego Networks

  • nwaltergen — Generate a variable from alter/neighbor attributes
  • nwego — Ego-network size and density
  • nwgeodesic — Calculate shortest paths between nodes
  • nwmaxflow — Maximum flow and minimum cut between two nodes
  • nwneighbor — Extract the network neighbors of a node
  • nwpath — Calculate paths between nodes
  • nwrandomwalk — Mean random-walk hitting time to a target node
  • nwreach — Calculate reachability network

Statistical Estimation of Networks (core)

  • nwcorrelate — Correlate networks and variables
  • nwcug — Conditional Uniform Graph (CUG) test
  • nwqap — Multivariate QAP regression
  • nwutility — Calculate utility scores according to Jackson and Wollinsky (1996)

Other Analysis Utilities

  • nwcontext — Create a context variable
  • nwgen — Network extensions to generate
  • nwgenerate — Network extensions to generate
  • nwgenvar — Network extensions to generate
  • nwnode — Checks if node exists in a network
  • nwturnover — Tie turnover/stability between two waves of the same network
  • nwvalue — Returns a tie value

Utility Commands

  • nwds — List loaded networks, in the style of Stata’s own ds

Model packages (separate, GPL-3)

  • nwsaom — Stochastic actor-oriented models (SAOM) for network panels. Section: nwsaom
  • nwergm — Exponential random graph models (ERGM). Section: nwergm
  • nwdynam — Dynamic network actor models (DyNAM) for event data. Section: nwdynam
  • nwrem — Relational event models (REM) for event data. Section: nwrem

Utilities

  • nwclear — Clear all networks and variables from memory
  • nwcurrent — Report and set current network
  • nwerrorcodes — What this package’s own custom return codes mean
  • nwinstall — Install Stata menu/dialogs
  • nwload — Load a network as Stata variables
  • nwnetworktypes — How commands classify binary/directed/weighted/signed/two-mode networks
  • nworder — Reorder networks in dataset
  • nwsync — Sync network with Stata variables
  • nwtomata — Return adjacency matrix of network
  • nwtomatafast — Return link to adjacency matrix of network
  • nwtostata — Copy a Mata matrix into Stata variables
  • nwunab — Unabbreviate network list
  • nwvalidate — Validate network name
  • nwvalidvars — Validate Stata variables for network

Visualization

  • nwdendrogram — Plot a wheel dendrogram
  • nwmovie — Interactive, animated network movie (panel waves or a relational-event timeline)
  • nwmoviexy — Animate a sequence of networks (alias for nwmovie)
  • nwplot — Plot a network
  • nwplotmatrix — Plot a network as sociomatrix

Programming

Uncategorized


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.