Giter Site home page Giter Site logo

jpazvd / wbopendata Goto Github PK

View Code? Open in Web Editor NEW
31.0 6.0 14.0 44.15 MB

WBOPENDATA: Stata module to access World Bank databases

Home Page: https://ideas.repec.org/c/boc/bocode/s457234.html

License: MIT License

Stata 100.00% TeX 0.01%
stata countries api api-wrapper indicators developement database

wbopendata's Introduction

WBOPENDATA: Stata module to access World Bank databases

Description

wbopendata allows Stata users to download over 17,000 indicators from the World Bank databases, including: Development Africa Development Indicators; Doing Business; Education Statistics; Enterprise Surveys; Global Development Finance; Gender Statistics; Health Nutrition and Population Statistics; International Development Association - Results Measurement System; Millennium Development Goals; World Development Indicators; Worldwide Governance Indicators; and LAC Equity Lab. These indicators include information from over 256 countries and regions, since 1960.

Users can chose from one of three of the languages supported by the database (and Stata), namely, English, Spanish, or French.

Five possible downloads options are currently supported:

  • country: over 2,500 indicators for all selected years for a single country (WDI Catalogue).
  • topics: WDI indicators within a specific topic, for all selected years and all countries (WDI Catalogue).
  • indicator: all selected years for all countries for a single indicator (from any of the catalogues: 17,000+ series).
  • indicator and country: all selected years for selected countries for a single indicator (from any of the catalogues: 17,000+ series).
  • multiple indicator: all selected years for selected indicators separated by ; (from any of the catalogues: 17,000+ series).

Users can also choose to have the data displayed in either the wide or long format (wide is the default option). Note that the reshape is the local machine, so it will require the appropriate amount of RAM to work properly.

wbopendata draws from the main World Bank collections of development indicators, compiled from officially-recognized international sources. It presents the most current and accurate global development data available, and includes national, regional and global estimates.

The access to this databases is made possible by the World Bank's Open Data Initiative which provide open full access to World Bank databases.

Parameters

  • country(string): Countries and Regions Abbreviations and acronyms. If solely specified, this option will return all the WDI indicators (1,076 series) for a single country or region (no multiple country selection allowed in this case). If this option is selected jointly with a specific indicator, the output is a series for a specific country or region, or multiple countries or region. When selecting multiple countries please use the three letters code, separated by a semicolon (;), with no spaces.

  • topics(numlist): Topic List 21 topic lists are curently supported and include Agriculture & Rural Development; Aid Effectiveness; Economy & Growth; Education; Energy & Mining; Environment; Financial Sector; Health; Infrastructure; Social Protection & Labor; Poverty; Private Sector; Public Sector; Science & Technology; Social Development; Urban Development; Gender; Millenium development goals; Climate Change; External Debt; and, Trade (only one topic collection can be requested at the time).

  • indicator(string): Indicators List list of indicator codes (All series). When selecting multiple indicators please use semicolon (;), to separate differenet indicatos.

Disclaimer

Users should not use wbopendata without checking first for more detailed information on the definitions of each indicator and data-catalogues. The indicators names and codes used by wbopendata are precisely the same used in the World Bank data catalogue in order to facilitate such cross reference.

When downloading specific series, through the indicator options, wbopendata will by default display in the Stata results window the metadata available for this particular series, including information on the name of the series, the source, a detailed description of the indicator, and the organization responsible for compiling this indicator.

Terms of use World Bank Data

The use of World Bank datasets listed in the Data Catalog is governed by a specific Terms of Use for World Bank Data.

The terms of use of the APIs is governed by the World Bank Terms and Conditions.

Blog Posts

Wbopendata Stata Module Upgrade (posted on 8 July 2014 by João Pedro Azevedo)

New Stata module released (Posted on 6 February 2013 by João Pedro Azevedo)

World Bank Development Data in Stata (posted on Thursday, 17 February 2011)

World Bank’s open data policy and -wbopendata- (posted on 10 February 2011 by Mitch Abdon)

Examples

Examples of code and output

Suggested Citation

Joao Pedro Azevedo, 2011. "WBOPENDATA: Stata module to access World Bank databases," Statistical Software Components S457234, Boston College Department of Economics, revised 10 Feb 2016.

Handle: RePEc:boc:bocode:s457234

Note:

This module should be installed from within Stata by typing "ssc install wbopendata". Windows users should not attempt to download these files with a web browser.

Keywords:

Indicators; WDI; API; Open Data

Author:

João Pedro Azevedo
[email protected]
World Bank
World Bank Staff page
Twitter

wbopendata's People

Contributors

jpazvd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wbopendata's Issues

Problem updating indicators

I am using -wbopendata- with the latest StataSE 16.1 (17 Sep 2020) and when I go to update it using -wbopendata, update check detail- I get what is attached in the txt file. I have already tried replacing the install of -wbopendata-, and -which wbopendata- gives me:

. which wbopendata
/Users/username/Library/Application Support/Stata/ado/plus/w/wbopendata.ado
*! v 16.3 8Jul2020 by Joao Pedro Azevedo

country metadata sub-options are not working

the suboptions of the countrymetadata when called from wbopendata are not working.

_countrymetadata, match(countrycode) incomelevel
_countrymetadata, match(countrycode) region

and

wbopendata, match(countrycode) incomelevel
wbopendata, match(countrycode) region

are not equivalent

AFE and AFW should be marked as Aggregates

Just pointing out that these two rows are not labeled as aggregates when downloading data with the Stata API:

countrycode countryname
AFE Africa Eastern and Southern
AFW Africa Western and Central

