Skip to content

Commit

Permalink
Clean up of header.tex and the report
Browse files Browse the repository at this point in the history
closes #130
  • Loading branch information
Nicoletta Farabullini committed Jun 19, 2019
1 parent ee9e438 commit 7fb4923
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 53 deletions.
5 changes: 0 additions & 5 deletions inst/application/header.tex
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
\usepackage{fancyhdr}
\makeatletter
%\@ifpackageloaded{xcolor}{}{\usepackage{xcolor}}
\makeatother

%set up page style
\pagestyle{plain}
Expand All @@ -16,8 +14,6 @@
}
\pagestyle{plain}



% Support for multi-column output
\newcommand{\columnsbegin}{\begin{columns}}
\newcommand{\columnsend}{\end{columns}}
Expand All @@ -35,4 +31,3 @@

% Define colors
\hypersetup{colorlinks,citecolor=[rgb]{0.243,0.565,0.804},filecolor=[rgb]{0.243,0.565,0.804},linkcolor=[rgb]{0.243,0.565,0.804},urlcolor=[rgb]{0.243,0.565,0.804}}

78 changes: 30 additions & 48 deletions inst/application/report.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ params:


```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(SmaRP)
library(ggplot2)
library(googleVis)
Expand All @@ -61,15 +60,15 @@ library(shiny)
library(lubridate)
show_text <- TRUE
opts_chunk$set(echo = TRUE)
options(warn = -1)
if(params$P2purchase + params$P3purchase > 0){
show_tax = TRUE
} else {
show_tax = FALSE
}
options(warn = -1)
DOV <- format(round(params$DOV, 2), nsmall = 0)
Verheiratet<- format(round(params$Verheiratet, 2), nsmall = 0)
Expand All @@ -78,12 +77,12 @@ VersicherungsL <- format(round(params$VersicherungsL, 2), nsmall = 0)
ALV <- format(round(params$ALV, 2), nsmall = 0)
AHL <- format(round(params$AHL, 2), nsmall = 0)
Kinder <- format(round(params$Kinder, 2), nsmall = 0)
```

\def\SmaRPVersion{`r get_SmaRP_version()`}

\newpage

\pagenumbering{gobble}
\vspace*{7cm}
\begin{center}
Expand All @@ -95,13 +94,16 @@ Kinder <- format(round(params$Kinder, 2), nsmall = 0)
\begin{center}
\today
\end{center}

\newpage

\tableofcontents

\newpage

\pagenumbering{arabic}


# Introduction

