Question

n this CT assignment, we will use R software to analyze a dataset GoogleAmazonStock.xlsx. It contains...

n this CT assignment, we will use R software to analyze a dataset GoogleAmazonStock.xlsx.

It contains daily closing stock prices for Google and Amazon from 8/22/2017 to 8/22/2018. When we examine stock prices (or other financial assets) we often transform them into a (simple) return series. The return series are computed by the formula: (present price/past price) - 1. The dataset contains both stock prices and return series.

1. Using R, construct time series (line) plots for both stock prices and return series. R functions ts.plot or plot can create the plot.

How do you create a plot in R from an XLS file that overlays Google.Return and Amazon.Return by Date?

I would like to use Time Series, but this xls file is not recognized as a time series file

Example Data Set:

Date Google.Close Amazon.Close Google.Return Amazon.Return
8/22/2017 924.690002 966.900024
8/23/2017 927 958 0.002498132 -0.0092047
8/24/2017 921.280029 952.450012 -0.006170411 -0.0057933
8/25/2017 915.890015 945.26001 -0.005850571 -0.007549

Homework Answers

Answer #1

R CODE:

d<- read.csv("C:/Users/Ayushi/Desktop/ts.csv")
plot.ts(d$Google.Return)
windows()
plot.ts(d$Amazon.Return)

R OUTPUT:

Comment:

Enter the data in excel sheet and convert it to csv format. Then in R code, you enter the path of the excel file. Here I have entered mine.

Hopefully this will help you. In case of any query, do comment. If you are satisfied with the answer, give it a like. Thanks.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's...
Consider the C program (twoupdate) to demonstrate race condition. In this assignment, we will implement Peterson's algorithm to ensure mutual exclusion in the respective critical sections of the two processes, and thereby eliminate the race condition. In order to implement Peterson's Algorithm, the two processes should share a boolean array calledflagwith two components and an integer variable called turn, all initialized suitably. We will create and access these shared variables using UNIX system calls relating to shared memory – shmget,...
After reading the following article, how would you summarize it? What conclusions can be made about...
After reading the following article, how would you summarize it? What conclusions can be made about Amazon? Case 12: Amazon.com Inc.: Retailing Giant to High-Tech Player? (Internet Companies) Overview Founded by Jeff Bezos, online giant Amazon.com, Inc. (Amazon), was incorporated in the state of Washington in July 1994, and sold its first book in July 1995. In May 1997, Amazon (AMZN) completed its initial public offering and its common stock was listed on the NASDAQ Global Select Market. Amazon quickly...
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation....
Using the model proposed by Lafley and Charan, analyze how Apigee was able to drive innovation. case:    W17400 APIGEE: PEOPLE MANAGEMENT PRACTICES AND THE CHALLENGE OF GROWTH Ranjeet Nambudiri, S. Ramnarayan, and Catherine Xavier wrote this case solely to provide material for class discussion. The authors do not intend to illustrate either effective or ineffective handling of a managerial situation. The authors may have disguised certain names and other identifying information to protect confidentiality. This publication may not be...
Please read the article and answear about questions. Determining the Value of the Business After you...
Please read the article and answear about questions. Determining the Value of the Business After you have completed a thorough and exacting investigation, you need to analyze all the infor- mation you have gathered. This is the time to consult with your business, financial, and legal advis- ers to arrive at an estimate of the value of the business. Outside advisers are impartial and are more likely to see the bad things about the business than are you. You should...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how...
Delta airlines case study Global strategy. Describe the current global strategy and provide evidence about how the firms resources incompetencies support the given pressures regarding costs and local responsiveness. Describe entry modes have they usually used, and whether they are appropriate for the given strategy. Any key issues in their global strategy? casestudy: Atlanta, June 17, 2014. Sea of Delta employees and their families swarmed between food trucks, amusement park booths, and entertainment venues that were scattered throughout what would...