Suggestion to add information about the countryname variable

Dear Professor,
As a frequent user of your excellent package, I've two suggestions:

  1. when we extract data using the Stata package, it imports data for all country and country-groups (i.e., Arab countries, World, European countries and so on). The "countryname" variable reports information on both country and country-groups. However, if one is working on country-level data, it takes a lot of time removing the country-groups from the extracted dataset. My suggestion is the following. We can create another variable say country-info. It will take only two options: country-group and country. It will assign Country if the country is, say, India, and Country-group if the country is Arab countries.

  2. Can we have a syntax (Say, wbopendata indicators) to show all indicators and its definition, showing on the Stata platform itself? Further, we can add have another syntax (like wbopendata topics indicators) which will show indicators and definitions under each topic? Another syntax (wbopendata topics) to show various topics in the wbopendata or WDI.

Thank you in advance.

Option -latest- breaks when indicator names are too long

The option latest breaks for indicators with long names (the original variable name is shortened, but the filter that keeps only the latest value of that variable refers to its full name). For example:

wbopendata, indicator("UIS.AFR.SCHCENRESPR.1.PU") long latest clear

Generates a warning :

ATTENTION: Original variable name was above 20 characters. WBOPENDATA shorten it to comply with Stata specifications. Variable label preserved.

And the variable becomes uis_afr_schcenrespr_ but the drop is on uis_afr_schcenrespr_1_pu , so the error:

variable uis_afr_schcenrespr_1_pu not found
r(111);

Suggestion to add info on income category

Dear Professor,
I would like to thank you for creating this beautiful module, wbopendata, for researchers. This saves a lot of time and energy.

I was wondering whether the module provides information on income code or income category of countries like it provides information on region.

I checked it and it seems it does not exist at present. I would really appreciate if you can suggest ways on how to add it...

It would be really great if you can add this information if you are considering updating the module.

Thank you.

Failed to access data with wbopendata

Hello,

First of all, many thanks for writing this excellent package!

Having successfully used the package several times in the past, today I wasn't able to retrieve data with wbopendata. Despite having updated the package using " ssc install wbopendata, replace" and using simple requests such as "wbopendata, language(en - English) country(USA) nometadata indicator(NY.GNP.MKTP.KN) long clear", I encounter the following error:

" (1) Please check your internet connection by clicking here, if does not
work please check with your internet provider or IT support,
otherwise...
(2) Please check your access to the World Bank API by clicking here, if
does not work please check with your firewall settings or internet
provider or IT support.
(3) Please consider ajusting your Stata timeout parameters. For more
details see netio.
(4) Please consider setting Stata checksum off. set checksum
(5) Please send us an email to report this error by clicking here or
writing to:
email: [email protected]
subject: wbopendata query error at 11 Sep 2020 16:56:38:
https://api.worldbank.org/v2/en/countries/USA/Indicators/NY.GNP.MKTP.KN?
> downloadformat=CSV&HREQ=N&filetype=data"

When I click on the hyperlink under (2), a website opens that says the following:

"statusCode | 404
message | "Resource not found"
"

I wonder whether this is related to the change of Indicators API from v1 to v2 mentioned here?

I'd appreciate any attempt to resolve this problem.

Many thanks,
Karsten

No download of country attributes / documentation of match function

Hi,
I have updated the Stata version just now after reading your blog post. First, let me say congratulation to all those new changes, what a helpful tool.
However, I am not currently not able to download the full list of attributes (region, income level etc.) despite specifying the 'pull' option. For instance wbopendata, indicator(sp.pop.totl) full long clear only gives me countrycode, countryname, indicator and sp_pop_totl.

Also would it be possible to share an example on the new match option on GitHub?

Many thanks!
Oliver

Add series name to the label

This is such a great initiative! Thank you for creating this package. A minor improvement could be done by adding the series name to the label of each indicator. Right now the label is the same as the indicator name which is Stata's default setting. Though researchers who run the code should have already know what indicators they are getting, adding the explanatory labels seems not necessary in this scenario. However, when sharing the data with other colleagues, having clear labeled variables will be extreme helpful. It is possible that some series name in the current mapping (series code to series name) reach the maximum length of the allowed label length. You may need to come up with another mapping that has short series names. Just an idea.

Unemployment rates indicators shows a red text.

Using wbopendata to download the indicators SL.UEM.TOTL.FE.ZS.; SL.UEM.TOTL.FE.NE.ZS; SL.UEM.TOTL.MA.NE.ZS; SL.UEM.TOTL.MA.ZS; SL.UEM.TOTL.NE.ZS; SL.UEM.TOTL.ZS shows a red text "{browse https:"} ilostat.ilo.org data .{p_end}" invalid name".

Error when displaying metadata that contain a url link

Hi,

Thanks very much for the great wbopendata package.
Since the last update (I think), I have noted that metadata that contain url links create an error when they are displayed.

For example:
wbopendata, indicator(EN.ATM.CO2E.KT)
or
wbopendata, indicator(EG.ELC.FOSL.ZS)
create errors.
Still, the data is correctly uploaded.

The issue becomes more problematic when several indicators are to be uploaded, because the error causes wbopendata to stop.
For example:
wbopendata, indicator(EN.ATM.CO2E.KT ; NY.GDP.MKTP.KN)
only loads data from the first indicator and then stops.
In such cases, using option clear and/or nometadata solves the problem, but that is of course not totally satisfactory.

I have tried to solve the issue by myself and it turns out that the error is located in _website.ado, but I could not determine precisely where.

Thanks for your help.

Sylvain Weber

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.