PSLmodels / Tax-Calculator

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

TAXSIM-35 Validation, "b" files #2705

Closed jdebacker closed 8 months ago

jdebacker commented 11 months ago

This PR works through the validation of the "b" files in the TAXSIM-35 validation suite.

To validate:

bodiyang commented 11 months ago

Payroll tax is good to pass, with details can be found in the payroll tax validation issue.

So payrolltax (FICA+SECA) validation should be considered to pass

bodiyang commented 11 months ago

AGI c00100 validation:

I have manually calculated the AGE c00100 variable in "b", "c" sets for all years.

Tax-Calculator's result should be correct.

Some detailed analysis:

c00100 = ymod1 + c02500 - c02900 + taxable_ubi

Under Taxsim's variable name: ymod1 = pwages + swages + psemp + ssemp + dividends + intrec + otherprop + nonprop + pensions + pui +sui + scorp + pbusinc + sbusinc + MAX(-3000, stcg + ltcg)

c02500, social security benefit in AGI, is calculated based on gssi variable from Taxsim. I have manually calculated this item following Social Security Benefits Worksheet -- line 20a and 20b, in 1040 instructions. The result of c02500 matches with Tax-Calculator's result

taxable_ubi is Zero for all years in the validation sets, so there is no problem with this item

c02900, total of all "above the line" income adjustments to get AGI: This variable is consisted of many items, as in form 1040 Sch 1 . However, the only variable which is not zero, in this validation, is Deductible part of self-employment tax e03260. And since *e03260 = 0.5 setax** , we only need to conduct the validation of self-employment tax. From my last comment, SECA tax validation issue should not be concerned

