To contact us Click
HERE
April is tax season, so I thought it would be interesting to draw some graphs related to tax rates. We won't need advanced mathematics, but we will use R to make the graphs. As regular readers will recall, R is a widely used, free, high quality, open source, cross platform programming environment, well suited to graphing and doing statistical calculations, and also easy for beginners to learn to use. We won't be giving tax advice, of course, but we can draw some interesting generic graphs that help visualize the difference between
average and
marginal tax rates.

It is probably worth repeating the disclaimer: nothing in this postshould be construed as tax advice. We are simply going to takepublished information on tax rates and use them to draw graphs ofhypothetical situations. Our calculations could be incorrect, and forsure, our calculations will leave out all sorts of subtle detailsrelated to your own personal financial situation, so you should alwaysconsult your own personal tax advisor if you need any actual adviceabout taxes.
Roughly speaking, income tax in the US at the national level workslike this:
- Add up all the money you made this year to get your gross income
- Subtract off various deductions for things like having children or having a mortgage, to get your taxable income
- Look up your taxable income in a table to find your tax.
The third step involves a lookup table, rather than a straightforwardmultiplication by an effective tax rate, because the effective rate variescontinuously with income. Underlying the table are a series offormulas defining your tax as an increasing function of your taxableincome, specified by a series of tax
rates and
brackets.
There are also state and local (city) income taxes, and sales(consumption) taxes, not to mention Social Security and Medicaretaxes, but to keep things simple we will only look at income tax atthe
federal (national) level, since this is generally thebiggest tax most people face.
In real life there are many, many subtle points depending onthe sources of your income and the exact sorts of deductions youqualify for, all of which we will completely ignore here.
In fact, to keep things really simple, we will assume your only incomeis a cash salary from your job, and that you have no children, nomortgage, no side business, or any other complicating factors.
Let's start with a graph of the actual tax rates as a function oftaxable income. This will be a useful overview, and will help clarifythe difference between
average and
marginal taxrates.
IRS form W-4S has the 2012 (forward looking) Tax Rate Schedules. Thesetables describe the federal income tax (T) as a function of the amount of
taxable income (I) people earn in 2012. For people who are
marriedand filing jointly, the tax is given by:
- T = 0.1 * I, for 0 < I < 17400,
- T = 0.15 * (I-17400) + 1740, for 17400 < I < 70700,
- T = 0.25 * (I-70700) + 9735, for 70700 < I < 142700,
- T = 0.28 * (I-142700) + 27735, for 142700 < I < 217450,
- T = 0.33 * (I-217450) + 48665, for 217450 < I < 388350,
- T = 0.35 * (I-388350) + 105062, for 388350 < I.
This describes acontinuous, piecewise linear function. The ranges on which the function is linear are known astax
brackets, and the corresponding slopes (the percentagerates) are the
marginal tax rates.To see that the function is indeedcontinuous, compare the results at the end of one bracket with thebeginning of the next. For instance, in R notation:
I <- 707000.15 * (I-17400) + 17400.25 * (I-70700) + 9735
This prints 9735 twice: once for the end of the 15% bracket, once forthe beginning of the 25% bracket.
To follow along, you can go to the R Projectsite to download the latest version for Windows, Mac or Linux.If you need help getting started,the RTutorial For A WINDOWS Environment has screen shots walking youthrough your very first time running R on Windows, specifically how totell it which folder you want to work from, and how to do some basiccalculations.
Let's start by converting the rates listed above into a function thatwe can graph.
married <- function(I) { if(I<17400) 0.1 * I else if(I<70700) 0.15 * (I-17400) + 1740 else if(I<142700) 0.25 * (I-70700) + 9735 else if(I<217450) 0.28 * (I-142700) + 27735 else if(I<388350) 0.33 * (I-217450) + 48665 else 0.35 * (I-388350) + 105062}
This is just a sequence of
if statements that figure outwhich bracket the income (I) is in, and then return the tax using thecorresponding formula.
Now we can make a graph. We will let income vary from 0 to 400,000, sothat we can see all the different brackets come into play.
x <- 0:400m <- sapply(x*1000, married)/1000plot(x, m, type="l", xlab="Taxable Income (thousands)", ylab="2012 Tax for Married Filing Jointly (thousands)")
The result is

Indeed the function is continuous and piecewise linear. However, it isnot particularly interesting, mainly because it is hard to see a lotof detail in it. There are several possible alternative ways tovisualize it. First, we could plot the base10 logarithmof income and tax. Recall that this just converts 10^n to n, inother words, 1000 becomes 3, 10,000 becomes 4, and one hundred thousandbecomes 5. This lets us see a wide range of incomes and taxes, without the highend dominating the graph as much. The code is
x <- (1:400)*1000m <- sapply(x, married)plot(log10(x), log10(m), type="l", xlab="Taxable Income (log10)", ylab="2012 Tax for Married Filing Jointly (log10)")
The result is

This is a little better, but not much. We can see the kinks in thecurve where we shift from one bracket to the next (placeswhere the slope changes), but it still lookslike an almost straight diagonal line upward.
The overall straightness is not too surprising, since the taxis more or less proportional to the income; the higher the taxableincome, the higher the tax. To see more detail, we should look at theslope of the curve, which gives the
marginal taxrate. Alternatively, we can divide the tax by the income, which givesthe
average tax rate.
The following function definition lets us compute the slope of anygraph using the usual formula from high school algebra, namely thechange in y divided by the change in x.
slope <- function(y, x) { N <- length(y) c(0, (y[2:N] - y[1:(N-1)])/(x[2:N] - x[1:(N-1)]))}
Here x and y are "vectors" (sequences) of numbers representing nearbypoints on the graph. The graph is constructed by connecting thesedots. To get the slope, we compare two adjacent y values with thecorresponding two x values. The various indexing expressions like 2:Nare a "vectorizing" way of writing that idea: for instance, at the10th point in the sequence, we look at (y[11]-y[10])/(x[11]-x[10]) toget the slope between the 10th and 11th points.
The next graph compares both of these methods, with the average ratein black and the marginal rate in red. Also, since hardly anyonemakes $388,350 or more, we ignore the top bracket and shrink thehorizontal range to stop at $200,000, which lets us see more detail.
N <- 200x <- (0:N)*1e3m <- sapply(x, married)plot(x/1e3, slope(m,x), type="l", xlab="Taxable Income (thousands)", ylab="2012 Tax Rate for Married Filing Jointly", lwd=3, col="red")lines(x/1e3, m/x, col="black")
The result is

This picture is much more interesting. We can clearly see thestair-step pattern in the marginal rates, as well as the much smootherand smaller average rates. Here's the difference: the average rateapplies to your total taxable income, whereas the marginal rateapplies to the "last dollar" you earn.
For example, a person with a total taxable income of $50,000 pays 15%,or 15 cents, on each
extra dollar of income. That means, if they wereto get a $1,000 raise, $150 of it would go to extra taxes. However,they do not pay 15 percent of their $50k in taxes, but somethinglower: 13.3% in fact. That is because the first $17,400 of their $50k is taxed atthe lower 10% rate, so their
average rate is a blend betweenthe 10% and the 15% rates. That is why the black line goes up in aslower and smoother manner than the red line.
Now that we have a good way to visualize the tax rates, let's comparethe rates for married and single people. The 2012 ratesfor
single people are:
- T = 0.1 * I, for 0 < I < 8700,
- T = 0.15 * (I-8700) + 870, for 8700 < I < 35350,
- T = 0.25 * (I-35350) + 4867.5, for 35350 < I < 85650,
- T = 0.28 * (I-85650) + 17442.5, for 85650 < I < 178650
- T = 0.33 * (I-178650) + 43482.5, for 178650 < I < 388350
- T = 0.35 * (I-388350) + 112683.5. for 388350 < I.
The next graph compares the total tax paid by two single people (in black)who each earn taxable income I/2, with that paid by a married couple (in red)who together earn total taxable income I.
N <- 200x <- (0:N)*1e3m <- sapply(x, married)plot(x/1e3, slope(m,x), type="l", xlab="Taxable Income (thousands)", ylab="2012 Tax Rate", lwd=3, col="red")lines(x/1e3, m/x, col="red")m <- 2*sapply(x/2, single)lines(x/1e3, slope(m,x), type="l", lwd=3)lines(x/1e3, m/x)
The result is

Many years ago, there would have been more difference, but in 2001Congress eliminated much of the old "marriage penalty".At least in this comparison, the curves are
identical up toquite high income levels.
Married couples with very high incomesdo still incur a small "marriage penalty" over the pair of single people -but only on the portion of their income between 142,700 and178,650. At most, this penalty amounts to
(0.28 - 0.25)*(178650 - 142700) = 1078.5
or an extra thousand dollars, changing their tax from $38k to $39k: not a hugeamount of extra tax on a percentage basis. There are additional,larger penalties above 200k (i.e. not shown on this graph),but they impact very few people.
However, the tax rates are only one part of the story. Weassumed that the correct comparison was between a married couple withtaxable income I, and two single people with taxable income I/2each. But a "fair" comparison should compare a couple with
totalincome I versus two singles each with total income I/2. So, we nowturn our attention to the deduction side of the equation, sincethere could be a penalty lurking there as well.
There are all sorts of special deductions and credits in the real taxcode. For simplicity, we assume you are not eligible for any of themand simply take the
standard deduction, which is (for 2011,anyhow) $9,500 for single people and $19,000 for married filingjointly. The 2012 number will presumably be a little higher; let ussuppose it will be $10k for singles and $20k for couples. Moreover,let us assume you earn at least this much money, so we do not have toget into negative numbers and earned income credits and so forth.
Sticking with our simplistic assumptions, the taxable income for themarried couple is
I - 20k, while for each of the singlepeople it is
I/2 - 10k, so in fact, it is still the case,even with deductions, that the two singles match the one couple intaxable as well as total income.
This means our graph is mostly correct: there is no marriage penalty, atleast not unless you have an income
much higher than mostAmericans, and even then it is quite a small penalty, relative to yourincome. However, one aspect of the graph does change: your average taxrate ought to be computed by dividing your tax by your total income,not by your taxable income. So, we make one more version:
N <- 200x <- (30:N)*1e3m <- sapply(x-20e3, married)plot(x/1e3, slope(m,x), type="l", xlab="Gross Income (thousands)", ylab="2012 Tax Rate", lwd=3, col="red")lines(x/1e3, m/x, col="red")m <- 2*sapply(x/2-10e3, single)lines(x/1e3, slope(m,x), type="l", lwd=3)lines(x/1e3, m/x)
The result is

