0% found this document useful (0 votes)
28 views

217 - Chapter 2 - Organization of Data

Uploaded by

ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

217 - Chapter 2 - Organization of Data

Uploaded by

ahmed
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 53

King Khalid University

College of Sciences and Arts of


Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

Dr. Moheddine Imsatfia


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming


Chapter 2 – Organization of Data

0 - CLASS LIMITS, BOUNDARIES AND INTERVALS, MIDPOINT.


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Class Limits
Class limits are the smallest and largest
observations (data, events etc) in each class.
Therefore, each class has two limits: a lower and
upper.

3 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Class Frequency
200 – 299 12

300 – 399 19

400 – 499 6

500 – 599 2

600 – 699 11

700 – 799 7

800 – 899 3

Total Frequency 60

4 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Question:
Using the frequency table above, what are the
lower and upper class limits for the first three
classes?

5 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Answer:

For the first class, 200 – 299

The lower class limit is 200

The upper class limit is 299

For the second class, 300 – 399

The lower class limit is 300

The upper class limit is 399

For the third class, 400 – 499

The lower class limit is 400

The upper class limit is 499

6 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Midpoint

The midpoint of the class interval :


Let b=the highest number in the class, a = the lowest number in
the class.

The midpoint is (a+ 0.5 * (b-a)).

7 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.


Class Boundaries are the midpoints between the
upper class limit of a class and the lower class
limit of the next class in the sequence.

Therefore, each class has an upper and lower
class boundary.

8 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Exercise: Using the frequency table above,


determine the class boundaries of the first two
classes.

9 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Answer
For the first class, 200 – 299
The lower class boundary is the midpoint between 199 and 200, that
is 199.5
The upper class boundary is the midpoint between 299 and 300, that
is 299.5

For the second class, 300 – 399


The lower class boundary is the midpoint between 299 and 300, that
is 299.5
The upper class boundary is the midpoint between 399 and 400, that
is 399.5

10 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.


Class interval is the difference between the upper
and lower class boundaries of any class.

11 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Using the table above, determine the class


intervals for the first class.

12 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


4 - CLASS LIMITS, BOUNDARIES AND INTERVALS,
MIDPOINT.

Answer:
For the first class, 200 – 299
The class interval =
Upper class boundary – lower class boundary
Upper class boundary = 299.5
Lower class boundary = 199.5
Therefore, the class interval = 299.5 – 199.5 = 100.

13 Topic 1 - Introduction to Statistics 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

1- FREQUENCY DISTRIBUTION
1- FREQUENCY DISTRIBUTION


In statistics, a frequency distribution is a table that
displays the frequency of various outcomes in a
sample.

Each entry in the table contains the frequency or
count of the occurrences of values within a
particular group or interval, and in this way, the
table summarizes the distribution of values in the
sample.

15 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


1- FREQUENCY DISTRIBUTION

Example:

These are the numbers of newspapers sold at a local shop over the last 10 days:
22, 20, 18, 23, 20, 25, 22, 20, 18, 20

Let us count how many of each number there is:

Papers Sold Frequency


18 2
19 0
20 4
21 0
22 2
23 1
24 0
25 1

16 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


1- FREQUENCY DISTRIBUTION

Example:

It is also possible to group the values.
Here they are grouped in 5s:

Papers Sold Frequency

15 - 19 2

20 - 24 7

25 - 29 1

17 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

2- STEM-AND-LEAF DISPLAY
2- STEM-AND-LEAF DISPLAY


A basic stem-and-leaf display contains two
columns separated by a vertical line.

The left column contains the stems and the right
column contains the leaves.

Stem-and-leaf displays are useful for displaying the
relative density and shape of the data, giving the
reader a quick overview of distribution.

19 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


2- STEM-AND-LEAF DISPLAY


Examples

20 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

3- SIMPLE BAR CHART


3- SIMPLE BAR CHART


A simple bar chart is used to represents data
involving only one variable classified on spatial,
quantitative or temporal basis.

In simple bar chart, we make bars of equal width
but variable length, i.e. the magnitude of a
quantity is represented by the height or length
of the bars.

Following steps are undertaken in drawing a
simple bar diagram.
22 Topic 2: Organisation of Data 217CSM-3: Statistical Programming
3- SIMPLE BAR CHART

Exercise: Draw simple bar diagram to


represent the profits of a bank for 5 years.

Years 1989 1990 1991 1992 1993


Profit (M$) 10 12 18 25 42

23 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


3- SIMPLE BAR CHART

Simple bar chart showing the profit of a bank for 5 years.

24 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

4- MULTIPLE BAR CHART


4- MULTIPLE BAR CHART


By multiple bars diagram two or more sets of
inter-related data are represented (multiple bar
diagram facilities comparison between more
than one phenomena).

