nwdrop

Drop networks or nodes

Syntax

nwdrop 
[netlist]
nwdrop 
[netname]
ifin
[,
clean]
   
clean Drop node observations

Description

Drops a network or a list of networks. The command is the network version of drop and mirrors nwkeep.

It can also be used with if or in. Then it only drops certain nodes from a network. This updates the Stata variable _nwinclude, which indicates if a node is included in a network.

Examples

Load two networks and drop one of them by name:

. nwclear
. nwrandom 5, prob(.4) name(net1)
. nwrandom 5, prob(.4) name(net2)
. nwdrop net1
. nwset

Drop only certain nodes from a network, using if:

. nwclear
. nwrandom 6, prob(.4) name(net3)
. nwdrop net3 if _n > 3
. nwsummarize net3

nwcommands version 3.17.6, 9 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.