PSLmodels / Tax-Calculator

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

Payroll tax validation #2697

Closed bodiyang closed 3 months ago

bodiyang commented 11 months ago

I'm working on the validation of Tax-Calculator and Taxsim-35 and seeing the difference of payroll tax calculation between two models

I've conducted the manual calculation of many records and think Tax-Calculator is correct. So I want to open this issue to see if there is any suggestion of where the difference come from (if there is any issue from transferring Taxsim input variables to Tax-Calculator variables) @feenberg @jdebacker @MattHJensen

The record below is an example: the payroll tax value calculated from Tax-Calculator is $53090; the value from Taxsim35 is $39635

(taxsimid 10): year 2021 state 0 mstat 2 page 23 sage 28 depx 0 dep13 0 dep17 0 dep18 0 pwages 198000 swages 34000 psemp 298 ssemp 281 dividends 10000 intrec 2000 stcg 1000 ltcg -1000 otherprop 20000 nonprop 20000 pensions 23000 gssi 18000 pui 1000 sui 3000 transfers 0 rentpaid 0 proptax 0 otheritem 0 childcare 0 mortgage 0 scorp 103000 pbusinc 146000 pprofinc 0 sbusinc 170000 sprofinc 0 idtl 2

Taxsim to Tax-Calculator variables matching: (1) only the variables in bold text are related to payroll tax calculation (2) "pwages": "e00200p", "swages": "e00200s", "psemp": "e00900p", "ssemp": "e00900s",

'pbusinc': 'e00900p', # Not perfect match for this in Tax-Calculator -- will add to e00900s below

# 'pprofinc': # no direct analog in Tax-Calculator
# 'sbusinc': 'e00900s', # Not perfect match for this in Tax-Calculator -- will add to e00900s below
# 'sprofinc':# no direct analog in Tax-Calculator

e00200p = pwages e00200s = swages e00900p = psemp + pbusinc + pprofinc e00900s = ssemp + sbusinc + sprofinc

(3) the calculation method can be found at payroll tax function

