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

medicare_levy appears to be giving wrong result in 2015-16 #50

Open
thmcmahon opened this issue Feb 14, 2017 · 10 comments
Open

medicare_levy appears to be giving wrong result in 2015-16 #50

thmcmahon opened this issue Feb 14, 2017 · 10 comments

Comments

@thmcmahon
Copy link

So grattan::medicare_levy(24000, fy.year = '2015-16', Spouse_income = 28000, n_dependants = 3, family_status = 'family') returns 0, but according to the ATO calculator it should be $219.75.

@HughParsonage
Copy link
Owner

Well, somethings awry. But I get $67.16. https://www.ato.gov.au/Calculators-and-tools/Medicare-levy/

@thmcmahon
Copy link
Author

Ah yeah just redid the medicare calculator and I get $67.16 too - don't know where I got $219.75 from.

HughParsonage added a commit that referenced this issue Feb 15, 2017
@HughParsonage
Copy link
Owner

So currently medicare_levy(X, Spouse_income = Y) != medicare_levy(Y, Spouse_income = X). I'm trying to figure out whether this condition is contrary to the intention of the Act.

With medicare_levy(26000, fy.year = '2015-16', Spouse_income = 26000, n_dependants = 3, family_status = 'family') / 2 I get $64.50.

@HughParsonage
Copy link
Owner

I'll apply a fix to that which I know is wrong, but I stand by the current calculation method. It's possible the ATO calculator is wrong, but I've written to ask why.

The discrepancy lies in the reduction due to dependants. The spouse income calculation agrees with the calculator.

@thmcmahon
Copy link
Author

medicare_levy(X, Spouse_income = Y) != medicare_levy(Y, Spouse_income = X) is correct because where they're different they have a different proportion of the shading. The master tax guide has an explanation of how this is meant to work.

@HughParsonage
Copy link
Owner

Thanks. I don't have a copy of the Guide. I'd be super grateful if you discover why my formula is wrong.

HughParsonage added a commit that referenced this issue Feb 15, 2017
@HughParsonage
Copy link
Owner

medicare_levy on the dev branch (1b13a4b) currently agrees with the Masters Guide examples, but now collides with existing unit tests (notably those incorporating SAPTO). It's possible I've got the wrong thresholds and lower_up_for_each_child units.

HughParsonage added a commit that referenced this issue Feb 18, 2017
Checked Budget Paper No. 2
@HughParsonage
Copy link
Owner

HughParsonage commented Feb 18, 2017

The 2015-16 Budget Paper No. 2 (p. 26 print, p. 42 PDF) says the family threshold for 2015-16 should be 35,261 and the child should be 3238, but the ATO says the threshold is 36,000 (try incomes of $18,000 and $18,000, no children).

So it seems the ATO calculator is wrong and not all the unit tests I wrote (using this calculator) can be relied upon.

@thmcmahon
Copy link
Author

Great. That's annoying. I might ask the PBO whether they have a canonical source of inputs and outputs to write unit tests against.

@HughParsonage
Copy link
Owner

HughParsonage commented Feb 19, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants