An open API service indexing awesome lists of open source software.

https://github.com/jfoclpf/ploteffectivetaxrate

Calculate and plot Effective Tax Rate
https://github.com/jfoclpf/ploteffectivetaxrate

income-tax matlab-functions octave-functions octave-plot

Last synced: about 2 months ago
JSON representation

Calculate and plot Effective Tax Rate

Awesome Lists containing this project

README

        

## What is an effective income tax rate?

The actual rate at which a taxpayer pays taxes on income accounting for all taxes and offsets. The rate is calculated by dividing the total of all taxes paid, less offsets, by the total taxable income. The effective rate is typically lower than the tax bracket, which is currently based on a progressive rate scale.

## How to use it

1. Install [Octave](https://www.gnu.org/software/octave/download)
2. In Octave command line, download the function into a `.m` file
```octave
urlwrite("https://raw.githubusercontent.com/jfoclpf/plotEffectiveTaxRate/master/plotEffectiveTaxRate.m", "plotEffectiveTaxRate.m" )
```
3. Now run, for example
```octave
plotEffectiveTaxRate([0, 7091, 20261, 40552, 80640], [14.5, 28.5, 37, 45, 48])
```

## Function syntax

```octave
plotEffectiveTaxRate(tax_brackets_array, tax_rates_array [, colour_code])
```

* The first item of `tax_brackets_array` must always be zero.
* The `tax_rates_array` values must be inserted already as percentages, i.e., for a 20% tax, use `20` inseatd of `.2`  
* The arrays must have the same size.

#### Colour codes

The colour codes are the same applied for the Octave function `plot`, namely

* ‘k’ blacK
* ‘r’ Red
* ‘g’ Green
* ‘b’ Blue
* ‘y’ Yellow
* ‘m’ Magenta
* ‘c’ Cyan
* ‘w’ White

## Example

The Portuguese progressive income tax for the year 2017 is according to the table:

| Value (€) | Tax (%) |
| ----------------------- | -------- |
| less than 7091 | 14.5 |
| between 7091 and 20261 | 28.5 |
| between 20261 and 40552 | 37 |
| between 40552 and 80640 | 45 |
| more than 80640 | 48 |

Thus, you need to run

```octave
plotEffectiveTaxRate([0, 7091, 20261, 40552, 80640], [14.5, 28.5, 37, 45, 48])
```

which outputs

Another example for the Portuguese progressive income tax for the year 2018

```octave
plotEffectiveTaxRate([0, 7091, 10700, 20261, 25000, 36856, 80640], [14.5, 23, 28.5, 35, 37, 45, 48], "r")
```

which outputs

## Multiple charts

For multiple charts use the Octave commands `hold on` and `hold off`. For example

```octave
plotEffectiveTaxRate([0, 7091, 20261, 40552, 80640], [14.5, 28.5, 37, 45, 48], "b")
hold on
plotEffectiveTaxRate([0, 7091, 10700, 20261, 25000, 36856, 80640], [14.5, 23, 28.5, 35, 37, 45, 48], "r")
hold off
```

which outpurts