ECON 424/CFRM 462 Lab 1
Summer 2015
Due: Tuesday, June 30 at 8pm via Canvas
Part I: Return calculations
Consider the following (actual) monthly adjusted closing price data forStarbucks stock over the period December 2004 through December 2005
End of Month Price Data for Starbucks Stock
December, 2004
$31.18January, 2005
$27.00February, 2005
$25.91March, 2005
$25.83
April, 2005
$24.76
May, 2005$27.40June, 2005
$25.83
July, 2005
$26.27
August, 2005
$24.51
September, 2005
$25.05October, 2005
$28.28
November, 2005
$30.45
December, 2005
$30.51
1. Using the data in the table, what is the simple monthly return between
the end of December, 2004 and the end of January 2005? If you invested$10,000 in Starbucks at the end of December 2004, how much would
the investment be worth at the end of January 2005?
2. Using the data in the table, what is the continuously compoundedmonthly return between December, 2004 and January 2005? Convert1

this continuously compounded return to a simple return (you should
get the same answer as in part a).
3. Assuming that the simple monthly return you computed in part (1)is the same for 12 months, what is the annual return with monthly
compounding?
4. Assuming that the continuously compounded monthly return you computed in part (2) is the same for 12 months, what is the continuously
compounded annual return?
5. Using the data in the table, compute the actual simple annual return
between December 2004 and December 2005. If you invested $10,000
in Starbucks at the end of December 2004, how much would the investment be worth at the end of December 2005? Compare with yourresult in part (3).
6. Using the data in the table, compute the actual annual continuously
compounded return between December 2004 and December 2005. Compare with your result in part (4). Convert this continuously compounded return to a simple return (you should get the same answer
as in part 5).
Part II. Excel exercises
Go to http://finance.yahoo.com and download monthly data on Starbucks (ticker symbol sbux) over the 15 year period March 1993 to March
2008. See the Homework page on the class website for detailed instructions
on how to download data from Yahoo!. Read the data into Excel and makesure to re-order the data so that time runs forward. Do your analysis on
the monthly closing price data (which should be adjusted for dividends andstock splits). Name the spreadsheet tab with the data “data”.
1. Make a time plot (line plot in Excel) of the monthly price data overthe period (end of March 1993 through (end of) March 2008. Please
put informative titles and labels on the graph. Place this graph in a
separate tab (spreadsheet) from the data. Name this tab “graphs”.
Briefly comment on what you see (e.g. price trends, etc.).
(a) If you invested $1,000 at the end of March 1993, what would yourinvestment be worth at the end of March 2008?
2(b) What is the compound annual rate of return over this period assuming annual compounding? (Hint: what is the geometric average annual rate for the 15 year investment?)
2. Make a time plot of the natural logarithm of monthly price data overthe period March 1993 to March 2008 and place it in the “graph” tab.
Comment on what you see and compare with the plot of the raw pricedata.
(a) Why is a plot of the log of prices informative? (Hint: what is theslope between two time periods?)
3. Using the monthly price data over the period March 1993 to March 2008
in the “data” tab, compute simple monthly returns (Starbucks does not
pay a dividend). When computing returns, use the convention that is the end of month closing price. Make a time plot of the monthly
returns, place it in the “graphs” tab and comment. Keep in mind thatthe returns are percent per month and that the annual return on a US
T-bill is about 0.5 right now%.
4. Compute simple annual returns for the years 1993 through 2008 (note:there are easy and hard ways to do this). Make a time plot of theannual returns, put them in the “graphs” tab and comment. Note: Youmay compute annual returns using overlapping data or non-overlapping
data. With overlapping data you get a series of annual returns for every
month (sounds weird, I know). That is, the first month annual returnis from the end of March, 1993 to the end of March, 1994. The second
month annual return is from the end of April, 1993 to the end of April,
1994 etc. With non-overlapping data you get a series of 15 annual
returns for the 15 year period 1993:March-2008:March. That is, theannual return for 1993:March - 1994:March is computed from the endof March 1993 through the end of March 1994. The second annual
return is computed from the end of March 1994 through the end ofMarch 1995 etc.
5. Using the monthly price/return data over the period March 1993 toMarch 2008, compute continuously compounded (cc) monthly returns
and place then in the “data” tab. Make a time plot of the monthly cc
returns, put them in the ”graphs” tab and comment.
3(a) Briefly compare the continuously compounded returns to the simple returns. Which ones are bigger?
6. Compute continuously compounded annual returns for the years 1993
through 2008 (Again, there are easy and hard ways to do this). Makea time plot of the annual returns and comment. Briefly compare thecontinuously compounded returns to the simple returns.
Part III. R Exercises
Go to http://finance.yahoo.com and download monthly data on Starbucks (ticker symbol sbux) over the period March, 1993 to March, 2008.
Load the data into Excel and make sure to reorder the data so that timeruns forward. Delete all columns except those containing the dates and theadjusted closing prices. Save the file as a .csv (comma separated value)
file and call it sbuxPrices.csv. This is important because base R does nothave functions for importing data from an Excel spreadsheet (see the readxl,RODBC, XLConnect, and xlsx packages for functions to read and write
directly to Excel files).
Start R and open the file econ424lab1.r. Execute the commands in thisfile line by line. Copy and paste your output into a Word (or whatever wordprocessor you use) document to show that you have done this assignment.
1. Import the data in the file sbuxPrices.csv using the R function read.csv()
into the data.frame object sbux.df. Follow the commands in econ424lab1.r
to manipulate the data.
2. Plot the closing price data using the plot() function. Notice that thedates do not show up on the x-axis in the line plot. We will learn how
to fix this in future labs.
3. Compute monthly simple and continuously compounded returns. Plotthese returns separately and on the same graph.
4. A relatively new feature to R is the ability to create dynamic JavaScript
based graphs that display in a web browser. In particular the R package
dygraphs (see https://rstudio.github.io/dygraphs/) has functions for creating interactive time series graphs similar to those on
finance.yahoo.com. If you are using Rstudio then you can view thegraph in the Rstudio web viewer. Follow the short example at the4end of the code in econ424lab1.r to see how easy it is to create aninteractive web graph using dygraphs within Rstudio.

5