using r lag function to analyze time series

Retail Marketing Strategy identify what strategy your retailer uses. You may wish to use either the WoR or Big Middle models. Who are their key competitors? (20 marks)
April 10, 2021
Describe the American Nurses Association’s Magnet status process
April 10, 2021

using r lag function to analyze time series

Import the sp.csv file on Canvas Module. It contains information about the SP500 index for 1426 trading days.

Create a new variable return, defined as the percentage change of a day’s Adjusted Close compared to last trading day’s Adjusted Close. That is, return(t) = 100* (Adj Close(t) – Adj Close(t-1))/Adj Close(t-1).

Calculate the five number summary (Links to an external site.)Links to an external site. of the return using the summary() function.

Hint: The easiest way to get the previous trading day’s Adj Close value is using the lag() function in the tidyverse (or dplyr, which is a part of the tidyverse) package. Import the package first before using the lag() function.

To extract a variable that contains space (such as Adj Close) from a data frame, use sp$`Adj Close`).

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code "Newclient" for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

Buy Custom Nursing Papers