{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "![Callysto.ca Banner](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-top.jpg?raw=true)\n", "\n", "\"Open" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# CALM - Moving Out 2\n", "## Part 2 - Income\n", "\n", "๐Ÿ“—Now let's take a look at your potential income. First, some definitions:\n", "\n", "### Paycheque Definitions\n", "#### Gross Income (pay/earnings)\n", "The amount of income/earnings, for any pay period, before deductions\n", " \n", "#### Net income (pay/earnings)\n", "The amount of income/earnings, for any pay period, after deductions (Take home pay)\n", "\n", "#### CPP - Canada Pension Plan\n", "2.3% of gross income deducted for insurance in case of unemployment\n", " \n", "#### Income Tax\n", "A deduction paid to the Federal and Provincial government for taxes\n", " \n", "#### LTD\n", "A deduction for Long Term Disability insurance\n", " \n", "#### Union Dues\n", "Fees paid for membership in a union\n", " \n", "#### Bonds\n", "An investment in which a business or government pays a set interest rate\n", " \n", "#### Advance Earnings\n", "Deducted money that was received in advance of the pay cheque\n", " \n", "#### Overtime Earnings\n", "Pay received for working over 8 hours a day or 44 hours a week, whichever is greater" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Calculating Net Income\n", "\n", "๐Ÿ“—Click on the code cell below, then click the `Run` button on the toolbar to calculate your net income. You may also change some values in the code to see how the results change." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#โœ๏ธ\n", "wagePerHour = 15 # this is your wage in $/hour\n", "hoursPerDay = 8\n", "workdaysPerMonth = 21\n", "\n", "grossIncome = wagePerHour * hoursPerDay * workdaysPerMonth\n", "print('Your gross income is $', grossIncome, 'per month.')\n", "\n", "incomeTax = .15 + .10 # assume federal income tax is 15% and provincial is 10%\n", "cpp = .0495 # assume Canada Pension Plan is 4.95%\n", "ei = .0188 # assume Employment Insurance is 1.88%\n", "unionDues = .0075 # 0.75% sounds reasonable for union dues\n", "\n", "deductions = grossIncome * (incomeTax + cpp + ei + unionDues)\n", "print('$', '{:.2f}'.format(deductions), ' will be taken off your paycheck.')\n", "\n", "netIncome = grossIncome - deductions\n", "print('Your net income is $', '{:.2f}'.format(netIncome), 'per month.')\n", "%store netIncome # store that value in memory for later notebooks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Graphing Income\n", "๐Ÿ“—\n", "We can also look at how your net income (take-home pay) changes based on your hourly wage. We will use [2019 taxation rates](https://www.canada.ca/en/revenue-agency/services/tax/individuals/frequently-asked-questions-individuals/canadian-income-tax-rates-individuals-current-previous-years.html) as well as [EI](https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/payroll/payroll-deductions-contributions/employment-insurance-ei/ei-premium-rates-maximums.html) and [CPP](https://www.canada.ca/en/revenue-agency/services/tax/businesses/topics/payroll/payroll-deductions-contributions/canada-pension-plan-cpp/cpp-contribution-rates-maximums-exemptions.html) rates. `Run` the cell below (without editing it) to generate a graph.\n", "" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#๐Ÿ“—\n", "def calculateFederalTax(income):\n", " taxBrackets = [47630, 95259, 147667, 210371]\n", " taxRates = [.15, .205, .26, .29, .33]\n", " taxes = []\n", " for i in range(0, len(taxBrackets)):\n", " taxes.append(taxBrackets[i] * taxRates[i])\n", " if income < taxBrackets[0]:\n", " tax = income * taxRates[0]\n", " elif income < taxBrackets[1]:\n", " tax = taxes[0] + (income - taxBrackets[0]) * taxRates[1]\n", " elif income < taxBrackets[2]:\n", " tax = taxes[1] + (income - taxBrackets[1]) * taxRates[2]\n", " elif income < taxBrackets[3]:\n", " tax = taxes[2] + (income - taxBrackets[2]) * taxRates[3]\n", " else:\n", " tax = taxes[3] + (income - taxBrackets[3]) * taxRates[4]\n", " return tax\n", "\n", "def calculateProvincialTax(income):\n", " taxBrackets = [131220, 157464, 209952, 314928] # for Alberta\n", " taxRates = [.1, .12, .13, .14, .15]\n", " taxes = []\n", " for i in range(0, len(taxBrackets)):\n", " taxes.append(taxBrackets[i] * taxRates[i])\n", " if income < taxBrackets[0]:\n", " tax = income * taxRates[0]\n", " elif income < taxBrackets[1]:\n", " tax = taxes[0] + (income - taxBrackets[0]) * taxRates[1]\n", " elif income < taxBrackets[2]:\n", " tax = taxes[1] + (income - taxBrackets[1]) * taxRates[2]\n", " elif income < taxBrackets[3]:\n", " tax = taxes[2] + (income - taxBrackets[2]) * taxRates[3]\n", " else:\n", " tax = taxes[3] + (income - taxBrackets[3]) * taxRates[4]\n", " return tax\n", "\n", "def calculateEI(income):\n", " eiMaxInsurableEarnings = 53100\n", " eiRate = 0.0162\n", " if income >= eiMaxInsurableEarnings:\n", " eiPremium = eiMaxInsurableEarnings * eiRate\n", " else:\n", " eiPremium = income * eiRate\n", " return eiPremium\n", "\n", "def calculateCPP(income):\n", " cppMaxContributoryEarnings = 53900\n", " cppRate = 0.051\n", " if income >= cppMaxContributoryEarnings:\n", " cppPremium = cppMaxContributoryEarnings * cppRate\n", " else:\n", " cppPremium = income * cppRate\n", " return cppPremium\n", "\n", "wages = []\n", "grossIncomes = []\n", "netIncomes = []\n", "for wage in range(15, 150):\n", " wages.append(wage)\n", " grossAnnualIncome = wage * 8 * 240\n", " grossIncomes.append(grossAnnualIncome)\n", " incomeTax = calculateFederalTax(grossAnnualIncome) + calculateProvincialTax(grossAnnualIncome)\n", " eiPremium = calculateEI(grossAnnualIncome)\n", " cppPremium = calculateCPP(grossAnnualIncome)\n", " netIncome = grossAnnualIncome - (incomeTax + eiPremium + cppPremium)\n", " netIncomes.append(netIncome)\n", "\n", "import plotly.graph_objects as go\n", "fig = go.Figure()\n", "fig.add_trace(go.Scatter(x=wages, y=grossIncomes, name='Gross Income'))\n", "fig.add_trace(go.Scatter(x=wages, y=netIncomes, name='Net Income'))\n", "fig.update_layout(\n", " title=go.layout.Title(text='Net Income vs Hourly Wage'),\n", " xaxis=go.layout.XAxis(title=go.layout.xaxis.Title(text='Hourly Wage')),\n", " yaxis=go.layout.YAxis(title=go.layout.yaxis.Title(text='Income')))\n", "fig.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "๐Ÿ“—The graph shows that the difference between gross income and net income (after deductions) increases as wage increases. For more information about this, you may want to read about [progressive taxation](https://en.wikipedia.org/wiki/Progressive_tax).\n", "\n", "You have now completed this section. Proceed to [section 3](./CALM-moving-out-3.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "[![Callysto.ca License](https://github.com/callysto/curriculum-notebooks/blob/master/callysto-notebook-banner-bottom.jpg?raw=true)](https://github.com/callysto/curriculum-notebooks/blob/master/LICENSE.md)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.4" } }, "nbformat": 4, "nbformat_minor": 2 }