Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find any stock you want to research. You can find ticker symbol from Google, Yahoo! Finance, MSN money, and so on (i.e. The ticker symbol

Find any stock you want to research.

You can find ticker symbol from Google, Yahoo! Finance, MSN money, and so on (i.e. The ticker symbol of Apple Inc. is "AAPL"). - Run the following steps.

1) Install package 'quantmod' and load it. install.packages("quantmod") library(quantmod)

2) From Yahoo! Finance, download daily prices of the stock (from Jan. 1, 2000 to Dec, 2018) you selected to research. Note that you have full length of daily prices. If not, consider other stock.

3) Obtain monthly log stock returns. For instance, if you decide to do research on Apple Inc. whose ticker is "AAPL", then you will need to run the following: AAPL.rtn <- monthlyReturn(AAPL$AAPL.Adjusted, subset=NULL, type='log', leading=TRUE)

4) Change the data type to ts. Again, for example, if you decide to do research on Apple Inc., rtn <- ts(AAPL.rtn, frequency = 12, start = c(2000,1))

I have downloaded AAPL stock prices from 01/01/2000 to 12/31/2018 and created my AAPL vector in r studio. I am trying to get monthly log stock returns using the code AAPL.rtn <- monthlyReturn(AAPL$AAPL.Adjusted, subset=NULL, type='log', leading=TRUE) and I receive and error message saying Error in try.xts(x) :

Error in UseMethod("as.xts") :no applicable method for 'as.xts' applied to an object of class "NULL".

What am I doing incorrectly?


Step by Step Solution

There are 3 Steps involved in it

Step: 1

The error message youre encountering suggests that the object youre trying to pass to the monthlyRet... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Finance questions

Question

Question 2 For an n x n matrix A = form) via (aij)

Answered: 1 week ago

Question

What is the saver's credit and who is eligible to receive it?

Answered: 1 week ago