This tutorial is a joint product of the Statnet Development Team:

Pavel N. Krivitsky (University of New South Wales)
Martina Morris (University of Washington)
Mark S. Handcock (University of California, Los Angeles)
Carter T. Butts (University of California, Irvine)
David R. Hunter (Penn State University)
Steven M. Goodreau (University of Washington)
Chad Klumb (University of Washington)
Skye Bender de-Moll (Oakland, CA)
Michał Bojanowski (Kozminski University, Poland)

The network modeling software demonstrated in this tutorial is authored by Pavel Krivitsky (ergm.ego), with contributions from Michał Bojanowski.

The Statnet Project

All Statnet packages are open-source, written for the R computing environment, and published on CRAN. The source repositories are hosted on GitHub. Our website is

  • Need help? For general questions and comments, please email the Statnet users group at You’ll need to join the listserv if you’re not already a member. You can do that here: Statnet_help listserve.

  • Found a bug in our software? Please let us know by filing an issue in the appropriate package GitHub repository, with a reproducible example.

  • Want to request new functionality? We welcome suggestions – you can make a request by filing an issue on the appropriate package GitHub repository. The chances that this functionality will be developed are substantially improved if the requests are accompanied by some proposed code (we are happy to review pull requests).

  • For all other issues, please email us at

1 Introduction

This tutorial provides an introduction to statistical modeling of egocentrically sampled network data with Exponential family Random Graph Models (ERGMs). The primary package we will be demonstrating is ergm.ego (Krivitsky 2023), but we will make use of utilities from other Statnet packages at various points. As of version 1.0, ergm.ego depends on the egor (Krenz et al. 2024) package for egocentric network data management.

1.1 Prerequisites

This workshop assumes basic familiarity with R, experience with network concepts, terminology and data, and familiarity with the basic principles of statistical modeling and inference. Previous experience with ERGMs is not required, but is strongly recommended (the introductory ERGM workshop is a good place to start).

The workshops are conducted using Rstudio.

1.2 Software Installation

Open an R session, and set your working directory to the location where you would like to save this work.

To install the package the ergm.ego


This will install all of the “dependencies” – the other R packages that ergm.ego needs.

Even though we recommend using the CRAN versions of Statnet packages, it is also possible to install the development version of the package from Statnet’s R-universe using:

  repos = c("", &qu