Question: pls take screenshot with R code, thanks Use the stocks dataset with the weekly closing values for the year 2021 initialized as shown below:stocks Use

pls take screenshot with R code, thanks

Use the stocks dataset with the weekly closing values for the year 2021 initialized as shown below:stocks 

pls take screenshot with R code, thanksUse the stocks dataset with the

Use the stocks dataset with the weekly closing values for the year 2021 initialized as shown below: stocks head(stocks) Date MSFT AAPL GOOG FB AMZN TSLA 1 2021-01-01 216 130 1787 269 3162 816 2 2021-01-08 211 128 1740 246 3127 845 3 2021-01-15 223 136 1891 273 3307 845 4 2021-01-22 237 136 1863 265 3238 835 5 2021-01-29 240 137 2062 266 3331 850 6 2021-02-05 242 134 2096 270 3262 812 a) Show the pair wise plots for all the 6 stocks in the dataset in a single plot. b) Show the correlation matrix for the 6 stocks in the dataset rounded to 2 decimals. c) Provide at least 4 interpretations of the results d) Store the correlation matrix from b) in the variable cm. Using loops, for each stock in the dataset, show the top 3 correlated stocks for that respective stock. The code should work for any dataset with any number of stocks. Sample output for the given dataset is shown below: Top 3 for Stock MSFT GOOG AAPL TSLA 0.95 0.90 0.71 Top 3 for Stock AAPL MSFT GOOG TSLA 0.90 0. 79 0.73 Top 3 for Stock GOOG MSFT FB AAPL 0. 95 0.85 0.79 Top 3 for Stock FB GOOG MSFT AMZN 0.85 0.68 0.66 Top 3 for Stock AMZN GOOG FB MSFT 0. 67 0. 66 0.64 Top 3 for Stock TSLA AAPL MSFT GOOG 0. 73 0.71 0.47

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!