So the c00100 AGI in Tax-Calculator should be correct. ~ difference of c00100 in Taxsim is likely come from the SECA tax calculation process (as mentioned before, Taxsim's payroll tax calculation is under the work of update)

bodiyang commented 11 months ago

c11070 Child Tax Credit for 2021 validation:

For year 2021, Child tax credit is categorized as nonrefundable child tax credit. So c11070 as the refunded Child tax credit is count as zero in Tax-Calculator. Taxsim35 calculates the amount of Child tax credit (it does not differentiate refundable vs nonrefundable credit) This issue is the same as and has been documented in the "a" set validation PR

jdebacker commented 11 months ago

@bodiyang Thanks for reviewing the differences.

Re c11070: The issue of refundability or not (and where counted) should be handled for 2021 via this fix to the taxcalc output. That's where there's no difference in this variable in the "a" set validation for 2021. So I believe the 6 records with differences in the 2021 "b" file are due to something else.

Re c00100, I don't think we can be confident in the overall AGI until we have the intermediate variables (such a c11070 taken care of). The diffs in AGI are pointing to underlying difference in the calculation of the components, so differences here not just reflecting the direct computation of the AGI you noted above.

Re the payroll taxes -- thanks for noting these known differences. Due to this, let's focus n getting the AGI/iitax difference to zero (or explaining any diffs) and not worry about payroll taxes.

bodiyang commented 11 months ago

@jdebacker

For c00100: I've already compared the intermediate variables, which are involved in c00100 calculation

note: c11070 is involved in the iitax calculation, but not c00100 AGI calculation

As documented in the previous comment: c00100 = ymod1 + c02500 - c02900 + taxable_ubi intermediate variables here are ymod1, c02500, c02900 and taxable_ubi We cannot get the value of these from Taxsim, so the way of validation is to compare the value of these intermediate variables from Tax-Calculator with manual calculation from tax forms.

ymod1 = pwages + swages + psemp + ssemp + dividends + intrec + otherprop + nonprop + pensions + pui +sui + scorp + pbusinc + sbusinc + MAX(-3000, stcg + ltcg) ymod1 is calculated directly from the input variable, and the value of this is correct.

other intermediate variables, c02500, c02900, taxable_ubi can be found at the details here

bodiyang commented 10 months ago

amt_liability is correct in Tax-Calculator

Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (in both 'b' & 'c' sets, from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results.

feenberg commented 10 months ago

Can you explain what you mean by "taxsim zero out all of the amt_liability result"? Are you referring to a taxsim output variable? What name? I am on vacation and will return to Cambridge on December 21, and can fix problems then.

Dan 617-682-6204

On Fri, 15 Dec 2023, Bodi Yang wrote:

amt_liability is correct in Tax-Calculator

Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (of different records from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results.

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1858405159 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

bodiyang commented 10 months ago

Can you explain what you mean by "taxsim zero out all of the amt_liability result"? Are you referring to a taxsim output variable? What name? I am on vacation and will return to Cambridge on December 21, and can fix problems then. Dan 617-682-6204 On Fri, 15 Dec 2023, Bodi Yang wrote: amt_liability is correct in Tax-Calculator Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (of different records from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you are subscribed to this thread. Message ID: @.***>

Taxsim's AMT calculation output ('27.AMT' in 'Federal tax calculation') is always zero, for all records which should have AMT.

As an example:

taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Bodi

bodiyang commented 10 months ago

non_refundable_child_odep_credit is correct in Tax-Calculator.

The result of my manual calculation match with the Tax-Calculator's result. To be noticed both Taxcalc and Taxsim do not consider the $1,000 rounding rule for the year 2021, as documented in issue

example record in c21: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc

So Tax-Calculator does slight off by the manual calculation, this is because of the $1,000 rounding rule mentioned in the issue above; I don't see the reason why Taxsim is off

manual calculation is in IMG_5185.HEIC.zip

The above is an example record. I have gone through records in both 'b' & 'c' set and Tax-Calculator should be correct.

bodiyang commented 10 months ago

@jdebacker I'm including both 'b' and 'c' sets validation in this PR, because they are showing similar differences.

feenberg commented 10 months ago

I am concerned that apparently this taxpayer with mstat=1 has both pui and sui non-zero. Taxsim checks for that, so perhaps sui is intended to be zero? I'll continue working under that assumption. It would help if sent all the results for this taxpayer, and possibly your calculation.

Daniel Feenberg 617-682-6204

On 12/18/23, Bodi Yang @.***> wrote:

Can you explain what you mean by "taxsim zero out all of the amt_liability result"? Are you referring to a taxsim output variable? What name? I am on vacation and will return to Cambridge on December 21, and can fix problems then. Dan 617-682-6204 On Fri, 15 Dec 2023, Bodi Yang wrote: amt_liability is correct in Tax-Calculator Taxsim zero out all of the amt_liability result, so should not be considered in the validation. I've conduct manual calculation (of different records from different years) following tax form 6251 and the manual calculation results all match with the Tax-Calculator's results. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you are subscribed to this thread. Message ID: @.***>

Taxsim's AMT calculation output ('27.AMT' in 'Federal tax calculation') is always zero, for all records which should have AMT.

As an example:

taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1860682145 You are receiving this because you commented.

Message ID: @.***>

bodiyang commented 10 months ago

I am concerned that apparently this taxpayer with mstat=1 has both pui and sui non-zero. Taxsim checks for that, so perhaps sui is intended to be zero? I'll continue working under that assumption. It would help if sent all the results for this taxpayer, and possibly your calculation. Daniel Feenberg 617-682-6204 On 12/18/23, Bodi Yang @.> wrote: > Can you explain what you mean by "taxsim zero out all of the amt_liability > result"? Are you referring to a taxsim output variable? What name? I am on > vacation and will return to Cambridge on December 21, and can fix problems > then. Dan 617-682-6204 > > On Fri, 15 Dec 2023, Bodi Yang wrote: amt_liability is correct in > Tax-Calculator Taxsim zero out all of the amt_liability result, so should > not be considered in the validation. I've conduct manual calculation (of > different records from different years) following tax form 6251 and the > manual calculation results all match with the Tax-Calculator's results. -- > Reply to this email directly or view it on GitHub: [#2705 > (comment)](#2705 (comment)) > You are receiving this because you are subscribed to this thread. Message > ID: @.> Taxsim's AMT calculation output ('27.AMT' in 'Federal tax calculation') is always zero, for all records which should have AMT. As an example: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>

The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6

My manual calculation can be found in the attached picture zip file in my previous comment

Best, Bodi

feenberg commented 10 months ago

On Mon, 25 Dec 2023, Bodi Yang wrote:

My manual calculation can be found in the attached picture zip file in my previous comment

At that page I see highlighted a link to a for 8812 that is not relevant.

Daniel Feenberg 617-682-6204

Best, Bodi

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1869138787 You are receiving this because you commented.

Message ID: @.***>

bodiyang commented 10 months ago

On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>

Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~

  1. I posted the issue of AMT in this comment

record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7

  1. And another issue of child tax credit in another comment here

example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc

The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17

The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6

bodiyang commented 10 months ago

On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>

Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~

  1. I posted the issue of AMT in this comment

record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7

  1. And another issue of child tax credit in another comment here

example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc

The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17

The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6

I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week.

feenberg commented 10 months ago

I am trying to work on the AMT issue. If I select comment 2705 it goes to a thread with a score of links. I can't find any that provide the manual calculation of the AMT example. It doesn't do any good to keep referring me to that thread, unless you believe I am missing a relevant link, and can provide more information to me about which link is relevant. Or you could just attach the manual calculation to the email.

Thank you Daniel Feenberg 617-682-6204

On Mon, 25 Dec 2023, Bodi Yang wrote:

On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 ? Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>

Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~

  1. I posted the issue of AMT in this comment

record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7

  1. And another issue of child tax credit in another comment here

example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc

The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17

The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1869176520 You are receiving this because you commented.

Message ID: @.***>

feenberg commented 10 months ago

Oh, I see, there isn't a manual calculation for the AMT yet. I missed that. I'll put off working on this then.

Sorry Daniel Feenberg 617-682-6204

On Mon, 25 Dec 2023, Bodi Yang wrote:

On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment)) At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 ? Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.***>

Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~

  1. I posted the issue of AMT in this comment

record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7

  1. And another issue of child tax credit in another comment here

example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc

The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17

The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6

I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week.

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1869177703 You are receiving this because you commented.

Message ID: @.***>

bodiyang commented 10 months ago

Oh, I see, there isn't a manual calculation for the AMT yet. I missed that. I'll put off working on this then. Sorry Daniel Feenberg 617-682-6204 On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment]([#2705 (comment)](#2705 (comment))) >> At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to this email directly or view it on GitHub: [#2705 (comment)](#2705 (comment)) You are receiving this because you commented. Message ID: @.> > > Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~ > > 1. I posted the issue of AMT [in this comment](#2705 (comment)) > > record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit [ in another comment here](#2705 (comment)) > > example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17 > > The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>

Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021

note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387)

record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7

feenberg commented 9 months ago

Can you send the 1040, Qualified Dividens and Capital Gain Tax worksheet and Schedule D itself also? I need to be able to put the taxpayer into TaxAct and see what it calculates and I am having trouble getting TaxAct to generate the numbers for line13, 20 and 27 of form 6251.

Thanks Daniel Feenberg +1 617-682-6204

On 1/2/24, Bodi Yang @.***> wrote:

Oh, I see, there isn't a manual calculation for the AMT yet. I missed that. I'll put off working on this then. Sorry Daniel Feenberg 617-682-6204 On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang wrote: My manual calculation can be found in [the attached picture zip file in my previous comment](#2705 (comment))

At that page I see highlighted a link to a for 8812 that is not relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.> > > Oh I see, we probably end up talking about different issues in this PR. Sorry about the confusion. So there are two issues so far ~ > > 1. I posted the issue of AMT in this comment record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit in another comment here example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The non_refundable_child_odep_credit should be $250, by my manual calculation following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim result is $3.17 > > The result I got from taxsim of this record is: income tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual calculation of the AMT issue later. I'm traveling and left my manual calculation draft in office. Will get back next week. -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>

Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021

note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387)

record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl

This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output.

Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1874221082 You are receiving this because you commented.

Message ID: @.***>

bodiyang commented 9 months ago

Can you send the 1040, Qualified Dividens and Capital Gain Tax worksheet and Schedule D itself also? I need to be able to put the taxpayer into TaxAct and see what it calculates and I am having trouble getting TaxAct to generate the numbers for line13, 20 and 27 of form 6251. Thanks Daniel Feenberg +1 617-682-6204 On 1/2/24, Bodi Yang @.> wrote: > Oh, I see, there isn't a manual calculation for the AMT yet. I missed > that. I'll put off working on this then. Sorry Daniel Feenberg > 617-682-6204 > > On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang > wrote: My manual calculation can be found in [the attached picture zip > file in my previous comment]([#2705 (comment)]([#2705 > (comment)](#2705 (comment)))) > >> At that page I see highlighted a link to a for 8812 that is not > relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to > this email directly or view it on GitHub: [#2705 (comment)]([#2705 > (comment)](#2705 (comment))) > You are receiving this because you commented. Message ID: @.> > > > Oh I see, we probably end up talking about different issues in this PR. > Sorry about the confusion. So there are two issues so far ~ > > 1. I > posted the issue of AMT [in this comment]([#2705 > (comment)](#2705 (comment))) > > > record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 > dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec > 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi > 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare > mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > > This record should have $20401 AMT liability, but Taxsim is showing zero > for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: > $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit > [ in another comment here]([#2705 > (comment)](#2705 (comment))) > > > example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 > depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp > 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop > 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 > proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 > pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The > non_refundable_child_odep_credit should be $250, by my manual calculation > following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim > result is $3.17 > > The result I got from taxsim of this record is: income > tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual > calculation of the AMT issue later. I'm traveling and left my manual > calculation draft in office. Will get back next week. -- Reply to this > email directly or view it on GitHub: [#2705 > (comment)](#2705 (comment)) > You are receiving this because you commented. Message ID: @.> Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021 note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387) record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>

I've attached the Qualified Dividends and Capital Gain Tax Worksheet and form 1040 Sch D ~ I only completed the lines which is related

When filling Form 6251 line 13 of Form 6251 = line 4 of Qualified Dividends and Capital Gain Tax Worksheet = 18000 line 20 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811 line 27 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811

Note: line 1 of the Qualified Dividends and Capital Gain Tax Worksheet is the taxable income Form 1040 line 15, which is read from the Tax-Calculator output $607811 (taxable income from Taxsim35 is $680442)

feenberg commented 9 months ago

1) Maybe I am not entering the data correctly. Attached is taxsim output showing AGI of 762,817, which is suspiciously close to your 762,940 for taxable income on the 6251. But I see a QBI deduction of 134,600, which means taxable income should be much less and significantly lowers the AMT.

2) Are you using the latest version of taxsim? Online it is at

http://taxsim.nber.org/taxsimtest

and I have attached fortran source code. Actually, I can see you are using taxsim35, while I am trying to get taxsimtest ready to make the production version. It is really important that you test against the new version.

3) I am still concerned that the numbers you gave me can not be the numbers used by taxsim, since you specified mstat==1 and then have spouse UI. I don't understand why you are so reluctant to show me your work. It would clarify things if I had the 1040, or at least the data from that page. Can your software print out an observation? That might be enough.

4) Something about your mail client Daniel Feenberg +1 617-682-6204

