RetirementCalculator.Rmd

Jonathan Friedman
February 21, 2017

Instructions

To determine how much to save each month for retirement, set the settings on the left of the app

  • Number of years till retirement
  • Number of years in retirement
  • Current income
  • Income replacement rate
  • Current savings

Baseline Assumptions

The values in the app default to the ones below. Years in retirement, current income, and income replacement rate correlate positively with required monthly savings. Years working and current savings correlate negatively with required monthly savings.

years.w <- 30
years.r <- 25
current.income <- 75000
income.replacement <- .7
current.savings <- 0

Baseline Required Savings

library(FinCal)
income.in.retirement <- (current.income * (1.025 ^ years.w) * income.replacement)
retirement.requirement <- pv(r = .04, n = years.r, pmt = income.in.retirement, type = 1)
monthly.savings <- pmt(r = .07/12, n = (years.w*12), pv = current.savings, fv = retirement.requirement, type = 1)
savings <- list(monthly.savings, -retirement.requirement)

You must save $1458 each month in order to accumulate $1789153 by the start of retirement.

Plot of Cumulative Savings

After calculating the cumulative savings each month until retirement, factoring in a real rate of return of 7%, the app plots savings over time until it reaches the level required for retirement.

plot of chunk unnamed-chunk-3