Closed HughParsonage closed 5 years ago
Thanks @HughParsonage. I have to try and finalise the dental report today and will try to review this over the weekend.
Thanks @HughParsonage. Sorry for the delay. @k-griffiths is having a look to see if she can think of anything else that would be useful to add.
PS Github won't let me merge the PR while Travis is failing
medicare_levy_taper
=?)medicare_levy_rate
OR medicare_levy_taper
OR medicare_levy_upper_threshold
and the other two variables will adjust accordingly?medicare_tbl.tsv
?wage.series
and lf.series
?multiply_by(s1819[["WEIGHT"]][1L]
)Sw_amt
? excl_vars
is documented but I can’t find anything on Sw_amt
Thanks @HughParsonage this is all really helpful. As I said yesterday, I'm happy to merge the PR once @k-griffiths is happy, although Github won't let me merge while Travis is failing. From Tuesday I'll have some time to devote to this, so I hope we can talk next week.
I'm trying to construct a simple income tax change (increasing the top rate to 50%) and look at the budget impact in different years. I've then compared the outputs to STINMOD+ and they’re wildly different:
## Get latest year of ATO data (2015-16)
s1516 <- sample_file_1516_synth %>%
mutate(fy.year = "2015-16",
WEIGHT = 50, # Years with a 1% sample file have a weight of 100; years with a 2% sample file have a weight of 50
id = rownames(sample_file_1516_synth)) %>%
as.data.table
## Project data forward to current financial year (2018-19)
s1819 <- project(s1516, h = 3L) %>%
mutate(fy.year = "2018-19") %>%
as.data.table
## Increase highest income tax rate to 50% in 2018-19
s1819_alt_tax_rate <- model_income_tax(s1819, baseline_fy = "2018-19",
ordinary_tax_thresholds = c(0, 18200, 37000, 80000, 180000),
ordinary_tax_rates = c(0, 0.19, 0.325, 0.37, 0.50),
return. = "sample_file.int")
revenue_foregone(s1819_alt_tax_rate) #"$5.9 billion" extra revenue in 2018-19
revenue_foregone(s1819_alt_tax_rate, revenue_positive = TRUE) #"$5.9 billion" (same result with or without revenue_positive = TRUE)
## STINMOD+ comparison $1.8 billion in 2018-19
```r
What's happening here:
multiply_by(s1819[["WEIGHT"]][1L]).
You seem to be multiplying total tax by the projected weight, but I don’t get the 1L bit
[1L]
just means the first element. Since all weights are the same, we only need to multiply by the first.
What is
Sw_amt
? excl_vars is documented but I can’t find anything on Sw_amt
Sw_amt
is a column in the sample file, salary/wages amount.
Re the comparison with STINMOD, the reasons for the difference from most important to least:
Thanks Hugh. I've changed the second-highest rate now (it's $90k for 2018-19) and the results are still wildly different ($4.5b vs. $1.8b). The synthetic file doesn't make any difference to the total revenue gained. It must be something to do with the baseline comparison point, I'll keep working on it for now, but this would be a good example to add to the vignette.
I've now tried aligning model_income_tax outputs with both STINMOD+ and the Roach model. The big difference is for 2018-19 and STINMOD+ is the odd one out. All three fairly close for 2021-22.
# Get latest ATO sample file (2015-16)
data2016<- read.csv("2016 sample file/2016_sample_file.csv", stringsAsFactors=FALSE)
d1516 <- data2016 %>%
mutate(fy.year = "2015-16",
WEIGHT = 50, # Years with a 1% sample file have a weight of 100; years with a 2% sample file have a weight of 50
id = rownames(data2016)) %>%
as.data.table
# Project data forward to current financial year (2018-19)
d1819 <- project(d1516, h = 3L) %>%
mutate(fy.year = "2018-19") %>%
as.data.table
# Increase highest income tax rate to 50%
d1819_alt_tax_rate <- model_income_tax(d1819, baseline_fy = "2018-19",
ordinary_tax_thresholds = c(0, 18200, 37000, 90000, 180000),
ordinary_tax_rates = c(0, 0.19, 0.325, 0.37, 0.50))
revenue_foregone(d1819_alt_tax_rate) # "$4.1 billion" in extra revenue in 2018-19
# STINMOD+ comparison $1.8 billion in 2018-19
# Roach comparison $4.3 billion in 2018-19
# Model income tax in 2021-22 under the higher income tax rate of 50%
d2122 <- project(d1516, h = 6L) %>%
mutate(fy.year = "2021-22") %>%
as.data.table
d2122_alt_tax_rate <- model_income_tax(d2122, baseline_fy = "2018-19",
ordinary_tax_thresholds = c(0, 18200, 37000, 90000, 180000),
ordinary_tax_rates = c(0, 0.19, 0.325, 0.37, 0.50))
revenue_foregone(d2122_alt_tax_rate) # "$5.1 billion" in extra revenue in 2021-22
# STINMOD+ comparison $5.5 billion in 2021-22
# Roach comparison $5.6 billion in 2021-22
# Model income tax in 2022-23 under the higher income tax rate of 50%
d2223 <- project(d1516, h = 7L) %>%
mutate(fy.year = "2022-23") %>%
as.data.table
# Assume thresholds stay the same as 2018-19, only the top tax rate changes
d2223_alt_tax_rate_only <- model_income_tax(d2223, baseline_fy = "2018-19",
ordinary_tax_thresholds = c(0, 18200, 37000, 90000, 180000),
ordinary_tax_rates = c(0, 0.19, 0.325, 0.37, 0.50),
return. = "sample_file.int")
revenue_foregone(d2223_alt_tax_rate_only) # "$5.4 billion" in extra revenue compared to 2018-19 if thresholds are kept as per 2018-19 and top tax rate increased)
# STINMOD+ comparison $5.4 billion in 2022-23
# No Roach comparison available
@MattCowgill let me know what you think of the most recent commit (i.e. the vignette)