On Fri, 5 Jan 2024, Bodi Yang wrote:

Can you send the 1040, Qualified Dividens and Capital Gain Tax worksheet and Schedule D itself also? I need to be able to put the taxpayer into TaxAct and see what it calculates and I am having trouble getting TaxAct to generate the numbers for line13, 20 and 27 of form 6251. Thanks Daniel Feenberg +1 617-682-6204 ? On 1/2/24, Bodi Yang @.> wrote: > Oh, I see, there isn't a manual calculation for the AMT yet. I missed > that. I'll put off working on this then. Sorry Daniel Feenberg > 617-682-6204 > ? > On Mon, 25 Dec 2023, Bodi Yang wrote: >> On Mon, 25 Dec 2023, Bodi Yang > wrote: My manual calculation can be found in [the attached picture zip > file in my previous comment]([#2705 (comment)]([#2705 > (comment)](#2705 (comment)))) > >> At that page I see highlighted a link to a for 8812 that is not > relevant. Daniel Feenberg 617-682-6204 >> ? >> Best, Bodi -- Reply to > this email directly or view it on GitHub: [#2705 (comment)]([#2705 > (comment)](#2705 (comment))) > You are receiving this because you commented. Message ID: @.> > > > Oh I see, we probably end up talking about different issues in! this PR. > Sorry about the confusion. So there are two issues so far ~ > > 1. I > posted the issue of AMT [in this comment]([#2705 > (comment)](#2705 (comment))) > > > record: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 > dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec > 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi > 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare > mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc idtl > > > This record should have $20401 AMT liability, but Taxsim is showing zero > for the AMT output. > > Taxsim output: income tax $ 213264.5. payroll tax: > $27343.59. AGI: $762930.7 > > 2. And another issue of child tax credit > [ in another comment here]([#2705 > (comment)](#2705 (comment))) > > > example record: taxsimid 222 year 2021 state mstat 2 page 75 sage 74 > depx 3 dep13 3 dep17 3 dep18 3 pwages 14000 swages 20000 psemp 278 ssemp > 281 dividends 18000 intrec 5000 stcg 0 ltcg -2000 otherprop 3000 nonprop > 26000 pensions 16000 gssi 16000 pui 10000 sui 7000 transfers 0 rentpaid 0 > proptax 6000 otheritem 10000 childcare 4000 mortgage 39000 scorp 165000 > pbusinc 121000 pprofinc 0 sbusinc 114000 sprofinc > > The > non_refundable_child_odep_credit should be $250, by my manual calculation > following form 1040 schdule 8812. Tax-Calculator result is $274.14; Taxsim > result is $3.17 > > The result I got from taxsim of this record is: income > tax $95709.64. payroll tax $27665.4. AGI $ 519936.6 I may send my manual > calculation of the AMT issue later. I'm traveling and left my manual > calculation draft in office. Will get back next week. -- Reply to this > email directly or view it on GitHub: [#2705 > (comment)](#2705 (comment)) > You a! re receiving this because you commented. Message ID: @.> Hi Daniel, I've attached the manual calculation of the AMT issue record in this file: AMT record.zip The manual calculation follows form 6251 of the year 2021 note: line 4 of the form, Alternative minimum taxable income $762940; and line 10 of the form, Form 1040 or 1040-SR line 16 ... $183930 are intermediate variables read from output of Tax-Calculator (These two intermediate variables' result from Taxsim are: AMT taxable income $700942; line 16 of form 1040 is $214387) record input: taxsimid year 2021 state mstat 1 page 77 sage depx 5 dep13 0 dep17 0 dep18 0 pwages 2000 swages psemp 147 ssemp dividends 17000 intrec 7000 stcg 7000 ltcg 1000 otherprop 19000 nonprop 13000 pensions 24000 gssi 1000 pui 6000 sui 6000 transfers rentpaid proptax otheritem childcare mortgage scorp 350000 pbusinc 323000 pprofinc sbusinc sprofinc! idtl This record should have $20401 AMT liability, but Taxsim is showing zero for the AMT output. Taxsim output: income tax $ 213264.5. payroll tax: $27343.59. AGI: $762930.7 -- Reply to this email directly or view it on GitHub: #2705 (comment) You are receiving this because you commented. Message ID: @.>

I've attached the Qualified Dividends and Capital Gain Tax Worksheet and form 1040 Sch D ~ I only completed the lines which is related

When filling Form 6251 line 13 of Form 6251 = line 4 of Qualified Dividends and Capital Gain Tax Worksheet = 18000 line 20 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811 line 27 of Form 6251 = line 5 of Qualified Dividends and Capital Gain Tax Worksheet = 589811

Note: line 1 of the Qualified Dividends and Capital Gain Tax Worksheet is the taxable income Form 1040 line 15, which is read from the Tax-Calculator output $607811 (taxable income from Taxsim35 is $680442)

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1878962626 You are receiving this because you commented.

Message ID: @.***> NBER TAXSIM (Compiled 20240104) With TCJA State law coded through 2022 Later state laws extrapolated from that year. Marginal tax rate wrt taxpayer earnings.

Input Data:

  1. Record ID: 1.
  2. Tax Year: 2021.00 State not specified
  3. Marital Status: 1.00 HoH
    5-6. Age (Txpyr/Spouse): 77.00 0.00
  4. Dependent Exemptions: 5.00 Dependent Ages 0.00 0.00 0.00 8-10. #deps for CCC/CTC/EIC: 5.00 5.00 5.00 11-12. Wages (Txpyr/Spouse): 2000.00 0.00 11a12a Self-employment income: 147.00 0.00

    1. Dividend Income: 17000.00
    2. Interest Received: 7000.00
    3. Short Term Gains: 7000.00
    4. Long Term Gains: 1000.00
    5. Other Property: 19000.00
    6. Other Non-Property: 13000.00
    7. Taxable Pensions: 24000.00
    8. Gross Social Security: 1000.00
    9. Tot/Txpy/Spouse UI : 0.00 6000.00 6000.00
    10. Non-taxable Transfers: 0.00
    11. Rent Paid: 0.00
    12. Property Taxes Paid: 0.00
    13. Other Itemized Deds: 0.00
    14. Child Care Expenses: 0.00
    15. Mortgage Interest: 0.00
    16. S-Corp profits: 350000.00 29 31. Txpy/Spouse QBI w/o PO: 323000.00 0.00 30 32. Txpy/Spouse SSTB w PO: 0.00 0.00

    Basic Output:

    1. Record ID: 1.
    2. Year: 2021 State not specified
    3. Federal IIT Liability: 186356.00
    4. State IIT Liability: 0.00
    5. SS Payroll Tax Liability: 26543.56 Marginal Rates wrt Earner
    6. Federal Marginal Rate: 37.00
    7. State Marginal Rate: 0.00
    8. Taxpayer SS Rate: 0.00

    Federal Tax Calculation: Base +$1

  5. Federal AGI 762816.22 762817.22
  6. UI in AGI 1979+ 12000.00 12000.00
  7. Social Security in AGI 84 850.00 850.00
  8. Zero Bracket Amount 20500.00 20500.00
  9. Personal Exemptions 0.00 0.00
  10. Exemption Phaseout 1991+ 0.00 0.00
  11. Deduction Phaseout 1991+ 0.00 0.00
  12. Deductions allowed 0.00 0.00 QBI deduction 134600.00 134600.00
  13. Federal Taxable Income 607716.22 607717.22
  14. Federal Regular Tax 187478.00 187478.37
  15. Exemption Surtax 1988-96 0.00 0.00
  16. General Tax Credit 1975-8 0.00 0.00
  17. Child Tax Credit 0.00 0.00 Additional CTC 0.00 0.00 23 Refundable Part 0.00 0.00
  18. Child Care Credit 1076+ 0.00 0.00
  19. Earned Income Credit 1975 0.00 0.00
  20. Alternative Min Income: 628216.22 628217.22
  21. AMT 0.00 0.00
  22. Income Tax Before Credits 184418.00 184418.37 Total Credits 0.00 0.00
  23. FICA 26543.56 26543.65 Taxpayer share of FICA 26390.56 26390.58

    TCJA 2018+

  24. QBI Deduction 134600.00 134600.00

    Additional Medicare Taxes 2013+

  25. Net Investment Income Tax 1938.00 1938.00
  26. Medicare Tax on Earnings 1126.32 1126.33

    Decomposition of Federal Marginal Rate (taxpayer earned income)

    Regular Income Tax Bracket rate from X,Y or Z 42.00 Deduction Phaseout: 0.00 Exemption Phaseout: 0.00 Social Security Phasein: 0.00 Child Tax Credit: 0.00 Child Care Credit: 0.00 Refundable Part of CTC: 0.00 Earned Income Credit: 0.00 Surtax on 15% bracket: 0.00 Exemption Surtax: 0.00 Unemployment Insurance: 0.00 Max Tax on Earned Income: 18000.00 Elderly Credit: 0.00 Dependent Care Credit: 0.00 Percentage Std Deduction: 0.00 Medicare tax on Unearned Inco 0.00 Cares Recovery Rebates: 0.00

    Alternative Minimum Income Tax
    AMT Bracket Rate 28.00 AMT Phaseout -28.00

    Only Regular Tax Relevant Total Marginal Rate: 42.00 FICA w Medicare (t,s): 0.00 0.00

c This is the fixed format Fortran-90 source code for TAXSIM c as compiled 20240105. It is copyright 2023 by NBER and c Daniel Feenberg. Please do not pass along to other users. c Refer potential users to @.*** for their own c copy.

c Documentation is at http://taxsim.nber.org

c Bug reports and suggestions for improvement are always welcome.

c Thank you

c Daniel Feenberg c +1 617-617-682-6204 c @.***

  block data mrhb
  common/mrhc/mrh
  data mrh/1/
  end

  double precision function rup(a,h)

c a=value to round up to a multiple of h and non-negative implicit double precision (a-h,o-z) common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders, &gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100) extnd(88)=1.d0 if(extnd(88).eq.0.d0) then rup=max(a,0.d0) else rup=max(0.d0,ceiling(a/h)*h) endif return end

  double precision function sern(d)
  implicit double precision(a-h,o-z)
  dimension d(255)
  if(d(2).eq.2.and.d(85)+d(86).gt.0.d0) then 
     sern=min(d(85),d(86))
  else
     sern=d(11)
  endif
  return
  end

  integer function itwn(i,imin,imax)
  itwn=min(imax,max(i,imin))
  return
  end
  subroutine statax(data,lawyr,comnew)                                      
  implicit double precision (A-H,O-Z)                                       
  parameter(lastat=2022)                                                    
  common /psubr/ xndx,amtpi,almnpx,egtrra,almzbr,almst,enders,              
 &gjtrra,ratmul,cgmul,amtmul,tipra,wilhlc,extnd(0:100)                      
  common/calc/hy,rent,agi,exemp,stded,xitded,taxinc,pcred,chcr,             
 & earncr,credit,rt,taxbc,rebate,energy,ctc,ylow,amt 
  common /xndxac/ xndxa(1981:2023)                                          
  dimension data(255),comnew(255)                                           
  dimension ds(255),coms(255)                                               

c DO NOT FORGET TO UPDATE parameter(lastat) EVERY YEAR
agi=0.
exemp =0.
stded =0.
xitded=0.
taxinc=0.
pcred =0.
chcr =0.
earncr=0.
credit=0.
rt =0. taxbc =0. rebate=0. energy=0. ctc =0. ylow =0. amt =0. stax=0.
rt=0.
hy=data(159)
rent=data(160)
comnew(74)=0.
id=int(abs(data(6)))

  if(lawyr.eq.-99) then                                                     
     lawyr=lastat                                                           
     return                                                                 
  endif                                                                     

  if(lawyr.lt.1977) then                                                    
    write(*,*) 
 &  'TAXSIM: State Tax Calculator available for years 1977+'              
    return                                                                   
  endif                                                                     

  if(id.le.0.or.id.gt.51) return                                            

  flate = 1.                                                                
  law = lawyr                                                               
  if(extnd(21).gt.0) law = int(extnd(21))                                        
  if(law.gt.lastat) then                                                    
    flate = xndxa(law)/xndxa(lastat)                                        
    law = lastat                                                            
  endif                                                                     

  do 100 i=1,255                                                            
     ds(i) = data(i)                                                        
     coms(i) = comnew(i)                                                    

100 continue
do 200 i=11,99
ds(i) = data(i)/flate
ds(i+100) = data(i+100)/flate
200 continue
do 300 i=1,98
if(i.ne.26.and.i.ne.65.and.i.ne.72.and.i.ne.73)
& coms(i) = comnew(i)/flate
300 continue

  i=int(data(6))                                                            
  select case(i)
  case(1)                                                                                
  call altax(ds,coms,stax,law)                                              
  case(2)                                                                  
  call aktax(ds,coms,stax,law)                                              
  case(3)                                                                  
  call aztax(ds,coms,stax,law)                                              
  case(4)
  call artax(ds,coms,stax,law)                                              
  case(5)
  call catax(ds,coms,stax,law)                                              
  case(6)
  call cotax(ds,coms,stax,law)                                              
  case(7)
  call cttax(ds,coms,stax,law)                                              
  case(8)
  call detax(ds,coms,stax,law)                                              
  case(9)
  call dctax(ds,coms,stax,law)                                              
  case(11)
  call gatax(ds,coms,stax,law)                                              
  case(12)
  call hitax(ds,coms,stax,law)                                              
  case(13)
  call idtax(ds,coms,stax,law)                                              
  case(14)
  call iltax(ds,coms,stax,law)                                              
  case(15)
  call intax(ds,coms,stax,law)                                              
  case(16)
  call iatax(ds,coms,stax,law)                                              
  case(17)
  call kstax(ds,coms,stax,law)                                              
  case(18)
  call kytax(ds,coms,stax,law)                                              
  case(19)
  call latax(ds,coms,stax,law)                                              
  case(20)
  call metax(ds,coms,stax,law)                                              
  case(21)
  call mdtax(ds,coms,stax,law)                                              
  case(22)
  call matax(ds,coms,stax,law)                                              
  case(23)
  call mitax(ds,coms,stax,law)                                              
  case(24)
  call mntax(ds,coms,stax,law)                                              
  case(25)
  call mstax(ds,coms,stax,law)                                              
  case(26)
  call motax(ds,coms,stax,law)                                              
  case(27)
  call mttax(ds,coms,stax,law)                                              
  case(28)
  call netax(ds,coms,stax,law)                                              
  case(30)
  call nhtax(ds,coms,stax,law)                                              
  case(31)
  call njtax(ds,coms,stax,law)                                              
  case(32)
  call nmtax(ds,coms,stax,law)                                              
  case(33)
  call nytax(ds,coms,stax,law)                                              
  case(34)
  call nctax(ds,coms,stax,law)                                              
  case(35)
  call ndtax(ds,coms,stax,law)                                              
  case(36)
  call ohtax(ds,coms,stax,law)                                              
  case(37)
  call oktax(ds,coms,stax,law)                                              
  case(38)
  call ortax(ds,coms,stax,law)                                              
  case(39)
  call patax(ds,coms,stax,law)                                              
  case(40)
  call ritax(ds,coms,stax,law)                                              
  case(41)
  call sctax(ds,coms,stax,law)                                              
  case(43)
  call tntax(ds,coms,stax,law)                                              
  case(45)
  call uttax(ds,coms,stax,law)                                              
  case(46)
  call vttax(ds,coms,stax,law)                                              
  case(47)
  call vatax(ds,coms,stax,law)                                              
  case(49)
  call wvtax(ds,coms,stax,law)                                              
  case(50)
  call witax(ds,coms,stax,law)
  case default
  stax=0.d0
  end select

  comnew(74) = stax*flate                                                   
  return                                                                    
  end                                                                       

c
c Subroutines from Statutil
c
recursive double precision function socsec(data,comnew,law)
implicit double precision (A-H,O-Z)
dimension data(255),comnew(255),rate(1977:2025),ceil(1977:2029)
data rate

c All social security income is exempt from state taxes
if(law.ge.1984)agi=agi-comnew(79)
if(law.ge.1987) agi=agi-data(26)

c Standard Deduction if(law.le.2006) then stded = twn(std77(law,1)agi,0.d0,data(7)std77(law,2)) else i=m2i(int(data(2))) j=int(data(7)+sep-1.d0) if(data(2).eq.4.d0.or.data(2).eq.7) i=3 por = ( std07(law,3,i)-std07(law,4,i))/ & (std07(law,2,i)-std07(law,1,i)) por=max(0.d0,por) excess=max(0.d0,agi-std07(law,1,j)/sep) stded = std07(law,3,i)/sep-excesspor stded = twn(stded,std07(law,4,i)/sep,std07(law,3,i)/sep) if(data(2).eq.4) then stded=1.72stded/2.d0 endif

c XITDED
ag=max(0.0d0,agi)
if(law.le.1982) then
xitded = data(56)+data(57)+comnew(23)+data(61)
& +max(0.0d0,data(63)-.02ag)+data(66)
else
xitded = data(56)+data(57)+comnew(23)+max(0.0d0,data(61)-.1
ag)
& +max(0.0d0,data(63)-.02ag)+data(66)
endif
if(law.le.1991) then
xitded=xitded+max(0.0d0,max(0.0d0,data(48)-.01
ag)+
& data(49)+min(150.0d0,data(47))-.03ag)
else if(law.ge.1992) then
xitded=xitded+max(0.0d0,data(49)-.04
ag) endif
if(law.ge.1982) xitded=xitded+data(51)+data(54)
if(law.ge.1982) then
fica = comnew(190)
else fica=0. endif if(law.le.1981)xitded=xitded-max(0.0d0,comnew(23)-ag*.15)
c accounts for deduction of fed inc tax
c tax based on withholding; don't count for credits
if(law.le.1999)fedtax=max(comnew(1),0.0d0)
if(law.ge.2000.and.law.le.2008)fedtax =
& max(comnew(52)+comnew(70)-comnew(58),0.0d0)
c 2009+ Federal Income Tax deduction worksheet
if(law.ge.2009) fedtax = max(0.0d0,
& comnew(154)+comnew(173)-comnew(59)-comnew(93))
c Child Tax credit, child care credit, eic recomputed for 2020
if(law.eq.2021) then
d101 = law
d103 = law
data(101) = 2020
data(103) = 2020
call nlaw(data,2020)
chcare = comnew(53)
chcred = comnew(81)
eitc = comnew(59) data(101) = d101
data(103) = d103
call nlaw(data,2021)
fedtax = max(0.0d0,
& comnew(52)+comnew(173)-eitc-chcred-chcare)
endif deduc=max(stded,xitded)+fedtax

c EXEMPTIONS
if(int(data(2)).eq.2.or.data(2).eq.4) then
exemp=3000.
else
exemp=1500.
endif
c Dependent Exemptions
if(law.le.2005) then exemp=exemp+300data(8) else if(law.eq.2006) then exemp=exemp+500data(8) else
e88 = 1.d0 - extnd(88) if(agi.lt.xmp(law,1)) then xmpdep = 1000.d0 - e88agi/xmp(law,1)500.d0 elseif(agi.lt.xmp(law,2)) then po = e88(agi-xmp(law,1))/(xmp(law,2)-xmp(law,1)) xmpdep = 500.d0(1.d0-po) else
xmpdep = 300.d0 endif xmpdep = max(xmpdep,0.d0)
exemp=exemp + xmpdep*data(8)

  endif                
  taxinc = max(0.0d0,agi-deduc-exemp-fica)
  if(law.le.1981) then                                                      
    call look(tab, taxinc,4,n,statax,1.0d00,0.0d0,rt,data)                  
  else if(law.ge.1982) then                                                 
    taxy = taxinc                                                           
    if(mst.eq.2) taxy = taxinc/2                                            
    call look(tab82,taxy,3,n,stat,1.0d00, 0.0d0,rt,data)                    
    statax = stat                                                           
    if(mst.eq.2) statax =stat*2                                             
  endif                                                                     

c deduction for solar energy credit; non-refundable
solcrd=0.
if(law.ge.1981.and.law.le.1986)solcrd=data(38)
taxbc=statax statax=max(0.0d0,statax-solcrd) credit = solcrd
return
end
subroutine aktax(data,comnew,statax,law)
c Personal income tax repealed in 1980 after the oil boom.
implicit double precision (A-H,O-Z)
common/calc/hy,rent,agi,exemp,stded,xitded,taxinc,pcred,chcr,
&earncr,credit,rt,taxbc,rebate,energy,ctc,ylow,amt dimension data(255),comnew(255)
dimension aktab1(2,25),aktab2(2,25),aktab3(2,25),cred(1977:1988)
data aktab1 / 2000.0d0, 3.0d0, 4000.0d0, 3.5d0,
& 6000.0d0, 4.0d0, 8000.0d0, 5.0d0, 10000.0d0, 2.5d0,
& 12000.0d0, 6.0d0, 14000.0d0, 7.0d0, 16000.0d0, 7.5d0,
& 18000.0d0, 8.0d0, 20000.0d0, 8.5d0, 22000.0d0, 9.0d0,
& 26000.0d0, 9.5d0, 32000.0d0,10.0d0, 38000.0d0,10.5d0,
& 44000.0d0,11.0d0, 50000.0d0,11.5d0, 60000.0d0,12.0d0,
& 70000.0d0,12.5d0, 80000.0d0,13.0d0, 90000.0d0,13.5d0,
&100000.0d0,14.0d0,150000.0d0,14.0d0, 1.e20, 14.5d0,
& 0.0d0, 0.0d0, 0.0d0, 0.0d0 /
data aktab2/

jdebacker commented 9 months ago

@bodiyang Can you look at the Differences_Explained.md file and let me know if I've gotten the description of the differences in the "b" set correct? Thanks!

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.54%. Comparing base (e2f14f3) to head (7c9e432).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2705/graphs/tree.svg?width=650&height=150&src=pr&token=KqtTvRSNjQ&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2705?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #2705 +/- ## ======================================= Coverage 98.54% 98.54% ======================================= Files 14 14 Lines 2616 2616 ======================================= Hits 2578 2578 Misses 38 38 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2705/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/Tax-Calculator/pull/2705/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `98.54% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more.
bodiyang commented 9 months ago

@bodiyang Can you look at the Differences_Explained.md file and let me know if I've gotten the description of the differences in the "b" set correct? Thanks!

The description looks good to me. Just on point, it's better to clarify TAXMSIM as TAXSIM-35 in the 'b' file section (because the updated testing version of TAXSIM have some calculation differences from TAXSIM-35).

feenberg commented 9 months ago

I am completely baffled by what is going on. Can you just give me a call?

Daniel Feenberg 617-682-6204

On Wed, 17 Jan 2024, Bodi Yang wrote:

@bodiyang Can you look at the Differences_Explained.md file and let me know if I've gotten the description of the differences in the "b" set correct? Thanks!

The description looks good to me. Just on point, it's better to clarify TAXMSIM as TAXSIM-35 in the 'b' file section (because the updated testing version of TAXSIM have some calculation differences from TAXSIM-35).

-- Reply to this email directly or view it on GitHub: https://github.com/PSLmodels/Tax-Calculator/pull/2705#issuecomment-1895932573 You are receiving this because you commented.

Message ID: @.***>