nwcompressobs

Drop observations that no network needs

Syntax

nwcompressobs

Description

Compresses the observations in Stata. Deletes every observation in which all variables are missing (an empty string or the system missing value), such as the extra observations that are not needed to represent the largest network. An observation that holds a node name or any other non-missing value is kept.

Network types

The command works the same for every network type (see nwnetworktypes).

Limits

All-missing observations are found by testing every variable against “” or . (string and numeric variables).

Examples

. nwclear
. nwrandom 20, prob(.2)
. set obs 50
. nwcompressobs

See also


nwcommands version 3.25.0, 14 November 2026 (check your installed version)


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.