note: The record above is just one example. There are many records showing differences. (not all of testing records, two models calculation are the same in the other records) The payroll tax diff does not have a trait ( e.g. taxsim values are greater than taxcalc in some records; but also lower than taxcalc in many —- so doesn't look like if one model miss any items) ~ I don’t find there is a correlation between the diff amount and any of the input variables

bodiyang commented 11 months ago

another example (taxsimid 9): year 2021 state 0 mstat 2 page 24 sage 21 depx 3 dep13 0 dep17 1 dep18 1 pwages 21000 swages 166000 psemp 23 ssemp 219 dividends 0 intrec 17000 stcg -8000 ltcg -6000 otherprop 5000 nonprop 15000 pensions 4000 gssi 16000 pui 7000 sui 3000 transfers 0 rentpaid 0 proptax 0 otheritem 0 childcare 0 mortgage 0 scorp 39000 pbusinc 27000 pprofinc 0 sbusinc 83000 sprofinc 0 idtl 2

Taxsim payroll tax: $41637 Tax-Calculator payroll tax: $32130

feenberg commented 11 months ago

I am working on an update to taxsim. If you visit

http://taxsim.nber.org/split

you can try it out. There are changes to the FICA calculation. I added a printout of a decomposition of the the FICA tax into components. Please give it a try. It looks like I get 17707 and 4215 for the OASDI components (taxpayer and spouse) and 5742 and 985 for the health insurance components. If you tell me what you get, I will track down the reason and fix it here if necessary.We made some decisions at the beginning that make it harder than necessary to do this calculation, so I am not surprised if there is a problem, but I'd like to focus on the problem component rather than go through all the calculations.

I am very grateful for your checking up on me!

Dan

On Wed, 20 Sep 2023, Bodi Yang wrote:

I'm working on the validation of Tax-Calculator and Taxsim-35 and seeing the difference of payroll tax calculation between two models

I've conducted the manual calculation of many records and think Tax-Calculator is correct. So I want to open this issue to see if there is any suggestion of where the difference come from (if there is any issue from transferring Taxsim input variables to Tax-Calculator variables) @feenberg @jdebacker @MattHJensen

The record below is an example: the payroll tax value calculated from Tax-Calculator is $53090; the value from Taxsim35 is $39635

(taxsimid 10): year 2021 state 0 mstat 2 page 23 sage 28 depx 0 dep13 0 dep17 0 dep18 0 pwages 198000 swages 34000 psemp 298 ssemp 281 dividends 10000 intrec 2000 stcg 1000 ltcg -1000 otherprop 20000 nonprop 20000 pensions 23000 gssi 18000 pui 1000 sui 3000 transfers 0 rentpaid 0 proptax 0 otheritem 0 childcare 0 mortgage 0 scorp 103000 pbusinc 146000 pprofinc 0 sbusinc 170000 sprofinc 0 idtl 2

Taxsim to Tax-Calculator variables matching: (1) only the variables in bold text are related to payroll tax calculation (2) "pwages": "e00200p", "swages": "e00200s", "psemp": "e00900p", "ssemp": "e00900s",

'pbusinc': 'e00900p', # Not perfect match for this in Tax-Calculator -- will add to e00900s below

'pprofinc': # no direct analog in Tax-Calculator

'sbusinc': 'e00900s', # Not perfect match for this in Tax-Calculator -- will add to e00900s below

'sprofinc':# no direct analog in Tax-Calculator

e00200p = pwages e00200s = swages e00900p = psemp + pbusinc + pprofinc e00900s = ssemp + sbusinc + sprofinc

(3) the calculation method can be found at payroll tax function

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/issues/2697 You are receiving this because you were mentioned.

Message ID: @.***>

feenberg commented 11 months ago

Can you make examples with only one source of income? That would show where the difference was.

Daniel Feenberg

On Wed, 20 Sep 2023, Bodi Yang wrote:

another example (taxsimid 11): year 2021 state 0 mstat 2 page 24 sage 21 depx 3 dep13 0 dep17 1 dep18 1 pwages 21000 swages 166000 psemp 23 ssemp 219 dividends 0 intrec 17000 stcg -8000 ltcg -6000 otherprop 5000 nonprop 15000 pensions 4000 gssi 16000 pui 7000 sui 3000 transfers 0 rentpaid 0 proptax 0 otheritem 0 childcare 0 mortgage 0 scorp 39000 pbusinc 27000 pprofinc 0 sbusinc 83000 sprofinc 0 idtl 2

Taxsim payroll tax: $41637 Tax-Calculator payroll tax: $32130

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/issues/2697#issuecomment-1728343952 You are receiving this because you were mentioned.

Message ID: @.***>

bodiyang commented 11 months ago

Thanks Daniel, Very helpful to see the decomposition of FICA tax. I'll have a try through the updated link and let you know the new findings I may have.

For the sources of income ~ The way I'm conducting the validation is to check the records, in 3 sets, with different income sources: a set only with wage & salary income, b set with more sources of income (from 11 pwages ~to 24 sui and then from 31 scorp ~ to 35 sprofinc; the two examples I shared are from b set) , c set with most sources of income (with all Taxsim income variables but no 25 transfers & 26 rentpaid)

a set, the set with only 11 pwages and 12 swages, shows no difference between Taxsim and Tax-Calculator b set and c set all show differences of the payroll tax calculation

Bodi Yang

bodiyang commented 11 months ago

@feenberg I've tried to run some records through the updated taxsim split link, and the result looks good.

One point to be noticed is that the updated taxsim calculates the FICA tax but not SECA tax. So the current comparison is only FICA tax, not payroll tax as a whole.

For the two example records the updated result of FICA tax is: taxsimid 9 record: Tax-Calculator $26083; updated Taxsim $26090 taxsimid 10 record: Tax-Calculator $31120; updated Taxsim $31163

martinholmer commented 3 months ago

@bodiyang, it has been almost a year since you opened issue #2697 and there has been no recent discussion. What is the status of this issue? Can it be closed? Or do you have a simple case in which TAXSIM35 and Tax-Calculator generate different payroll tax amounts?

bodiyang commented 3 months ago

@bodiyang, it has been almost a year since you opened issue #2697 and there has been no recent discussion. What is the status of this issue? Can it be closed? Or do you have a simple case in which TAXSIM35 and Tax-Calculator generate different payroll tax amounts?

This issue can be closed. Tax-Calc have been tested to produce correct payroll tax calculation.