Skip to content
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

Strange poverty gap in China at $5.50 in the '80s #31

Open
danielmahler opened this issue Feb 25, 2022 · 7 comments
Open

Strange poverty gap in China at $5.50 in the '80s #31

danielmahler opened this issue Feb 25, 2022 · 7 comments

Comments

@danielmahler
Copy link

danielmahler commented Feb 25, 2022

Hi all, I'm seeing some strange patterns with China's poverty gap in the 1980s at $5.50. Strange meaning that it differs quite a bit between PovcalNet and PIP even though the headcount rates are identical. Here is some code to understand what I find.

// Prepare PovcalNet data
povcalnet, country(CHN) year(all) povline(5.5) fillgaps clear
decode coveragetype, gen(reporting_level)
replace reporting_level = lower(reporting_level)
replace reporting_level = "national" if reporting_level=="national (aggregate)"
keep year reporting_level headcount povgap
order year report
rename headcount hc_pcn
rename povgap pg_pcn
tempfile pcn
save    `pcn'

// Prepare PIP data
pip, country(CHN) year(all) povline(5.5) fillgaps clear
keep reporting_year reporting_level poverty_gap headcount
rename reporting_year year
rename headcount hc_pip
rename poverty_gap pg_pip

// Merge and calculate differences
merge 1:1 year reporting_level using `pcn', nogen
gen dif_hc = abs(hc_pip-hc_pcn)
gen dif_pg = abs(pg_pip-pg_pcn)

// Plot
format dif* %3.2f
twoway line pg_pcn year || line pg_pip year, by(reporting_level)
@Tefera19
Copy link
Contributor

Hi @randrescastaneda , @danielmahler,

I looked at this issue and I noticed that the 1982 and 1983 (rural and national) data points are not similar for PovCalNet and PIP. Would it be possible to check the pip data source for those two years?

Thanks,
Tefera

@danielmahler
Copy link
Author

danielmahler commented Oct 18, 2022 via email

@Tefera19
Copy link
Contributor

Hi @randrescastaneda , @danielmahler,

The 1981 data points are similar.

@danielmahler
Copy link
Author

danielmahler commented Oct 18, 2022 via email

@randrescastaneda
Copy link
Collaborator

Hi @danielmahler,

I can't replicate the results you mention. Could you please send me the code where the poverty gap is 1? The table below is what I got.

Thanks.

image

@danielmahler
Copy link
Author

Sorry about that, here you go :)
pip, country(CHN) year(1981) povline(3.65) clear

@randrescastaneda
Copy link
Collaborator

randrescastaneda commented Oct 20, 2022

Yes, you're right. I replicated the issue. I think the problem is with the fitting of the lorenz at the tail of the distribution. Perhaps it changes from one model to the other (I don't really have an easy way to check that). It is clear that there is a discontinuity around $3.3.

image

Code to replicate

library(data.table)
library(ggplot2)

pl <- seq(.5, 3.7, length.out = 100)

chn <- purrr::map_df(pl,
                     ~{
                        x <- pipr::get_stats("CHN", 1981, povline = .x)
                        setDT(x)
                        x[, .
                          (reporting_level,
                            mean,
                            headcount,
                            poverty_gap,
                            poverty_severity, 
                            poverty_line)]
                     }
                     )


chnm <- melt(chn, 
             id.vars = c("reporting_level", "poverty_line"), 
             variable.name = "measure", 
             value.name = "value")



ggplot(chnm[reporting_level == "national" & measure != "mean"], 
       aes(x = poverty_line, 
           y = value, 
           color = measure) ) +
  geom_line()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants