I am trying a create a variable with a kind of complicated argumentation. Essentially, the variable will say the tax rate the individual is paying, but what decides the tax rate changes like this:
In TIME = 1, the individuals with income above 450.000 pays 50% in taxes, while those below pay 25% (See the dummy ABOVE or INCOME)
In TIME = 2, everyone pays only 25% in taxes.
In TIME = 3, those in GROUP = 1, pays 25%, while GROUP = 2 pays 50%.
This is my data:
structure(list(ID = c(1, 1, 1, 2, 2, 2), TIME = c(1, 2, 3, 1,
2, 3), GROUP = c(2, 2, 2, 1, 1, 1), INCOME = c(419295.47, 428499.91,
403197.03, 1286735.3, 1390325.1, 1359411), HIGH = c(0, 0, 0,
1, 1, 1), ABOVE = c(0, 0, 0, 1, 1, 1)), row.names = c(NA, -6L
), class = c("tbl_df", "tbl", "data.frame"))
Thanks!