PSLmodels / Tax-Calculator

USA Federal Individual Income and Payroll Tax Microsimulation Model
https://taxcalc.pslmodels.org
Other
264 stars 158 forks source link

Incorrect status-quo EITC calculations for 2022 #2664

Closed JackLandry closed 1 year ago

JackLandry commented 2 years ago

I noticed ~$100-$300 discrepancies from what I calculated for the EITC compared to this CBPP report and found that the tax calculator appears to be miscalculating the status-quo EITC. However, the output is correct when I make explicit the EITC parameters that are in current-law.json in a reform run. (I did fix a minor error in the reform run relative to the parameters in current-law.json (issue 2663), but the miscalculation goes beyond that. Code for reproducing is more, let me know if I can provide more details or if I'm doing something wrong.

R code for creating the test data and seeing results:

library(tidyverse)
library(here)

df <- tibble(e00200p=seq(15000,35000,10000))
children_under_18 <- tibble(nu18=seq(from = 1, to = 2, by = 1)) 
m_status <- tibble(MARS=c(2,4))
df <- expand_grid(df,children_under_18,m_status) 
df <- df %>% mutate(RECID=row_number(), n24=nu18, FLPDYR=2022, age_head=50,
                    EIC=ifelse(nu18>=3,3,nu18),
                    e00200=e00200p,
                    XTOT=ifelse(MARS==2,nu18+2,nu18+1))
df

write_csv(df, here("tax_calc_code","test_ctc_file_eitc_cbpp_rep.csv"))

test_file <- read_csv(here("tax_calc_code/test_ctc_file_eitc_cbpp_rep-22-#-#-#.csv"))

test_file %>% filter(EIC!=0 & EIC<=2) %>% 
  select(eitc,MARS,EIC,e00200) %>% 
  arrange(MARS,EIC) 

test_file_explicit <- read_csv(here("tax_calc_code/test_ctc_file_eitc_cbpp_rep-22-#-status-quo-eitc-#.csv"))

test_file_explicit %>% 
  select(eitc,MARS,EIC,e00200) %>% 
  arrange(MARS,EIC)`

EITC reform file

{    "EITC_c": {"2022": [560.0, 3733.0, 6164.0, 6935.0]},
    "EITC_rt": {"2022": [0.0765, 0.34,0.4,0.45]}, 
    "EITC_prt": {"2022": [0.0765,0.1598,0.2106,0.2106]},
    "EITC_ps": {"2022": [9160,20130,20130,20130]}, 
    "EITC_ps_MarriedJ": {"2022": [6130,6130,6130,6130]} 
}

Command line reforms run

tc "test_ctc_file_eitc_cbpp_rep.csv" 2022 --dump

tc "test_ctc_file_eitc_cbpp_rep.csv" 2022 --reform status-quo-eitc.json --dump
jdebacker commented 1 year ago

When fixing the issue pointed out in #2663, I find that the output from the R code above matches Table 1 of the linked CBPP doc:

eitc  MARS   EIC e00200
   <dbl> <dbl> <dbl>  <dbl>
 1 3733      2     1  15000
 2 3733      2     1  25000
 3 2336.     2     1  35000
 4 6000      2     2  15000
 5 6164      2     2  25000
 6 4323.     2     2  35000
 7 3733      4     1  15000
 8 2955.     4     1  25000
 9 1357.     4     1  35000
10 6000      4     2  15000
11 5138.     4     2  25000
12 3032.     4     2  35000
jdebacker commented 1 year ago

I believe this is fixed with PR #2663 (see comment above).

Thanks @JackLandry for pointing this out.