-
Notifications
You must be signed in to change notification settings - Fork 14
Examples of the use of wbopendata
João Pedro Azevedo edited this page Mar 5, 2019
·
1 revision
Download all WDI indiators for a single country (i.e. China)
. wbopendata, country(chn - China) clear . tab indicatorcode in 1/10 Indicator Code | Freq. Percent Cum. --------------------------+----------------------------------- TM.VAL.MRCH.AL.ZS | 1 10.00 10.00 TM.VAL.MRCH.CD.WT | 1 10.00 20.00 TM.VAL.MRCH.HI.ZS | 1 10.00 30.00 TM.VAL.MRCH.OR.ZS | 1 10.00 40.00 TM.VAL.MRCH.R1.ZS | 1 10.00 50.00 TM.VAL.MRCH.R2.ZS | 1 10.00 60.00 TM.VAL.MRCH.R3.ZS | 1 10.00 70.00 TM.VAL.MRCH.R4.ZS | 1 10.00 80.00 TM.VAL.MRCH.R5.ZS | 1 10.00 90.00 TM.VAL.MRCH.R6.ZS | 1 10.00 100.00 --------------------------+----------------------------------- Total | 10 100.00
Download all WDI indicators of particular topic
. wbopendata, language(en - English) topics(2 - Aid Effectiveness) clear . tab indicatorcode in 1/10 Indicator Code | Freq. Percent Cum. ------------------+----------------------------------- DC.DAC.SVNL.CD | 1 10.00 10.00 DC.DAC.SWEL.CD | 1 10.00 20.00 DC.DAC.TOTL.CD | 1 10.00 30.00 DC.DAC.USAL.CD | 1 10.00 40.00 DT.DIS.IDAG.CD | 1 10.00 50.00 DT.DOD.MDRI.CD | 1 10.00 60.00 DT.NFL.FAOG.CD | 1 10.00 70.00 DT.NFL.IAEA.CD | 1 10.00 80.00 DT.NFL.IFAD.CD | 1 10.00 90.00 DT.NFL.ILOG.CD | 1 10.00 100.00 ------------------+----------------------------------- Total | 10 100.00
Download specific indicator [ag.agr.trac.no]
. wbopendata, language(en - English) indicator(ag.agr.trac.no - Agricultural machinery, tractors) clear Metadata: ag.agr.trac.no ----------------------------------------------------------------------------------------------------------- Name: Agricultural machinery, tractors --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year. ---------------------------------------------------------------------------------------------------------- Source Organization: Food and Agriculture Organization, electronic files and web site. ---------------------------------------------------------------------------------------------------------- Topics: Agriculture & Rural Development ---------------------------------------------------------------------------------------------------------- . tab countryname in 1/10 Country Name | Freq. Percent Cum. ----------------------------------------+----------------------------------- Afghanistan | 1 10.00 10.00 Albania | 1 10.00 20.00 American Samoa | 1 10.00 30.00 Andorra | 1 10.00 40.00 Angola | 1 10.00 50.00 Arab World | 1 10.00 60.00 Argentina | 1 10.00 70.00 Armenia | 1 10.00 80.00 Aruba | 1 10.00 90.00 United Arab Emirates | 1 10.00 100.00 ----------------------------------------+----------------------------------- Total | 10 100.00
Download specific indicator and report in long format [ag.agr.trac.no]
. wbopendata, language(en - English) indicator(ag.agr.trac.no - Agricultural machinery, tractors) long clea > r Metadata: ag.agr.trac.no ----------------------------------------------------------------------------------------------------------- Name: Agricultural machinery, tractors --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Agricultural machinery refers to the number of wheel and crawler tractors (excluding garden tractors) in use in agriculture at the end of the calendar year specified or during the first quarter of the following year. ---------------------------------------------------------------------------------------------------------- Source Organization: Food and Agriculture Organization, electronic files and web site. ---------------------------------------------------------------------------------------------------------- Topics: Agriculture & Rural Development ---------------------------------------------------------------------------------------------------------- . tab year in 1/10 Year | Freq. Percent Cum. ------------+----------------------------------- 1960 | 1 10.00 10.00 1961 | 1 10.00 20.00 1962 | 1 10.00 30.00 1963 | 1 10.00 40.00 1964 | 1 10.00 50.00 1965 | 1 10.00 60.00 1966 | 1 10.00 70.00 1967 | 1 10.00 80.00 1968 | 1 10.00 90.00 1969 | 1 10.00 100.00 ------------+----------------------------------- Total | 10 100.00
Download specific indicator for specific countries, and report in long
format [ag.agr.trac.no]
. wbopendata, country(ago;bdi;chi;dnk;esp) indicator(sp.pop.0610.fe.un) clear Metadata: sp.pop.0610.fe.un ----------------------------------------------------------------------------------------------------------- Name: Population, ages 6-10, female --------------------------------------------------------------------------------------------------------- Source: Education Statistics ---------------------------------------------------------------------------------------------------------- Source Note: Population, ages 6-10, female is the total number of females age 6-10. ---------------------------------------------------------------------------------------------------------- Source Organization: UNESCO Institute for Statistics (Derived) ---------------------------------------------------------------------------------------------------------- Topics: Education ---------------------------------------------------------------------------------------------------------- . tab countryname Country Name | Freq. Percent Cum. ----------------+----------------------------------- Angola | 1 20.00 20.00 Burundi | 1 20.00 40.00 Channel Islands | 1 20.00 60.00 Denmark | 1 20.00 80.00 Spain | 1 20.00 100.00 ----------------+----------------------------------- Total | 5 100.00
Download specific indicator, for specific countries and year, and report
in long format [ag.agr.trac.no]
. wbopendata, country(ago;bdi;chi;dnk;esp) indicator(sp.pop.0610.fe.un) /// > year(2000:2010) clear long Metadata: sp.pop.0610.fe.un ----------------------------------------------------------------------------------------------------------- Name: Population, ages 6-10, female --------------------------------------------------------------------------------------------------------- Source: Education Statistics ---------------------------------------------------------------------------------------------------------- Source Note: Population, ages 6-10, female is the total number of females age 6-10. ---------------------------------------------------------------------------------------------------------- Source Organization: UNESCO Institute for Statistics (Derived) ---------------------------------------------------------------------------------------------------------- Topics: Education ---------------------------------------------------------------------------------------------------------- . tab year countryname | Country Name Year | Angola Burundi Channel.. Denmark Spain | Total -----------+-------------------------------------------------------+---------- 2000 | 1 1 1 1 1 | 5 2001 | 1 1 1 1 1 | 5 2002 | 1 1 1 1 1 | 5 2003 | 1 1 1 1 1 | 5 2004 | 1 1 1 1 1 | 5 2005 | 1 1 1 1 1 | 5 2006 | 1 1 1 1 1 | 5 2007 | 1 1 1 1 1 | 5 2008 | 1 1 1 1 1 | 5 2009 | 1 1 1 1 1 | 5 2010 | 1 1 1 1 1 | 5 -----------+-------------------------------------------------------+---------- Total | 11 11 11 11 11 | 55 . tab year countryname if sp_pop_0610_fe_un != . | Country Name Year | Angola Burundi Denmark Spain | Total -----------+--------------------------------------------+---------- 2000 | 1 1 1 1 | 4 2001 | 1 1 1 1 | 4 2002 | 1 1 1 1 | 4 2003 | 1 1 1 1 | 4 2004 | 1 1 1 1 | 4 2005 | 1 1 1 1 | 4 2006 | 1 1 1 1 | 4 2007 | 1 1 1 1 | 4 2008 | 1 1 1 1 | 4 2009 | 1 1 1 1 | 4 2010 | 1 1 1 1 | 4 -----------+--------------------------------------------+---------- Total | 11 11 11 11 | 44
Map latest values of global mobile phone coverage
. qui tempfile tmp . wbopendata, language(en - English) indicator(it.cel.sets.p2) long clear latest Metadata: it.cel.sets.p2 ----------------------------------------------------------------------------------------------------------- Name: Mobile cellular subscriptions (per 100 people) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Mobile cellular telephone subscriptions are subscriptions to a public mobile telephone service that provide access to the PSTN using cellular technology. The indicator includes (and is split into) the number of postpaid subscriptions, and the number of active prepaid accounts (i.e. that have been used during the last three months"}). The indicator applies to all mobile cellular subscriptions that offer voice communications. It excludes subscriptions via data cards or USB modems, subscriptions to public mobile data services, private trunked mobile radio, telepoint, radio paging and telemetry services. ---------------------------------------------------------------------------------------------------------- Source Organization: International Telecommunication Union, World Telecommunication/ICT Development Report and database. ---------------------------------------------------------------------------------------------------------- Topics: Infrastructure ---------------------------------------------------------------------------------------------------------- . local labelvar "`r(varlabel1)'" . sort countrycode . save `tmp', replace (note: file C:\Users\wb255520\AppData\Local\Temp\ST_7b3c_000003.tmp not found) file C:\Users\wb255520\AppData\Local\Temp\ST_7b3c_000003.tmp saved . qui sysuse world-d, clear . qui merge countrycode using `tmp' . qui sum year . local avg = string(`r(mean)',"%16.1f") . spmap it_cel_sets_p2 using "world-c.dta", id(_ID) /// > clnumber(20) fcolor(Reds2) ocolor(none ..) /// > title("`labelvar'", size(*1.2)) /// > legstyle(3) legend(ring(1) position(3)) /// > note("Source: World Development Indicators (latest available year: `avg') using Azevedo, > J.P. (2011) wbopendata: Stata module to " "access World Bank databases, Statistical Software Components > S457234 Boston College Department of Economics.")
Bencharmk latest poverty levels by percapital income, highlighting single
country
. wbopendata, indicator(si.pov.dday; ny.gdp.pcap.pp.kd) clear long latest Metadata: si.pov.dday ----------------------------------------------------------------------------------------------------------- Name: Poverty headcount ratio at $1.90 a day (2011 PPP) (% of population) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Poverty headcount ratio at $1.90 a day is the percentage of the population living on less than $1.90 a day at 2011 international prices. As a result of revisions in PPP exchange rates, poverty rates for individual countries cannot be compared with poverty rates reported in earlier editions. ---------------------------------------------------------------------------------------------------------- Source Organization: World Bank, Development Research Group. Data are based on primary household survey data obtained from government statistical agencies and World Bank country departments. Data for high-income economies are from the Luxembourg Income Study database. For more information and methodology, please see PovcalNet (http://iresearch.worldbank.org/PovcalNet/index.htm"}"}). ---------------------------------------------------------------------------------------------------------- Topics: Poverty ---------------------------------------------------------------------------------------------------------- Topics: Aid Effectiveness ---------------------------------------------------------------------------------------------------------- Topics: Climate Change ---------------------------------------------------------------------------------------------------------- Metadata: ny.gdp.pcap.pp.kd ----------------------------------------------------------------------------------------------------------- Name: GDP per capita, PPP (constant 2011 international $) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: GDP per capita based on purchasing power parity (PPP"}). PPP GDP is gross domestic product converted to international dollars using purchasing power parity rates. An international dollar has the same purchasing power over GDP as the U.S. dollar has in the United States. GDP at purchaser's prices is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Data are in constant 2011 international dollars. ---------------------------------------------------------------------------------------------------------- Source Organization: World Bank, International Comparison Program database. ---------------------------------------------------------------------------------------------------------- Topics: Economy & Growth ---------------------------------------------------------------------------------------------------------- . linewrap , longstring("`r(varlabel1)'") maxlength(52) name(ylabel) . linewrap , longstring("`r(varlabel2)'") maxlength(52) name(xlabel) . twoway /// > (scatter si_pov_dday ny_gdp_pcap_pp_kd, msize(*.2)) /// > (scatter si_pov_dday ny_gdp_pcap_pp_kd if string(si_pov_dday) == "35.8", /// > msize(*.8) mlabel(countryname)) /// > (lowess si_pov_dday ny_gdp_pcap_pp_kd) /// > if regioncode != "NA" /// > , legend(off) /// > xtitle("`r(xlabel1)'" "`r(xlabel2)'" "`r(xlabel3)'") /// > ytitle("`r(ylabel1)'" "`r(ylabel2)'" "`r(ylabel3)'") /// > note("Source: `r(source1)' using WBOPENDATA")
Benchmark epsiodes of poveryt reduction by Region
. wbopendata, indicator(si.pov.dday ) clear long Metadata: si.pov.dday ----------------------------------------------------------------------------------------------------------- Name: Poverty headcount ratio at $1.90 a day (2011 PPP) (% of population) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Poverty headcount ratio at $1.90 a day is the percentage of the population living on less than $1.90 a day at 2011 international prices. As a result of revisions in PPP exchange rates, poverty rates for individual countries cannot be compared with poverty rates reported in earlier editions. ---------------------------------------------------------------------------------------------------------- Source Organization: World Bank, Development Research Group. Data are based on primary household survey data obtained from government statistical agencies and World Bank country departments. Data for high-income economies are from the Luxembourg Income Study database. For more information and methodology, please see PovcalNet (http://iresearch.worldbank.org/PovcalNet/index.htm"}"}). ---------------------------------------------------------------------------------------------------------- Topics: Poverty ---------------------------------------------------------------------------------------------------------- Topics: Aid Effectiveness ---------------------------------------------------------------------------------------------------------- Topics: Climate Change ---------------------------------------------------------------------------------------------------------- . drop if si_pov_dday == . (13,710 observations deleted) . sort countryname year . bysort countryname : gen diff_pov = (si_pov_dday-si_pov_dday[_n-1])/(year-year[_n-1]) (175 missing values generated) . encode regioncode, gen(reg) . encode countryname, gen(reg2) . keep if region == "Aggregates" (1,432 observations deleted) . alorenz diff_pov, gp points(20) xdecrease markvar(reg2) /// > ytitle("Change in Poverty (p.p.)") xtitle("Proportion of regional episodes of poverty reduction (% > )") /// > legend(off) title("Poverty Reduction") /// > legend(off) note("Source: World Development Indicators using Azevedo, J.P. (2011) wbopendata: Stat > a module to " "access World Bank databases, Statistical Software Components S457234 Boston College Depart > ment of Economics.", size(*.7))
Benchmark MDG progress using 2008 as cutoff value
. wbopendata, indicator(si.pov.dday ) clear long Metadata: si.pov.dday ----------------------------------------------------------------------------------------------------------- Name: Poverty headcount ratio at $1.90 a day (2011 PPP) (% of population) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Poverty headcount ratio at $1.90 a day is the percentage of the population living on less than $1.90 a day at 2011 international prices. As a result of revisions in PPP exchange rates, poverty rates for individual countries cannot be compared with poverty rates reported in earlier editions. ---------------------------------------------------------------------------------------------------------- Source Organization: World Bank, Development Research Group. Data are based on primary household survey data obtained from government statistical agencies and World Bank country departments. Data for high-income economies are from the Luxembourg Income Study database. For more information and methodology, please see PovcalNet (http://iresearch.worldbank.org/PovcalNet/index.htm"}"}). ---------------------------------------------------------------------------------------------------------- Topics: Poverty ---------------------------------------------------------------------------------------------------------- Topics: Aid Effectiveness ---------------------------------------------------------------------------------------------------------- Topics: Climate Change ---------------------------------------------------------------------------------------------------------- . drop if si_pov_dday == . (13,710 observations deleted) . sort countryname year . keep if region == "Aggregates" (1,432 observations deleted) . bysort countryname : gen diff_pov = (si_pov_dday-si_pov_dday[_n-1])/(year-year[_n-1]) (12 missing values generated) . gen baseline = si_pov_dday if year == 1990 (159 missing values generated) . sort countryname baseline . bysort countryname : replace baseline = baseline[1] if baseline == . (148 real changes made) . gen mdg1 = baseline/2 (11 missing values generated) . gen present = si_pov_dday if year == 2008 (158 missing values generated) . sort countryname present . bysort countryname : replace present = present[1] if present == . (158 real changes made) . gen target = ((baseline-mdg1)/(2008-1990))*(2015-1990) (11 missing values generated) . sort countryname year . gen angel45x = . (170 missing values generated) . gen angle45y = . (170 missing values generated) . replace angel45x = 0 in 1 (1 real change made) . replace angle45y = 0 in 1 (1 real change made) . replace angel45x = 80 in 2 (1 real change made) . replace angle45y = 80 in 2 (1 real change made) . graph twoway /// > (scatter present target if year == 2008, mlabel( countrycode)) /// > (line angle45y angel45x ), /// > legend(off) xtitle("Target for 2008") ytitle(Present) /// > title("MDG 1 - 1.9 USD") /// > note("Source: World Development Indicators (latest available year: 2008) using Azevedo, J.P. ( > 2011) wbopendata: Stata module to " "access World Bank databases, Statistical Software Components S457234 > Boston College Department of Economics.", size(*.7))
Bencharmk latest poverty levels by percapital income, highlighting regional
averages
. wbopendata, indicator(si.pov.dday; ny.gdp.pcap.pp.kd) clear long latest Metadata: si.pov.dday ----------------------------------------------------------------------------------------------------------- Name: Poverty headcount ratio at $1.90 a day (2011 PPP) (% of population) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: Poverty headcount ratio at $1.90 a day is the percentage of the population living on less than $1.90 a day at 2011 international prices. As a result of revisions in PPP exchange rates, poverty rates for individual countries cannot be compared with poverty rates reported in earlier editions. ---------------------------------------------------------------------------------------------------------- Source Organization: World Bank, Development Research Group. Data are based on primary household survey data obtained from government statistical agencies and World Bank country departments. Data for high-income economies are from the Luxembourg Income Study database. For more information and methodology, please see PovcalNet (http://iresearch.worldbank.org/PovcalNet/index.htm"}"}). ---------------------------------------------------------------------------------------------------------- Topics: Poverty ---------------------------------------------------------------------------------------------------------- Topics: Aid Effectiveness ---------------------------------------------------------------------------------------------------------- Topics: Climate Change ---------------------------------------------------------------------------------------------------------- Metadata: ny.gdp.pcap.pp.kd ----------------------------------------------------------------------------------------------------------- Name: GDP per capita, PPP (constant 2011 international $) --------------------------------------------------------------------------------------------------------- Source: World Development Indicators ---------------------------------------------------------------------------------------------------------- Source Note: GDP per capita based on purchasing power parity (PPP"}). PPP GDP is gross domestic product converted to international dollars using purchasing power parity rates. An international dollar has the same purchasing power over GDP as the U.S. dollar has in the United States. GDP at purchaser's prices is the sum of gross value added by all resident producers in the economy plus any product taxes and minus any subsidies not included in the value of the products. It is calculated without making deductions for depreciation of fabricated assets or for depletion and degradation of natural resources. Data are in constant 2011 international dollars. ---------------------------------------------------------------------------------------------------------- Source Organization: World Bank, International Comparison Program database. ---------------------------------------------------------------------------------------------------------- Topics: Economy & Growth ---------------------------------------------------------------------------------------------------------- . . local time "$S_FNDATE" . . linewrap , longstring("`r(varlabel1)'") maxlength(52) name(ylabel) . linewrap , longstring("`r(varlabel2)'") maxlength(52) name(xlabel) . . graph twoway /// > (scatter si_pov_dday ny_gdp_pcap_pp_kd, msize(*.3)) /// > (scatter si_pov_dday ny_gdp_pcap_pp_kd if region == "Aggregates", msize(*.8) mlabel(countryname) > mlabsize(*.8) mlabangle(25)) /// > (lowess si_pov_dday ny_gdp_pcap_pp_kd) , /// > legend(off) /// > xtitle("`r(xlabel1)'" "`r(xlabel2)'" "`r(xlabel3)'") /// > ytitle("`r(ylabel1)'" "`r(ylabel2)'" "`r(ylabel3)'") /// > note("Source: World Development Indicators (latest available year as off `time') using Az > evedo, J.P. (2011) wbopendata: Stata" "module to access World Bank databases, Statistical Software Compon > ents S457234 Boston College Department of Economics.", size(*.7))