Session Ready
Exercise

Calculate growth of $1 invested in SBUX

Would it have been a good idea to invest in the SBUX stock over the period in our data set? In case you invested $1 in SBUX on 3/31/1993 (the first day in sbux_df), how much would that dollar be worth on 3/3/2008 (the last day in sbux_df)? What was the evolution of the value of that dollar over time?

R can help you to quickly come up with an answer to these questions. Remember that when you use simple returns, the total return over a period can be obtained by taking the cumulative product of the gross returns. R has a handy cumprod() function that calculates that cumulative product.

Instructions
100 XP
  • Assign to the variable sbux_gret the gross returns (which is the simple return + 1).
  • Assign to sbux_fv a vector that contains the future values of the $1 invested in SBUX for every time period.
  • Have a look at the plot. Would it have been a good idea to invest in SBUX?