Smart Retirement Planning (**SmaRP**) is a [Mirai Solutions](https://mirai-solutions.ch/) initiative designed to guide people working in Switzerland towards a strategic decision-making process for their retirement.
Expand All @@ -121,20 +123,17 @@ The main drivers of the retirement fund are:
- **Interest rates** - where a pension is invested and its return rate can have a huge impact on what the user will receive at retirement. Performing different scenarios with minimum return rate (1%) and other more optimistic returns (e.g. 2%, 4%, 6%) is highly recommendable.

- **Residence** - location has an impact on the tax bill and consequently on the tax relief generated by voluntary contributions.

- **Time** - the sooner the employee will start investing, the higher the final return will be.

Note that SmaRP does not make any consideration about the usage of the retirement funds.

The main outcome is displayed in the "Results" section with a more detailed drill down in Appendix 2; formulas used to obtain these results are explained in Appendix 1. In addition, a list of assumptions and limitations is provided in a separate section as well as a brief explanation of the Swiss retirement system.

<br>
\newpage


# Results


```{r deduction_percentage, echo = FALSE}
Road2Retirement_to_print <- params$Road2Retirement %>%
select(Calendar, ExpectedSalaryPath, BVGcontributionrates, BVGContributions, BVGpurchase, DirectP2, ReturnP2, TotalP2, P3ContributionPath, P3purchase, DirectP3, ReturnP3, TotalP3, DirectTax, ReturnTax, TotalTax, Total) %>%
Expand Down Expand Up @@ -175,7 +174,6 @@ ggplot(tserieGraphData.long, aes(x = Calendar, y = value, fill = variable)) +
)
```

<br>

```{r barPlot, echo = FALSE}
barGraphData.columns <- setdiff(names(params$BarGraphData), "contribution")
Expand Down Expand Up @@ -207,12 +205,8 @@ ggplot(data = barGraphData.long, aes(x = contribution, y = value, fill = variabl
)
```

<br>

Corresponding formulas are in Appendix 1 of this document and a more detailed break down of the amounts can be found in Appendix 2. A comprehensive set of values calculated can de downloaded as well from the Table tab.

<br>

### Parameters

```{r, echo = FALSE}
Expand All @@ -224,22 +218,27 @@ The results shown above are based on the following inputs set by the user on the
* Residence is in `r params$gemeinden`, `r params$Kanton` and the postal code is `r params$postalcode`.
* The date of birth is `r format(params$birthday, "%d-%m-%Y")`.
* At the age of `r params$RetirementAge`, the retirement date is `r format(params$retirementdate, "%d-%m-%Y")`.

```{r, echo=FALSE}
SalaryGrowthRate <- params$SalaryGrowthRate * 100
```

* The current salary is **`r printCurrency(params$Salary)` CHF**, with a growth rate of `r SalaryGrowthRate`%, which is assumed constant until retirement.
* The occupational fund (2nd Pillar) is of **`r printCurrency(params$CurrentP2)` CHF**.

```{r msgP2, echo = FALSE}
if(is.null(params$P2purchase) || params$P2purchase == 0){
msgP2 <- "No voluntary contribution to the second Pillar is made."
} else {
msgP2 <- paste0("The voluntary contribution to the second Pillar is of ", params$P2purchase, " CHF and is made as a ", TypePurchase, ".")
}
```

* `r msgP2`
* Second Pillar has an interest rate of `r params$rate*100`%. We ensure that the amount considered in the analysis is always higher than the minimum required by law.
* The private fund (3rd Pillar) is of `r printCurrency(params$CurrentP3)` CHF.
* The annual contribution to the third Pillar is of `r printCurrency(params$P3purchase)` CHF, with an expected return of `r params$returnP3*100`%.

```{r maritallabel, echo = FALSE}
if(params$rate_group == "A"){
maritallabel <- "Single"
Expand All @@ -249,6 +248,7 @@ if(params$rate_group == "A"){
maritallabel <- "Married double-income"
}
```

* Civil status is `r maritallabel` with `r params$NChildren` children.

```{r churchaffiliation, echo = FALSE}
Expand All @@ -262,11 +262,8 @@ if (params$churchtax == "N"){
* `r churchaffiliation` church affiliation.[^2]


<br>

# Assumptions and limitations


SmaRP is valid for employees only, i.e. persons whose main income is a salary. Self-employed people do not belong to this category.

SmaRP takes into account only the occupational (2nd Pillar) and the private (3rd Pillar) funds. The state-run pay-as-you-earn system (1st Pillar) is law and salary dependent only, meaning there is no active decision-making from the employee's side. Therefore, it is not explicitly considered.
Expand All @@ -286,33 +283,19 @@ A proxy of the taxable income is used to calculate tax savings.[^3] The taxable
* Number of children
* Any additional voluntary contributions.


[^1]: SmaRP does not make any consideration about the usage of the retirement funds. For the Occupational fund, the Swiss pension law allows retirees to take the full amount as a lump sum or receive their pension in the form of a life annuity, or a mix of both. In that case, the minimum conversion rate is 6.8% (since 2017) and can vary depending on the retirement age. The Private fund, however, gets always paid as a lump sum.
[^2]: Church taxes differ based on the type (Evangelische or Roeman-katolische Kirche) and canton of residence. SmaRP does not make such distinction and always assumes the highest of the values. Moreover, when the church-tax depends on the cantonal tax rate (instead of being a fixed factor), an approximation is made and treated as the maximum possible factor (relevant for cantons: VS, BS, BL).
[^3]: Taxes on assets are not considered.
[^4]: Although most of those parameters can vary a bit depending on the canton, we use the federal values as proxy.


\newpage


# The basics of the Swiss retirement system


The Swiss social retirement system is based on a three-pillar regime.


\vspace{12pt}


\begin{center}
\includegraphics[width=0.4\textwidth]{www/SwissRetirementSystem.png}
\end{center}


\vspace{12pt}


First Pillar is a state-run pay-as-you-earn system with minimum benefits[^5]. It aims at providing a subsistence level of income to all retirees. The annuity at retirement depends on the amount of income earned and the number of years contributed. Since all parameters are law dependent, it is not explicitly considered in SmaRP.

Second Pillar is a compulsory, tax-deductible company occupational pension insurance fund[^6]. Its goal is to maintain pre-retirement living standards. Voluntary additional buy-ins are regulated, but allow for benefits enhancements at retirement age while reducing the tax burden during the working career. The pensionable salary is defined as part of the AHV with a range between 7/8 and 3 times the AHV salary (between 24.675 and 84.600 as of 01-01-2018). The amount within this range is called the "Mandatory Component" and all employers are required by law to insure at least this compulsory share. However, they are free to offer coverage for the salary above the upper threshold, which the vast majority provides as this extra coverage has become a de facto "must have" to attract employees.
Expand All @@ -321,18 +304,12 @@ Third Pillar is a voluntary contribution; it is a privately-run, tax-deductible

Tax benefits are always a key factor towards a smart retirement project. SmaRP takes them into consideration and implements them as an additional fund.


\vspace{12pt}


\begin{center}
\includegraphics[width=0.6\textwidth]{www/TaxBenefits.png}
\end{center}


\vspace{12pt}


Taxation is municipality-dependent. It can be either provided as an input or inferred from the user's inputs.
If inferred, it is computed in two parts: federal tax (same for all cantons) and cantonal tax (different in each canton).
A third tax is calculated by multiplying the cantonal tax with a municipality-specific percentage rate.
Expand All @@ -345,14 +322,10 @@ Retirement age can be either explicitly provided as an input or inferred from th

While **SmaRP** was developed under the utmost care and diligence, Mirai Solutions does not guarantee for its accuracy and correctness. In addition, **SmaRP** is based on assumptions and projections and as such computed figures should be understood as general references and do not hold any legal value.

[^5]: For more information regarding the first pillar, check the official site [here](https://www.ahv-iv.ch/en)
[^6]: All details of current legislation on the second Pillar can be found in German, French or Italian [here](https://www.axa.ch/en/corporate-customers/offers/knowledge/current%20legislation-pillar-2.html)


\newpage

# Appendix 1: Methodology

# Appendix 1: Methodology

## 2nd Pillar

Expand All @@ -366,8 +339,9 @@ where
- $S_{AHV}$ is the AHV salary[^7].

Contribution rates under the second Pillar are defined by law.[^8]

\begin{center}
\begin{tabular}{c | c | c | c | c }
\begin{tabular}{ c | c | c | c | c }
\hline
& & & & \\
Age & 25-34 & 35-44 & 45-54 & 55-64/65 \\ \hline
Expand Down Expand Up @@ -419,6 +393,7 @@ where
The tax benefits are computed as[^10]:

$$ TBe(t) = Tax_{S}(t) - Tax_{inc}(t) $$

where

- $Tax_{S}(t)$ is the tax bill based on the gross salary at each $t$,
Expand Down Expand Up @@ -464,7 +439,6 @@ where

<!-- The cantonal tax rate for canton `r params$Kanton` can be looked up in the following table. -->


```{r taxRates, echo = FALSE}
fkanton <- params$PLZGemeinden[params$PLZGemeinden$PLZ == params$postalcode, "FactorKanton"]
gemeinde_name <- params$PLZGemeinden[params$PLZGemeinden$PLZ == params$postalcode, "GDENAME"]
Expand All @@ -478,14 +452,9 @@ The municipality-dependent multiplication factor for `r gemeinde_name` is `r fge

The church affiliation dependent multiplication factor for `r gemeinde_name` is `r fkirche`. In case of no church affiliation, this factor is `0`.

[^7]: AHV salary as of 01.01.2018: 2350 month, 28200 year. Find official information [here](https://www.ahv-iv.ch)
[^8]: 831.40. Bundesgesetz über die berufliche Alters-, Hinterlassenen- und Invalidenvorsorge (Art.16).
[^9]: Minimum interest rate on the retirement assets since 01.01.2017.
[^10]: The taxable income is calculated by subtracting the gross salary from social insurance contributions and other deductions.
[^11]: Click [here](https://www.ch.ch/en/3rd-pillar/) for more official information.

\newpage


# Appendix 2: Tabular Results

Tabular results from calculations are shown in the following tables.
Expand Down Expand Up @@ -545,6 +514,7 @@ pander(Road2Retirement_to_print_TaxBenefit)

\newpage


# Appendix 3: Notes on "Married double income"

In case of married couples with double income, the following considerations should be taken into account.
Expand All @@ -559,3 +529,15 @@ Pension funds are individual (not familiar). However, the tax rates are familiar
- Both members of the couple are the same age and will retire together.

Since these results vary on a case-by-case basis, it is appropriate to run SmaRP with respect to both options to achieve a more accurate understanding and assessment. However, assumptions in Option 2 belong to a very specific scenario and thus it is advisable for users with double income to accept results from Option 1.

[^1]: SmaRP does not make any consideration about the usage of the retirement funds. For the Occupational fund, the Swiss pension law allows retirees to take the full amount as a lump sum or receive their pension in the form of a life annuity, or a mix of both. In that case, the minimum conversion rate is 6.8% (since 2017) and can vary depending on the retirement age. The Private fund, however, gets always paid as a lump sum.
[^2]: Church taxes differ based on the type (Evangelische or Roeman-katolische Kirche) and canton of residence. SmaRP does not make such distinction and always assumes the highest of the values. Moreover, when the church-tax depends on the cantonal tax rate (instead of being a fixed factor), an approximation is made and treated as the maximum possible factor (relevant for cantons: VS, BS, BL).
[^3]: Taxes on assets are not considered.
[^4]: Although most of those parameters can vary a bit depending on the canton, we use the federal values as proxy.
[^5]: For more information regarding the first pillar, check the official site [here](https://www.ahv-iv.ch/en)
[^6]: All details of current legislation on the second Pillar can be found in German, French or Italian [here](https://www.axa.ch/en/corporate-customers/offers/knowledge/current%20legislation-pillar-2.html)
[^7]: AHV salary as of 01.01.2018: 2350 month, 28200 year. Find official information [here](https://www.ahv-iv.ch)
[^8]: 831.40. Bundesgesetz über die berufliche Alters-, Hinterlassenen- und Invalidenvorsorge (Art.16).
[^9]: Minimum interest rate on the retirement assets since 01.01.2017.
[^10]: The taxable income is calculated by subtracting the gross salary from social insurance contributions and other deductions.
[^11]: Click [here](https://www.ch.ch/en/3rd-pillar/) for more official information.

0 comments on commit 7fb4923

Please sign in to comment.