PolicyEngine / policyengine-api

PolicyEngine's REST API for computing policy impacts.
GNU Affero General Public License v3.0
7 stars 19 forks source link

Bottom decile has sign flipped on relative impact #1603

Open MaxGhenis opened 4 days ago

MaxGhenis commented 4 days ago

For example this case has positive absolute change:

image

but negative relative:

image

This shouldn't happen since we assign negatives to the -1 decile: https://github.com/PolicyEngine/policyengine-us/blob/master/policyengine_us/variables/household/income/household/household_income_decile.py

And we use that for binning:

https://github.com/PolicyEngine/policyengine-api/blob/615a196708cf42197002928e3a660e6ed7c11d08/policyengine_api/endpoints/economy/compare.py#L125-L158