worldbank / povcalnet Goto Github PK
View Code? Open in Web Editor NEWStata client to the Povcalnet API
Home Page: https://worldbank.github.io/povcalnet/
Stata client to the Povcalnet API
Home Page: https://worldbank.github.io/povcalnet/
cl is not working w=correctly. see
povcalnet cl, country(COL BRA ARG IND) year(2011) clear coverage("national national urban national"
. povcalnet, region(SSA) year(all) aggregate clear
Year: YearSelected=all
Country: Countries=AGO_3,BDI_3,BEN_3,BFA_3,BWA_3,CAF_3,CIV_3,CMR_3,COD_3,COG_3,COM_3,CPV
_3,ETH_1,ETH_3,GAB_3,GHA_3,GIN_3,GMB_3,GNB_3,KEN_3,LBR_3,LSO_3,MDG_3,MLI_3,MOZ_3,MRT_3,MUS_3,MWI
_3,NAM_3,NER_3,NGA_3,RWA_3,SDN_3,SEN_3,SLE_3,SSD_3,STP_3,SWZ_3,SYC_3,TCD_3,TGO_3,TZA_3,UGA_3,ZAF
_3,ZMB_3,ZWE_3
Poverty line: PovertyLine=1.9
Aggregation: &display=R
PPP:
add subcommand test when povcalnet
fails, we could just type povcalnet test
by parsing scalar pcn_query and create a link to be displayed in the browser and see what happened with the query
It would be nice to see the data on the screen rather than having to browse it when it is downloaded.
Hola @davidlvargas ,
Could you please modify these lines to make sure that the condition in line 110 reads <
instead of :=
? You may need to convert the semantic versioning of Github releases into real numbers.
Please, let me know if you have any doubt.
Thanks.
There is a glitch on optiosn year(last)
. See for instances, povcalnet, region(all) year(last) agg clear
Hi Andres and colleagues,
I am having an issue with the cl suboption I haven't been able to solve.
The two examples below help illustrate my problem:
Example A:
local coun ALB AGO
local year 2008 2000
local plin 1.9 1.8
local cove national national
povcalnet cl, country(`coun') year(`year') povline(`plin') coverage(`cove') clear
Example B:
local coun ALB AGO AGO
local year 2008 2000 2008
local plin 1.9 1.8 1.7
local cove national national national
povcalnet cl, country(`coun') year(`year') povline(`plin') coverage(`cove') clear
On my end, example A works while example B returns an error.
Is there a way I can get the information I am trying to get in example B with only one line of povcalnet cl?
Many thanks,
Daniel
Hi Andres and team,
When using the cl subcommand there seems to be a limit of ten one-on-one queries that can be done simultaneously. Is that correct? If so, is it feasible to have this limit raised?
Many thanks for your help as always.
Best,
Daniel
The examples on the help file should be updated to the new variables names that match R package output.
section of help file explaining the following differences
*---------- Understanding requests and aggregate
* regular
povcalnet, country(COL BRA ARG IND) year(2015) clear
* fill gaps
povcalnet, country(COL BRA ARG IND) year(2015) clear fillgaps
* Customized Aggregate
povcalnet, country(COL BRA ARG IND) year(2015) clear aggregate
* WB aggregates
povcalnet wb, clear year(2015)
povcalnet wb, clear region(SAR LAC)
povcalnet wb, clear // all reference years
* one-on-one query
povcalnet cl, country(COL BRA ARG IND) year(2011) clear coverage("national national urban national")
the clickable function is not using survey year but reference year, so the API does not bring any result.
Examples have to be updated with new variable names. Also, more examples should be added to account for all the options
Create povcalnet_query.ado that creates the query for any kind of request. Right now, the query is being built in each ado-file (_query, _aggquery, and _cl). This is clearly inefficient and inconsistent.
(this repeats email sent to Andres and team June 21, copied to Github as per Andres' request)
Andres and colleagues,
Can I make one other suggestion โ not so much for the API wrapper but for the data itself?
You will have lots of (somewhat superficial) users like me who just want one entry for each country-year. So for example for China/India/Indonesia some people will want to have just the national aggregate and not the rural/urban entries separately, and for a bunch of LAC and ECA countries you have many country-years where you have both and income- and consumption-based measures.
Having just spent a slightly tedious half-hour deduplicating these records manually (my decision rules below), I wonder if you might want to introduce one or more dummy variables in the dataset that define samples uniquely identified by country/year? What I did below for example is pick either the consumption or the income measure to ensure the longest possible time series (either all consumption, or all income), and I dropped the separate rural/urban entries.
If you had a dummy like this, then superficial users like me who want just one data point per country/year can simply filter on this dummy and then have a dataset that is amenable to merging based on country-year.
Aart
// Load data, define integer year variable by rounding fractional data_year
povcalnet
gen year=round(data_year)
gen wbcode=country_code
// Deduplicate lots of entries where there are multiple data points for same country/year
// Note data_type=1 for "Consumption", 2 for "Income"
// Note coverage_type=1 for Rural, 2 for Urban
drop if wbcode=="BGR" & year==2007 & data_type==1
drop if wbcode=="CHN" & coverage_type==1 | coverage_type==2
drop if wbcode=="EST" & year>=2003 & data_type==1
drop if wbcode=="HRV" & year>=2009 & data_type==1
drop if wbcode=="HTI" & year==2012 & data_type==1
drop if wbcode=="HUN" & year>=2004 & data_type==1
drop if wbcode=="IDN" & coverage_type==1 | coverage_type==2
drop if wbcode=="IND" & coverage_type==1
drop if wbcode=="LTU" & year>=2004 & data_type==1
drop if wbcode=="LVA" & year>=2004 & data_type==1
drop if wbcode=="MEX" & data_type==1
drop if wbcode=="NIC" & data_type==1
drop if wbcode=="PHL" & data_type==2
drop if wbcode=="POL" & year>=2004 & data_type==2
drop if wbcode=="ROU" & year>=2006 & data_type==2
drop if wbcode=="SRB" & data_type==2
drop if wbcode=="SVK" & year>=2004 & data_type==1
when povcalnet wb
is executed, the display there is an error in the display of the first 15 obs
Warning messages when user uses aggregate
and things like that.
I am trying to use stata povcal with my own PPP.
For example, for Armenia (ARM) first I use WBโs default PPP (183.7796) using the command: povcalnet, country(ARM) year(2011) coverage(national) clear
And then I use alternative PPP (175.339) using command: povcalnet, country(ARM) year(2011) ppp(175.339) coverage(national) clear
The results from alternative PPP is the exactly identical to the output for default PPP.
Am I doing something wrong. I expected a different headcount due to change in the Armenian PPP. Your comments/suggestions regarding this will be much appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.