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

Add test of weighted number of tax units with zero AGI #260

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,19 @@ def compare(name, act, exp, tol):
wght = sim.array("s006")
agi = sim.array("c00100")
itax = sim.array("iitax")
mars = sim.array("MARS")
# check various income tax statistics
compare("wght_sum", wght.sum(), 184e6, 0.01)
hiagi = agi >= 1e6
compare("wght_sum_hiagi", (wght * hiagi).sum(), 0.875e6, 0.01)
compare("wght_itax_sum", (wght * itax).sum(), 1591e9, 0.01)
compare("wght_itax_sum_hiagi", ((wght * itax) * hiagi).sum(), 902e9, 0.01)
# count weighted number of tax units with zero agi by filing status
agi0 = agi == 0
compare("wght_sum_agi0_fs0", (wght * agi0).sum(), 16.22e6, 0.01)
mars1 = mars == 1
compare("wght_sum_agi0_fs1", (wght * mars1 * agi0).sum(), 12.01e6, 0.01)
mars2 = mars == 2
compare("wght_sum_agi0_fs2", (wght * mars2 * agi0).sum(), 2.00e6, 0.01)
mars4 = mars == 4
compare("wght_sum_agi0_fs4", (wght * mars4 * agi0).sum(), 1.53e6, 0.01)
Loading