library(data.table)
library(hutils)
library(magrittr)
library(ggplot2)

library(grattan)  # needs to be before require_taxstats..
require_taxstats()
require_taxstats1516()
s1516 <- 
  as.data.table(sample_file_1516_synth) %>%
  setkey(Taxable_Income) %>%
  mutate_ntile("Taxable_Income", n = 100L) %>%
  mutate_ntile("Taxable_Income", n = 10L) 
s1516[, tax := income_tax(Taxable_Income, "2015-16", .dots.ATO = .SD)]

Negative gearing

Tax benefits

by decile

Taxable Income Decile Average benefit from NG / $ Share
1 0 2%
2 100 2%
3 100 3%
4 100 5%
5 200 6%
6 200 8%
7 200 9%
8 300 12%
9 500 17%
10 1000 36%