Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Simple Statistics Given a set of numerical data, there are several ways in which to describe it. One way is the so- called 5-number



Simple Statistics Given a set of numerical data, there are several ways in which to describe it. One way is the so- called 5-number summary. The five numbers used to describe the data set are the following: the minimum value, the first quartile, the median, the third quartile and the maximum value. The definition of the minimum and maximum values are obvious. The median of a set of numbers is the value of the number which would lie exactly in the middle of the set if it were sorted. For example, the median of the data set 7, -1, 9, 4, 1 would be 4. If there is an even number of values in the set, then the median is the average of the two values closest to the middle; if our set contained the values 7, -1, 9, 4, 1, 0 then the median would be (1 + 4)/2 = 2.5. The definition of the quartiles follows naturally from the definition of the median. If we take all the values that come before the median in the sorted list (in the case when we average two values for the median this set would include the lower of those two numbers) the first quartile is the median of this set. The definition of the third quartile is identical except it uses those values that come after the original median. In our example above with 7, -1, 9, 4, 1, 0, the first quartile value would be 0 (the median of the value -1, 1 and 0 which are less than 2.5) and the third quartile would be 7. If the data set contained 1, 2, 2, 2, 3 (in any order), then the median would be 2, and the first and third quartiles would be 1.5 and 2.5, respectively. One special case is when there is only one element in the list, in which case the quartiles are equal to the median. One other way to characterize data is its skewness. A distribution is considered right-skewed whenever the maximum value is farther from the median than the minimum value, or when the maximum and minimum are equally distant from the median, but the third quartile is farther from the median than the first quartile. A left-skewed distribution is one with the opposite situation. For our purposes, a distribution which is neither left-skewed nor right-skewed is considered symmetric. Your task for this problem is to read in various sets of numbers and output the 5-number summary for each, along with the skewness of the data. Input There will be multiple input sets. Each input set will consist of a single line of the form nv, V2 V3 -.. Vn where n is the number of data values, and v4,. Vn are the values. All the values will be integers and the maximum value for n will be 100. A line which begins with 0 indicates end of input and should not be processed. All input will be from a file in.dat. Output For each input set, output the 5-number summary and skewness in the order minimum, first quartile, median, third quartile, maximum and skew, with a single space between each. Skew will either be the phrase right-skewed, left-skewed or symmetric. All output will be to the screen and written to a file: analyzed_data.dat. Sample Input 67-19410 15 15 14 13 12 11 10 9 87 6 5 4 32 1 15 15 14 13 12 11 10 9 876 5 4 3 20 Sample Output -10 2.5 79 right-skewed 148 12 15 symmetric 048 12 15 left-skewed

Step by Step Solution

3.54 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

The here represents spaces as this app gives trouble while1 l llistmapintinpu... 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

Materials and process in manufacturing

Authors: E. Paul DeGarmo, J T. Black, Ronald A. Kohser

9th edition

471656534, 978-0471033066, 471033065, 978-0471656531

More Books

Students also viewed these Programming questions

Question

What are some of the attractive features of electron-beam welding?

Answered: 1 week ago

Question

19. How does L-dopa relieve the symptoms of Parkinsons disease?

Answered: 1 week ago