Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Initialize the Dow Jones Industrials daily closing data1 dow using the read csv function with the The first ti rows of the dataset are as

image text in transcribed
image text in transcribed
Initialize the Dow Jones Industrials daily closing data1 dow using the read csv function with the The first ti rows of the dataset are as shown below: :- headcdew] Date close 1 1;?!le 25359 2 wares 25535 3 Ufza zeros 4 was 23534 5 Mafia EH45 E Wild 2595? Provide the simplest Fl code and output for all of the following. The code should work for any given data. a] Store the result of the summary function for the Close attribute as the variable sm. change the names of this variable so that the output appears as shown below. :- sm Hin Q1 Q2 Mean Q3 Ham 18592 23465 24326 25544 23352 29551 Using the above data, show the quartile variations for the 4 quartiles as shown below. You can use paste or sprintl'. [1] "First Quartile variation is 483.5" [2] "Second Quartile variation is BEBE\" [3] "Third Quartile variation is \"35.5" [4] "Fourth Quartile variation is 639.5\" b] Produce the output for the minimum of the Dow closing value in the dataset as shown below: [1] "The minimum Dow value of 13592 is at row 56 on 3/23/26" c) Suppose you have an index fund tied to the Dow closing value. If you have invested on the minimum date. what date from the dataset you would have sold to gain the maximum percentage gain. The output is as shown below. Note that the code should be generic so that it works on any such dataset. [1] "I would sell on 4f25l/2B when Dow is at 24634 for a gain of 32.53!" d) Use the diff function to calculate the differences between consecutive closing values in the dataset. Insert the value 0 at the beginning at these differences. Add this result as the DIFFS column of the data frame. The result is as shown below

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Organic Chemistry

Authors: Marc Loudon, Jim Parise

6th Edition

1936221349, 978-1936221349

Students also viewed these Mathematics questions