Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use R studio and provide the code. fb) Produce the output for the minimum of the Dow closing value in the dataset as shown

Please use R studio and provide the code.

image text in transcribedimage text in transcribedimage text in transcribed
\fb) Produce the output for the minimum of the Dow closing value in the dataset as shown below: [1] "The minimum Dow value of 18592 is at row 56 on 3/23/20" 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 4/29/20 when Dow is at 24634 for a gain of 32.50%" d) Use the diff function to calculate the differences between consecutive closing values in the dataset. Insert the value 0 at the beginning of these differences. Add this result as the DIFFS column of the data frame. The result is as shown below. V headcdowJ Date Close DIFFS 1/ 2/ 20 23869 3 1/3/20 28635 234 1/ 6/ 20 28 703 68 1/7/20 23584 -119 1/8/20 28745 161 1/9/20 2895? 212 mus-bumb- e) How many days did the Dow close higher than its previous day value? How many days did the Dow close lower than its previous day value? [1] "44 days Dow closed higher than previous day" [1] "47 days Dow closed lower than previous day" f) Show the subset of the data where there was a gain of at least 1000 points from its previous day value. Date Close DIFFS 41 3/2/20 25203 1294 43 3/4/20 22091 11?4 4? 3/10/20 25013 116? 50 3/13/20 23185 1985 52 3/12/20 2123? 1043 5? 3/24/20 20205 2113 59 3/25/20 22552 1351 56 4/5/20 22680 162

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

Entrepreneurship

Authors: Andrew Zacharakis, William D Bygrave

5th Edition

1119563097, 9781119563099

Students also viewed these Mathematics questions