gpw13 / billionaiRe

Calculate the WHO Triple Billions
https://gpw13.github.io/billionaiRe/
GNU General Public License v3.0
7 stars 4 forks source link

transform_hep_data returns 'projected' as type when infilling, even when in the past #19

Closed ElliottMess closed 2 years ago

ElliottMess commented 3 years ago

When calling transform_hep_data on a dataset with missing values for some years, transform_hep_data infills the data. However, it infills the data with the type projected, even when the data is in the past. It should be 'infilled' instead, marking the source as DDI.

ElliottMess commented 3 years ago

Linked to this, when new values are being calculated in calculate_hep_components, the type is returned as 'projected' when one or more of the underlying data has a 'projected' type. See measles calculations for BRA in 2020, where measles is reported (as of time of writing), but surviving_infants (denominator) is projected.

ElliottMess commented 3 years ago

When calling transform_hep_data on a dataset with missing values for some years, transform_hep_data infills the data. However, it infills the data with the type projected, even when the data is in the past. It should be 'infilled' instead, marking the source as DDI.

After investigation, the problem was misidentified: this happens only on the campaign indicators when the last reported value is carried to the next years. It is then labelled as 'projected', even if it is in the past. This seems coherent, but maybe 'imputed' would be more appropriate?

ElliottMess commented 3 years ago

Linked to this, when new values are being calculated in calculate_hep_components, the type is returned as 'projected' when one or more of the underlying data has a 'projected' type. See measles calculations for BRA in 2020, where measles is reported (as of time of writing), but surviving_infants (denominator) is projected.

surviving_infants was removed from the indicators providing types in commit 5d97257

ElliottMess commented 3 years ago

This branch returns imputed instead of projected for infilled campaign data.

ElliottMess commented 2 years ago

This apparently was an expected behaviour.