We observe that the average or
effective tax rate is much lowerthan before. For instance, a couple with total income $50k pays only$3630, or 7.3% of their income, not the 13.3% we mentioned earlier.
Now, instead of both partners earning half the total, suppose oneearns more than the other. We shall see that now there is actually amarriage
bonus in the tax code. To be concrete, assume onepartner earns twice as much as the other, so we compare I-20k with(I/3-10k) + (2I/3-10k), assuming I>30k.
N <- 200x <- (30:N)*1e3m <- sapply(x-20e3, married)plot(x/1e3, slope(m,x), type="l", xlab="Gross Income (thousands)", ylab="2012 Tax Rate", lwd=3, col="red")lines(x/1e3, m/x, col="red")m <- sapply(x/3-10e3, single)+sapply(2*x/3-10e3, single)lines(x/1e3, slope(m,x), lwd=3)lines(x/1e3, m/x)
The result is:

For incomes below 200k, the red curved line (average tax rate for themarried couple) is at or
below the black curved line (the twosingles), resulting in a
bonus to the married couple. The bonus gets evenlarger if the two incomes are more dramatically different.Although the stairstep (marginal) curves cross multiple times, eachpair of crossings begins with black on top, and only later has red ontop; this gives the married couple a temporary advantage, which isgradually recouped. This is what produces the repeated "scalloped"pattern in the curved (average) lines.
Finally, let's change gears away from the "marriage penalty" and lookinstead at the impact of a more realistic set of deductions. In ourfinal graph, the red line represents the average tax rate for amarried couple taking the standard deduction, just as in the previouschart. The new blue line represents the same couple
itemizingdeductions (when doing so reduces their taxes). When you itemize,you lose the standard deduction, but instead, you get to deduct yourmortgage interest, your property taxes, and your state income tax,among other things. Let's assume these deductions amount to onequarter of your total income.
Here's the code:
N <- 200x <- (30:N)*1e3m <- sapply(x-20e3, married)plot(x/1e3, m/x, type="l", xlab="Gross Income (thousands)", ylab="2012 Tax Rate", col="red")m <- sapply(x - pmax(20e3, x/4), married)lines(x/1e3, m/x, col='blue')
The result is:

This has some interesting features. First, in this example, peoplemaking under $80k don't itemize, since their standard deduction islarger. That means they don't receive any
tax benefits frombeing home owners with a mortgage (although there can be other kindsof benefits from owning a home, such as building equity - at least ineras when home prices rise).
Conversely, for people with high incomes, there is a considerable
tax advantage to owning a large home with a big mortgage (although thetax savings is small compared to the extra interest payments they must make).
If you've followed along so far, now it's your turn. Think up somescenarios you would like to compare, and try your hand at making somenew graphs. See what you can discover!
If you liked this article, you may also like Supply, Demand and Market Microstructure for a more elaborate, "agent based" simulation of economic activity, or check out the Contents page for a complete list of past topics.
Please post questions, comments and other suggestions using the box below, or email me directly at the address given by the clues at the end of the Welcome post. Remember that you can sign up for email alerts about new posts by entering your address in the widget on the sidebar. If you prefer, you can follow
@ingThruMath on Twitter, where I will tweet about each new post to this blog. The Contents page has a complete list of previous articles in historical order. Now that there are starting to be a lot of articles, you may also want to use the 'Topic', 'Search' or 'Archive' widgets in the side-bar to find other articles of related interest.
I hope you enjoyed this discussion. You can click the "M"button below to email this post to a friend, or the "t" button toTweet it, or the "f" button to share it on Facebook, and so on. Seeyou next time!
Hiç yorum yok:
Yorum Gönder