nwsbm: Stochastic block models for networks in Stata. Manual
This is the user manual and reference of nwsbm, series 1.0 (examples produced with version 1.0.0 and the nwcommands core 3.29.0), a Stata package for stochastic block models of networks: the actors are sorted into blocks, the distribution of a tie depends only on the blocks of the two actors, and the number of blocks is chosen by the integrated classification likelihood (ICL). nwsbm builds on the nwcommands core package and follows the R packages blockmodels and sbm (variational EM, objective, ICL, model names) and greed (exact ICL, degree-corrected models, greedy search). It fits Bernoulli, Poisson and Gaussian models for undirected and directed one-mode networks with missing ties, the degree-corrected Poisson model, the latent block model for two-mode networks, and dyadic covariates with standard errors of the coefficients. The manual describes the installation, the models and the estimator, the syntax and every option, the selection of the number of blocks, the exact ICL and the greedy search, covariates, two-mode networks, the postestimation commands and stored results, the plots (blocked matrix, expected ties, memberships, block graph, ICL path), the comparison of models, the validation against sbm, blockmodels and greed as recorded in the test suite of the package, and the limits. Worked examples use the karate club, the law firm of Lazega and the Southern women of Davis, Gardner and Gardner. nwsbm requires the nwcommands core package (version 3.29.0 or later) and Stata 17 or later and is meant for researchers who work in Stata. It is not a replacement for the R packages, which remain the reference implementations, and it is not affiliated with or endorsed by their authors. The software is free software under the GNU General Public License, version 3. The package and the manual were prepared with the help of an AI coding assistant working under the author's direction, as stated in the manual. Please cite this manual (all-versions DOI) and report the exact version printed by nwsbm version.
Authors
- Thomas Grund (ORCID: https://orcid.org/0000-0001-6751-5429)
Institutions
- RWTH Aachen University (DE)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-11-20
- DOI
- https://doi.org/10.5281/zenodo.24398296
- Primary Topic
- Complex Network Analysis Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00