Search

Importing World Bank Open Data into Stata Help

Learn how to import World Bank Data into Stata in this step-by-step guide by Research Data Experts.

The World Bank Open Data repository is one of the most practical and extensive sources you will use for empirical research. It includes thousands of indicators across development, technology, health, education, macroeconomics, governance, and more, and it is especially helpful when you are building cross-country or panel datasets in Stata.

This guide walks you through how to import World Bank Data into Stata using the wbopendata module, so you can pull the World Bank indicators you need for your analysis. It also shows you how to identify the correct indicator codes on World Bank Open Data, and save your results as a Stata .dta file so you can merge, append, and analyze it alongside your other sources.

Pre-requisites: What you need before you start

1. Stata installed on your computer

2. The World Bank Open Data indicator code (sometimes called the “series code” or “ID”) for the variable you want to download. If you don’t have this, don’t worry! We’ll show you exactly how to get it.

Step 1: Installing the World Bank Open Data module in Stata

Open Stata and run:

ssc install wbopendata

Give Stata some time to finish the install. Onc

e complete, you can verify that the command is available by listing installed ado-files:

ado dir

You should see wbopendata in the results if it installed correctly. Kinda like this:

this is a screenshot showing the success message displayed by Stata when the wbopendata module is installed

Step 2. Finding the World Bank Indicator Code (ID)

Next, go to the World Bank Open Data site and search for the dataset or indicator you need. For example, suppose we want a dataset on the proportion of individuals in the world using the internet. We can type this in at the search bar and select “Individuals using the internet (% of population)”. Click on “Details” as shown below and locate the indicator code (ID).

this is a screenshot showing a graph of individuals using the internet (% of population) on the world bank open data repository

In our example, the indicator code is: IT.NET.USER.ZS This is the code we will paste into Stata.

Step 3. Open the World Bank import window in Stata

In Stata, run:

db wbopendata

This will open a dialog window that lets you pull World Bank indicators without memorising command syntax. In the dialog, paste your indicator code into the “Indicator – All series” field. 

a screenshot of the wbopendata dialogue box after adding a world bank open data indicator

It is crucial that you also check the following settings:

1. Select “import the data in the long format” (this is critical).

2. Select “Replace data in memory” if you want Stata to overwrite whatever dataset is currently open.

Click OK. If the import worked, you will see the new variables in your Variables window.

Step 4. Sanity-check what downloaded

It is best-practice to confirm what Stata imported:

describe

This helps you verify the key fields you will later use for merges (usually country identifiers and year) and confirm that the indicator values are present and stored as numeric.

Step 5. Save the dataset locally as a Stata file

Assuming that your data is satisfactory, save it locally.

save internetusepercentage

We used “internetusepercentage” here but the filename is up to you. Stata will save it as a .dta file in your current working directory (your default user folder, unless you changed it)

That’s it! You can bring in other indicators and even merge and append your data with other quality datasets (survey data, WDI-based country covariates, IMF, OECD, etc.) to address your research question(s).

 

How The Research Data Experts can help you to import World Bank Data into Stata

Quantitative data sourcing, cleaning, and analysis can be daunting and tedious, but we can help you to import World Bank Data into Stata. Specifically, we support dissertation and publication-grade Stata analysis work end-to-end, including (1) sourcing high-quality data from the World Bank and other reputable repositories, (2) cleaning and standardizing identifiers, (3) merging and appending datasets correctly, (4) building reproducible do-files and log-files, and (5) running and reporting the analyses that answer your research question professionally.

If you already have a research question (or even if you don’t) and you want a clean Stata-ready dataset plus a defensible analysis plan, we can take it from there. Just send us an email at info@theresearchdataexperts.com or hop on a live chat with one of our customer service agents who are available 24/7 (Just click the “Let’s Chat!” or Whatsapp banners below).

error: Content is protected !!