Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question ( R scripts/ studio) A) Two different stock returns: 3% for Apple and 1% for Microsoft. want to run the following commends. If mystock

Question ( R scripts/ studio)

A) Two different stock returns: 3% for Apple and 1% for Microsoft. want to run the following commends.

If mystock is Apple, print "My return is 3%."

If mystock is Microsoft, print "My return is 1%."

If mystock is neither Apple nor Microsoft, print "This is not in your portfolio."

I entered the following code in the first line

mystock <- "Microsoft"

and have to complete the following lines.

if ( ) { print (

} else {

[Multiple lines here]

)

}

The if...else statement above should include all three possibilities.

B)n <- 10

how to i can Print odd numbers from 10 to 24 using repeat loop?

C)n <- 6

how can Print even numbers from 6 to 19 using while loop

D)n <- seq (from = 13, to = 28)

  1. Print even numbers from 13 to 28 using for loop

E)how to download daily stock price of Amazon, Inc. from 2019-10-01 to 2019-12-31 from Yahoo! Finance.

install.packages("quantmod")

library(quantmod)

getSymbols("AMZN", src = "yahoo", from='2020-03-01', to='2020-04-30')

Using AMZNAdj, calculate daily log returns and assign the name log_AMZNAdj.

E) how to download daily stock price of Apple, Inc. from 2016-01-01 to 2018-07-31 from Yahoo! Finance.

library(quantmod)

getSymbols("AAPL", src = "yahoo", from='2019-01-01', to='2019-12-31') AAPLAdj <- AAPL$AAPL.Adj

  • Show whether the series AAPLAdj evolves with time. If it does, show how to remove the evolution with time and comment on the result.
  • The following code will convert AAPLAdj to monthly log return. monthly.AAPL <- monthlyReturn(AAPLAdj, subset=NULL, type='log', leading=TRUE)

Find sample autocorrelation and partial autocorrelation estimates for monthly.AAPL up to lag 10.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Advanced Financial Accounting

Authors: Richard Lewis, David Pendrill

7th Edition

0273658492, 978-0273658498

More Books

Students also viewed these Finance questions

Question

3. Im trying to point out what we need to do to make this happen

Answered: 1 week ago

Question

1. I try to create an image of the message

Answered: 1 week ago