The technique of simple bar chart is used to draw
this diagram but the difference is that we use
different shades, colors, or dots to distinguish
between different phenomena.

We use to draw multiple bar charts if the total of
different phenomena is meaningless.
26● Topic 2: Organisation of Data 217CSM-3: Statistical Programming
4- MULTIPLE BAR CHART

Exercise: Draw a multiple bar chart to represent the


import and export of Canada (values in $) for the years
1991 to 1995.

Years Imports Exports

1991 7930 4260

1992 8850 5225

1993 9780 6150

1994 11720 7340

1995 12150 8145

27 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


4- MULTIPLE BAR CHART

Simple bar chart showing the import and export of


Canada from 1991 – 1995.

28 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

5- COMPONENT BAR CHART


5- COMPONENT BAR CHART


Sub-divided or component bar chart is used to
represent data in which the total magnitude is
divided into different or components.

In this diagram, first we make simple bars for each
class taking total magnitude in that class and then
divide these simple bars into parts in the ratio of
various components.

This type of diagram shows the variation in different
components within each class as well as between
different classes.
30 Topic 2: Organisation of Data 217CSM-3: Statistical Programming
5- COMPONENT BAR CHART

Exercise: The table below shows the quantity in hundred


kgs of Wheat, Barley and Oats produced on a certain
form during the years 1991 to 1994.

Years Wheat Barley Oats


1991 34 18 27
1992 43 14 24
1993 43 16 27
1994 45 13 34

31 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


5- COMPONENT BAR CHART

Question : Construct a component bar chart to


illustrate the data in the following slide.

Hint : To make the component bar chart, first


of all we have to take year wise total production.

32 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


5- COMPONENT BAR CHART

Years Wheat Barley Oats Total

1991 34 18 27 79

1992 43 14 24 81

1993 43 16 27 86

1994 45 13 34 92

33 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


5- COMPONENT BAR CHART

The required diagram is given below:

34 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

6- PIE CHART
6- PIE CHART

36 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


6- PIE CHART

37 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


6- PIE CHART

Exercise: The following table gives the details of


monthly budget of a family. Represent these figures by a
suitable diagram.
Item of Expenditure Family Budget

Food 600$
Clothing 100$
House Rent 400$
Fuel and Lighting 100$
Miscellaneous 300$
Total 1500$

38 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


6- PIE CHART

The necessary computations are given below:

Items Expenditure Angle of Sectors


Food 600$ 144°

Clothing 100$ 24°

House Rent 400$ 96°

Fuel and Lighting 100$ 24°

Miscellaneous 300$ 72°

Total 1500$ 360°

39 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


6- PIE CHART

40 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

7- HISTOGRAM
7- HISTOGRAM


In statistics, a histogram is a graphical representation of the
distribution of data.

It is an estimate of the probability distribution of a
continuous variable.

A histogram is a representation of tabulated frequencies,
shown as adjacent rectangles or squares.

The rectangles of a histogram are drawn so that they
touch each other to indicate that the original variable is
continuous.

42 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


7- HISTOGRAM

43 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


7- HISTOGRAM

Bin Count
−3.5 to -2.51 9
−2.5 to -1.51 32
−1.5 to -0.51 109
−0.5 to 0.49 180
0.5 to 1.49 132
1.5 to 2.49 34
2.5 to 3.49 4

44 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


King Khalid University
College of Sciences and Arts of
Tanumah
Department of Computer Science

217CSM-3: Statistical Programming

Chapter 2 – Organization of Data

8- FREQUENCY POLYGON
8- FREQUENCY POLYGON


Midpoints of the interval of corresponding
rectangle in a histogram are joined together by
straight lines.

It gives a polygon (a figure with many angles).

46 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON


Examples:

47 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON


Sometimes it is beneficial to show the histogram
and frequency polygon together.

48 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON

Exercise:

The number of hours each student of a class
spends for studying are 5, 8, 7, 6, 8, 8, 5, 5, 6, 5, 6,
and 5 hours.

TODO : Identify the frequency polygon for the
given data.

49 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON

Choices:
A)Figure 1
B)Figure 2
C)Figure 3
D)Figure 4

50 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON

Correct Answer: A

51 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON


Step 1: The heights of the bars in the histograms indicate
the number of hours that the students of a class spend.

Step 2: Observe the heights of the bars in the histograms to
match with the given values.

Step 3: Compute the midpoints of the bars and draw the
lines along these midpoints.

Step 4: Frequency polygon of this data will be as follows.

Step 5: So, Figure 1 represents the frequency polygon for
the given data.

52 Topic 2: Organisation of Data 217CSM-3: Statistical Programming


8- FREQUENCY POLYGON

53 Topic 2: Organisation of Data 217CSM-3: Statistical Programming

You might also like