Skip to Main Content
It looks like you're using Internet Explorer 11 or older. This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge. If you continue with this browser, you may see unexpected results.

Network Analysis: Getting Started

Analysis in STATA

Stata has the capacity to complete network analysis of quantitative data.

This tab is a step by step guide to downloading the "nwcommands" network analysis package, opening data, and defining the network with code. 

Citation: Grund, Thomas U. (2015) "nwcommands. Network Analysis in Stata". Retrieved from http://nwcommands.org

Downloading "nwcommands" Package

1. Open Stata

2. In the Command box type in the following code to find network analysis packages:

 findit nwcommands

3. Click on the following package to select it:

nwcommands-ado 

(from http://www.nwcommands.org)

4. Click on "click here to install"

5. In the Command box type the following code to complete installation process:

nwinstall, all

6. To check the package has successfully downloaded click on "User" and look for the "Network Analysis" in the drop down menu.

 

Steps to Open Data

1. Open Stata

2. In the Command box type in the following code putting in the location of where you saved your data:

file_location.DTA

Example: D:\Social Networks Workshops\NetworkData.dta

NOTE: replace the path " D:\Social Networks Workshops\NetworkData.dta " with wherever your data is stored.

Defining the Network

1. Open Stata

2. In the Command box type in the following code to define the network:

nwset FirstNodeName - LastNodeName, name (NameForNetwork)

Example: nwset steve - fabio, name (network2)