0% found this document useful (0 votes)
74 views4 pages

ECON 490 Homework 1 Spring 2016: Due: Feb 3 (Wed) 8am

This document provides instructions for homework 1 for an economics class. It is due on February 3rd and must be submitted electronically through the course website. It has three parts: review questions about stock return calculations using Starbucks data from 2011-2012, exercises in R to import and analyze the Starbucks stock price data, and instructions for downloading stock price data from Yahoo Finance for other assignments.

Uploaded by

Christian Choque
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views4 pages

ECON 490 Homework 1 Spring 2016: Due: Feb 3 (Wed) 8am

This document provides instructions for homework 1 for an economics class. It is due on February 3rd and must be submitted electronically through the course website. It has three parts: review questions about stock return calculations using Starbucks data from 2011-2012, exercises in R to import and analyze the Starbucks stock price data, and instructions for downloading stock price data from Yahoo Finance for other assignments.

Uploaded by

Christian Choque
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

ECON 490 Homework 1

Spring 2016

Due: Feb 3 (Wed) 8am

Submission

Please submit through the Course Webpage (electronic …ling only). No


late homework will be accepted.

Reading and Program Downloads

Please read the course material (slides and lecture note) provided in
the course webpage.

For Part II, go to http://www.r-project.org/ and download R software,


if you do not have it yet on your PC. It will be also available from
most of computers in the campus. Once you have data (see Part III
below) and R program, you will be able to follow the commands in
econ490lab1.r attached in HW 1 of course webpage. If you copy each
command (between #’s - # indicates "instructions" not command or
function) into R console, you can easily …nish the exercise. This exercise
will let you review the concepts and get familiar to R software.

1
1 Part I: Review Questions
Consider the following (actual) monthly adjusted closing price data for Star-
bucks stock over the period December 2011 through December 2012:

End of Month Price Data for Starbucks Stock


December, 2011 $44.89
January, 2012 $46.76
February, 2012 $47.55
March, 2012 $54.73
April, 2012 $56.17
May, 2012 $53.91
June, 2012 $52.37
July, 2012 $44.47
August, 2012 $48.91
September, 2012 $50
October, 2012 $45.26
November, 2012 $51.36
December, 2012 $53.1

1. Using the data in the table, what is the simple monthly return between
the end of December, 2011 and the end of January 2012? If you invested
$10,000 in Starbucks at the end of December 2011, how much would
the investment be worth at the end of January 2012?

2. Using the data in the table, what is the continuously compounded


monthly return between December, 2011 and January 2012? Convert
this continuously compounded return to a simple return (you should
get the same answer as in part 1).

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 com-
pounding?

4. Assuming that the continuously compounded monthly return you com-


puted 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 2011 and December 2012. If you invested $10,000

2
in Starbucks at the end of December 2011, how much would the in-
vestment be worth at the end of December 2012? Compare with your
result in part (3).

6. Using the data in the table, compute the actual annual continuously
compounded return between December 2011 and December 2012. Com-
pare with your result in part (4). Convert this continuously com-
pounded return to a simple return (you should get the same answer
as in part 5).

2 Part II. R Exercises


Go to http://finance.yahoo.com and download monthly data on Star-
bucks (ticker symbol sbux) over the period March, 1998 to March, 2013. See
Part III for how to get data.
Read the data into Excel and make sure to reorder the data so that time
runs forward. Delete all columns except those containing the dates and the
adjusted closing prices. Save the …le as a .csv (comma separated value) …le
and call it sbuxPrices.csv. This is important because base R does not have
functions for importing data from an Excel spreadsheet (see the RODBC and
xlsReadWrite packages for functions to read and write directly to Excel …les).
Start R and open the …le econ490lab1.r. Execute the commands in this
…le line by line. Copy and paste your output into a Word (or whatever word
processor you use) document to show that you have done this assignment.

1. Import the data in the …le sbuxPrices.csv using the R function read.csv()
into the data.frame object sbux.df. Follow the commands in econ490lab1.r
to manipulate the data.

2. Plot the closing price data using the plot() function.

3. Compute monthly simple and continuously compounded returns. Plot


these returns separately …rst. Then also plot on the same graph.

3
3 Part III. How to get data from Yahoo
To get data from Yahoo! do the following for each series to be downloaded:
1. Go to http://…nance.yahoo.com/
2. In the Get Quotes box type the symbol of the stock for which you want
data. For example, the symbol for Microsoft is MSFT. If you do not
know the ticker symbol use the symbol lookup link at the right of the
box.
3. The recent quote for your stock as well as a wealth of other information
will be presented on a new page. To get historical prices, click the
historical prices link on the upper left panel of the page.
4. A new page will open and you will be able to specify the date ranges
for the data to be downloaded and the frequency of the data (daily,
weekly or monthly).
5. After setting the date and frequency information, click the get prices
button. This brings up a table with your speci…ed data.
6. At the bottom of the displayed table click on Download to Spreadsheet.
This will bring up a Save As dialogue box. Specify a name for the
…le and save to disk. Each …le will contain 6 columns (as in the table
below). For monthly data, the column labeled Open gives the opening
price at the beginning of the month, the column labeled High gives the
highest price during the month, the column labeled Low gives the lowest
price during the month, the column labeled Close gives the closing
price during the month and the column labeled Volume gives the total
monthly volume. The open and the close data have been adjusted
for dividends and stock splits. Use the (adjusted) close data for your
analysis.
7. After downloading your data …le, you need to reverse the time ordering
of the data. To reverse the time ordering of the data do the following.
Open the .csv …le containing your data in Excel. Highlight all of the
data (including the column headers). Then select Data/Sort which
brings up the Sort dialogue box. In the Sort by box choose Date, click
the Ascending option and the OK box. Your data will be sorted from
the earliest date to the latest date.

You might also like