nwrestore
Restore network data previously preserved
Syntax
nwrestore
Description
nwrestore restores network data (including all normal Stata variables) previously saved by nwpreserve - the network-aware counterpart of Stata’s own preserve / restore pair. If nothing was preserved (or it was already restored once), nwrestore reports “Nothing to restore” and does nothing further.
The temporary file nwrestore reads from is deleted once restored, so a given nwpreserve call can only be restored once - exactly like Stata’s own preserve / restore.
Network types
The command works the same for every network type (see nwnetworktypes).
Examples
Preserve a network, drop it, then restore it:
. nwclear
. nwrandom 5, prob(.4) name(mynet)
. nwpreserve
. nwdrop mynet
. nwset
. nwrestore
. nwset
Also see
- nwpreserve,
restore,preserve
nwcommands version 3.25.0, 14 November 2026 (check your installed version)