worldbank / povcalnetR

R client to the Povcalnet API
https://worldbank.github.io/povcalnetR
Other
9 stars 5 forks source link

No interpolated results returned with the argument "fill_gaps==TRUE" #30

Open PenguinSmith opened 4 years ago

PenguinSmith commented 4 years ago

Hi, The argument fill_gaps of povcalnet() is described as "logical: 'TRUE' will interpolate / extrapolate values when surveys are not available for a specific year." However, no interpolated result (poverty headcount/gini etc) is returned when this argument is TRUE. I requested data for all countries with fill_gaps==TRUE and got a returned dataframe with a variable isinterpolated. It turns out that isinterpolated is always 0 (indicates no interpolation), and the total amount of data is equal to that with fill_gaps==FALSE.

Is there a mistake in this function or something I have misunderstood? Really need the interpolated data (or methodology). Thanks in advance.

tonyfujs commented 4 years ago

Hi @PenguinSmith

Thanks for your patience on this. I was on leave, and just saw your message. The fill_gaps argument seems to be working fine. Running df <- povcalnet(fill_gaps = FALSE) returns a 1962 observations, while df <- povcalnet(fill_gaps = TRUE) returns 2671 observations.

The isinterpolated variable is misleading, and its behavior will be updated in a future release. Please ignore it for now.

Hope that helps!