-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds popshare option #19
Changes from 2 commits
9f2e549
56f9fcf
45adfd5
486fcaf
3f074bf
b7b9972
02c9fb3
55679e4
58d3b3d
45fc684
86ce478
d0e5670
c4296ae
3077033
9aa3ad6
8bbd46a
076fba0
f98b817
75d3682
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ COUNtry(string) /// | |
REGion(string) /// | ||
YEAR(string) /// | ||
POVline(numlist) /// | ||
POPShare(numlist) /// | ||
PPP(numlist) /// | ||
AGGregate /// | ||
CLEAR /// | ||
|
@@ -258,8 +259,26 @@ qui { | |
} | ||
} | ||
|
||
*---------- Poverty line | ||
if ("`povline'" == "") local povline = 1.9 | ||
*---------- Poverty line/population share | ||
if ("`popshare'" != ""){ | ||
if ("`povline'" != ""){ | ||
oi disp as err "povline and popshare cannot be used at the same time" | ||
error | ||
} | ||
else{ | ||
loc povline = "" | ||
loc pcall = "popshare" | ||
} | ||
} | ||
else if ("`povline'" == "") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This condition is not mutually exclusive with the first condition and with the else statement. I think the problem is that these lines, if ("`popshare'" != ""){
if ("`povline'" != ""){ Should be just one line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree, I'll adjust it |
||
loc popshare = "" | ||
loc povline = 1.9 | ||
loc pcall = "povline" | ||
} | ||
else{ | ||
loc popshare = "" | ||
loc pcall = "povline" | ||
} | ||
|
||
*---------- Info | ||
if regexm("`subcommand'", "^info") { | ||
|
@@ -382,7 +401,7 @@ qui { | |
|
||
local f = 0 | ||
|
||
foreach i_povline of local povline { | ||
foreach i_povline of local `pcall' { | ||
local ++f | ||
|
||
/*================================================== | ||
|
@@ -392,6 +411,7 @@ qui { | |
region("`region'") /// | ||
year("`year'") /// | ||
povline("`i_povline'") /// | ||
popshare("`popshare'") /// | ||
ppp("`i_ppp'") /// | ||
coverage(`coverage') /// | ||
server(`server') /// | ||
|
@@ -410,16 +430,23 @@ qui { | |
local query_pl = "`r(query_pl)'" | ||
local query_ds = "`r(query_ds)'" | ||
local query_pp = "`r(query_pp)'" | ||
local query_ps = "`r(query_ps)'" | ||
|
||
return local query_ys_`f' = "`query_ys'" | ||
return local query_ct_`f' = "`query_ct'" | ||
return local query_pl_`f' = "`query_pl'" | ||
return local query_ds_`f' = "`query_ds'" | ||
return local query_pp_`f' = "`query_pp'" | ||
return local query_ps_`f' = "`query_ps'" | ||
return local base = "`base'" | ||
|
||
*---------- Query | ||
local query = "`query_ys'&`query_ct'&`query_pl'`query_pp'`query_ds'&format=csv" | ||
if ("`popshare'" == ""){ | ||
local query = "`query_ys'&`query_ct'&`query_pl'`query_pp'`query_ds'&format=csv" | ||
} | ||
else{ | ||
local query = "`query_ys'&`query_ct'&`query_ps'`query_pp'`query_ds'&format=csv" | ||
} | ||
return local query_`f' "`query'" | ||
global pcn_query = "`query'" | ||
|
||
|
@@ -478,6 +505,7 @@ qui { | |
if ("`query_ys'" != "") noi di as res "Year:" as txt "{p 4 6 2} `query_ys' {p_end}" | ||
if ("`query_ct'" != "") noi di as res "Country:" as txt "{p 4 6 2} `query_ct' {p_end}" | ||
if ("`query_pl'" != "") noi di as res "Poverty line:" as txt "{p 4 6 2} `query_pl' {p_end}" | ||
if ("`query_ps'" != "") noi di as res "Population share:" as txt "{p 4 6 2} `query_ps' {p_end}" | ||
if ("`query_ds'" != "") noi di as res "Aggregation:" as txt "{p 4 6 2} `query_ds' {p_end}" | ||
if ("`query_pp'" != "") noi di as res "PPP:" as txt "{p 4 6 2} `query_pp' {p_end}" | ||
noi di as res _dup(20) "-" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Think this should be
noi
rather thanoi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awful typo, I'll fix it right away