A NA LISIS DATA LINGKUNGA N - T L5 0 0 2
INTRODUCTION TO
STATISTICS
ENVIRONMENTAL ENGINEERING Ahmad Soleh Setiyawan
INSTITUT TEKNOLOGI BANDUNG
1
OVERVIEW
• Data consists of information coming from observations, counts,
measurements, or responses.
• Statistics is the science of collecting, organizing, analyzing, and
interpreting data in order to make decisions.
• A population is the collection of all outcomes, responses,
measurement, or counts that are of interest.
• A sample is a subset of a population.
2
PARAMETERS & STATISTICS
A parameter is a numerical description of a population
characteristic.
A statistic is a numerical description of a sample
characteristic.
Parameter Population
Statistic Sample
3
BRANCHES OF STATISTICS
The study of statistics has two major branches: descriptive
statistics and inferential statistics.
Statistics
Descriptive Inferential
statistics statistics
Involves the Involves using a
organization, sample to draw
summarization, conclusions about a
and display of data. population.
4
Data Classification
5
TYPES OF DATA
Data sets can consist of two types of data: qualitative data
and quantitative data.
Data
Qualitative Quantitative
Data Data
Consists of Consists of
attributes, labels, numerical
or nonnumerical measurements or
entries. counts.
6
LEVELS OF MEASUREMENT
The level of measurement determines which statistical
calculations are meaningful. The four levels of
measurement are: nominal, ordinal, interval, and ratio.
Nominal
Levels Lowest
Ordinal to
of
Measurement Interval highest
Ratio
7
NOMINAL LEVEL OF
MEASUREMENT
Data at the nominal level of measurement are qualitative
only.
Nominal
Levels Calculated using names, labels,
of or qualities. No mathematical
Measurement computations can be made at
this level.
Colors in Names of Textbooks you
the US students in your are using this
flag class semester
8
ORDINAL LEVEL OF
MEASUREMENT
Data at the ordinal level of measurement are qualitative
or quantitative.
Levels
of Ordinal
Measurement Arranged in order, but
differences between data
entries are not meaningful.
Class standings: Numbers on the Top 50 songs
freshman, back of each played on the
sophomore, player’s shirt radio
junior, senior
9
INTERVAL LEVEL OF
MEASUREMENT
Data at the interval level of measurement are quantitative.
A zero entry simply represents a position on a scale; the
entry is not an inherent zero.
Levels
of
Measurement Interval
Arranged in order, the differences
between data entries can be calculated.
Temperatures Years on a Atlanta Braves
timeline World Series
victories
10
RATIO LEVEL OF MEASUREMENT
Data at the ratio level of measurement are similar to the
interval level, but a zero entry is meaningful.
Levels A ratio of two data values can be
of formed so one data value can be
Measurement expressed as a ratio.
Ratio
Ages Grade point Weights
averages
11
SUMMARY OF LEVELS OF MEASUREMENT
Determine if
Put data Arrange
Level of Subtract one data value
in data in
measurement data values is a multiple of
categories order
another
Nominal Yes No No No
Ordinal Yes Yes No No
Interval Yes Yes Yes No
Ratio Yes Yes Yes Yes
12
Design of Experimental
13
DESIGNING AN EXPERIMENT
1. Identify the variable(s) of interest (the focus) and
the population of the study.
2. Develop a detailed plan for collecting data. If you
use a sample, make sure the sample is
representative of the population.
3. Collect the data.
4. Describe the data.
5. Interpret the data and make decisions about the
population using inferential statistics.
6. Identify any possible errors.
14
METHODS OF DATA COLLECTION
In an observational study, a researcher observes and
measures characteristics of interest of part of a population.
In an experiment, a treatment is applied to part of a
population, and responses are observed.
A simulation is the use of a mathematical or physical model
to reproduce the conditions of a situation or process.
A survey is an investigation of one or more characteristics
of a population.
A census is a measurement of an entire population.
A sampling is a measurement of part of a population.
15
STRATIFIED SAMPLES
A stratified sample has members from each segment of a
population. This ensures that each segment from the
population is represented.
Freshmen Sophomores Juniors Seniors
16
CLUSTER SAMPLES
A cluster sample has all members from randomly selected
segments of a population. This is used when the population
falls into naturally occurring subgroups.
All members
in each
selected group
are used.
The city of Clarksville divided into city blocks.
17
SYSTEMATIC SAMPLES
A systematic sample is a sample in which each member of
the population is assigned a number. A starting number is
randomly selected and sample members are selected at
regular intervals.
Every fourth member is chosen.
18
CONVENIENCE SAMPLES
A convenience sample consists only of available members
of the population.
Example:
You are doing a study to determine the number of years of
education each teacher at your college has. Identify the sampling
technique used if you select the samples listed.
1.) You randomly select two different departments and survey each
teacher in those departments.
2.) You select only the teachers you currently have this semester.
3.) You divide the teachers up according to their department and
then choose and survey some teachers in each department. Continued.
19
A NA LIS IS DATA LINGKU NGA N TL5002
Descriptive Statistics:
Frequency distribution and Graphs
ENVIRONMENTAL ENGINEERING Ahmad Soleh Setiyawan
INSTITUT TEKNOLOGI BANDUNG
20
FREQUENCY DISTRIBUTIONS
A frequency distribution is a table that shows classes or
intervals of data with a count of the number in each class.
The frequency f of a class is the number of data points in
the class.
Class Frequency, f
1–4 4
Upper
Lower 5–8 5
Class 9 – 12 3 Frequencies
Limits
13 – 16 4
17 – 20 2
21
FREQUENCY DISTRIBUTIONS
The class width is the distance between lower (or upper)
limits of consecutive classes.
Class Frequency, f
1–4 4
5–1=4 5–8 5
9–5=4 9 – 12 3
13 – 9 = 4 13 – 16 4
17 – 13 = 4 17 – 20 2
The class width is 4.
The range is the difference between the maximum and
minimum data entries.
22
CONSTRUCTING A FREQUENCY
DISTRIBUTION
Guidelines
1. Decide on the number of classes to include. The number of
classes should be between 5 and 20; otherwise, it may be
difficult to detect any patterns.
2. Find the class width as follows. Determine the range of the
data, divide the range by the number of classes, and round up
to the next convenient number.
3. Find the class limits. You can use the minimum entry as the
lower limit of the first class. To find the remaining lower limits,
add the class width to the lower limit of the preceding class.
Then find the upper class limits.
4. Make a tally mark for each data entry in the row of the
appropriate class.
5. Count the tally marks to find the total frequency f for each
class.
23
MIDPOINT
The midpoint of a class is the sum of the lower and upper
limits of the class divided by two. The midpoint is
sometimes called the class mark.
Midpoint = (Lower class limit) + (Upper class limit)
2
Class Frequency, f Midpoint
1–4 4 2.5
Midpoint = 1 + 4 = 5 = 2.5
2 2
24
RELATIVE FREQUENCY
The relative frequency of a class is the portion or
percentage of the data that falls in that class. To find the
relative frequency of a class, divide the frequency f by the
sample size n.
Class frequency
=
f
Relative frequency =
Sample size n
Relative
Class Frequency, f
Frequency
1–4 4 0.222
å f = 18
Relative frequency = f = 4 » 0.222
n 18
25
CUMULATIVE FREQUENCY
The cumulative frequency of a class is the sum of the
frequency for that class and all the previous classes.
Ages of Students
Cumulative
Class Frequency, f Frequency
18 – 25 13 13
26 – 33 +8 21
34 – 41 +4 25
42 – 49 +3 28
Total number
50 – 57 +2 30 of students
å f = 30
26
FREQUENCY HISTOGRAM
A frequency histogram is a bar graph that represents the
frequency distribution of a data set.
1. The horizontal scale is quantitative and measures
the data values.
2. The vertical scale measures the frequencies of the
classes.
3. Consecutive bars must touch.
Class boundaries are the numbers that separate the
classes without forming gaps between them.
The horizontal scale of a histogram can be marked with
either the class boundaries or the midpoints.
27
FREQUENCY POLYGON
A frequency polygon is a line graph that emphasizes the continuous change in frequencies.
14
Ages of Students
12
10
8 Line is extended
to the x-axis.
f 6
4
2
0
13.5 21.5 29.5 37.5 45.5 53.5 61.5
Broken axis
Age (in years) Midpoints
28
RELATIVE FREQUENCY HISTOGRAM
A relative frequency histogram has the same shape and the
same horizontal scale as the corresponding frequency
histogram.
0.5
0.433
(portion of students)
Relative frequency
0.4 Ages of Students
0.3
0.267
0.2
0.133
0.1
0.1 0.067
0
17.5 25.5 33.5 41.5 49.5 57.5
Age (in years)
29
CUMULATIVE FREQUENCY GRAPH
A cumulative frequency graph or ogive, is a line graph that
displays the cumulative frequency of each class at its upper class
boundary.
30 Ages of Students
Cumulative frequency
(portion of students)
24
18
The graph ends
at the upper
12 boundary of the
last class.
6
0
17.5 25.5 33.5 41.5 49.5 57.5
Age (in years)
30
WHAT IS A GRAPH?
is a visual representation of a relationship
between, but not restricted to, two variables:
x-axis (horizontal) à INDEPENDENT
VARIABLES
TYPES OF GRAPHS:
y-axis (vertical) à DEPENDENT VARIABLES
• Histograms
• Frequency Polygon
• Ogive A GOOD GRAPH
clearly shows any accurately shows
• Pareto Charts trends or differences the facts
• Stem-and-leaf plot in the data
• Bar Graphs/Charts attracts the
is simple and
• Pie charts attention
uncluttered
• Dot plots
• Scatterplots has a title demonstrates
• Line graphs and labels arguments presented
• Pictographs in the text
31
31
A NA LIS IS DATA LINGKU NGA N TL5002
Descriptive Statistics:
Central Tendency, Variations, Shape
ENVIRONMENTAL ENGINEERING Ahmad Soleh Setiyawan
INSTITUT TEKNOLOGI BANDUNG
32
MEAN
A measure of central tendency is a value that represents a typical,
or central, entry of a data set. The three most commonly used
measures of central tendency are the mean, the median, and the
mode.
The mean of a data set is the sum of the data entries
divided by the number of entries.
Population mean: µ = å x Sample mean: x = å x
N n
“mu” “x-bar”
33
MEAN
Example:
The following are the ages of all seven employees of a small
company:
53 32 61 57 39 44 57
Calculate the population mean.
åx 343 Add the ages and
µ= =
N 7 divide by 7.
= 49 years
The mean age of the employees is 49 years.
34
MEDIAN
The median of a data set is the value that lies in the middle
of the data when the data set is ordered. If the data set has
an odd number of entries, the median is the middle data
entry. If the data set has an even number of entries, the
median is the mean of the two middle data entries.
Example:
Calculate the median age of the seven employees.
53 32 61 57 39 44 57
To find the median, sort the data.
32 39 44 53 57 57 61
The median age of the employees is 53 years.
35
MODE
The mode of a data set is the data entry that occurs with
the greatest frequency. If no entry is repeated, the data
set has no mode. If two entries occur with the same
greatest frequency, each entry is a mode and the data set
is called bimodal.
Example:
Find the mode of the ages of the seven employees.
53 32 61 57 39 44 57
The mode is 57 because it occurs the most times.
An outlier is a data entry that is far removed from the
other entries in the data set.
36
WEIGHTED MEAN
A weighted mean is the mean of a data set whose entries have
varying weights. A weighted mean is given by
x = å(x ×w )
åw
where w is the weight of each entry x.
Example:
Grades in a statistics class are weighted as follows:
Tests are worth 50% of the grade, homework is worth 30% of the
grade and the final is worth 20% of the grade. A student receives a
total of 80 points on tests, 100 points on homework, and 85 points
on his final. What is his current grade?
Continued.
37
WEIGHTED MEAN
Begin by organizing the data in a table.
Source Score, x Weight, w xw
Tests 80 0.50 40
Homework 100 0.30 30
Final 85 0.20 17
x = å(x ×w ) = 87 = 0.87
åw 100
The student’s current grade is 87%.
38
MEAN OF A FREQUENCY DISTRIBUTION
The mean of a frequency distribution for a sample is
approximated by
x = å(x × f ) Note that n = å f
n
where x and f are the midpoints and frequencies of the classes.
Example:
The following frequency distribution represents the ages
of 30 students in a statistics class. Find the mean of the
frequency distribution.
Continued.
39
MEAN OF A FREQUENCY DISTRIBUTION
Class midpoint
Class x f (x · f )
18 – 25 21.5 13 279.5
26 – 33 29.5 8 236.0
34 – 41 37.5 4 150.0
42 – 49 45.5 3 136.5
50 – 57 53.5 2 107.0
n = 30 Σ = 909.0
x = å(x × f ) =
909 = 30.3
n 30
The mean age of the students is 30.3 years.
40
SHAPES OF DISTRIBUTIONS
• A frequency distribution is symmetric when a vertical
line can be drawn through the middle of a graph of the
distribution and the resulting halves are approximately
the mirror images.
• A frequency distribution is uniform (or rectangular)
when all entries, or classes, in the distribution have
equal frequencies. A uniform distribution is also
symmetric.
• A frequency distribution is skewed if the “tail” of the
graph elongates more to one side than to the other. A
distribution is skewed left (negatively skewed) if its tail
extends to the left. A distribution is skewed right
(positively skewed) if its tail extends to the right.
41
SYMMETRIC DISTRIBUTION
10 Annual Incomes
15,000
20,000
22,000
5
24,000 Income
4
25,000
25,000 f 3
2
26,000
28,000 1
30,000 0
$25000
35,000
mean = median = mode
= $25,000
42
SKEWED LEFT DISTRIBUTION
10 Annual Incomes
0
20,000
22,000
24,000 5
25,000 Income
4
25,000
26,000
f 3
2
28,000 1
30,000 0
35,000 $25000
mean = $23,500
median = mode = $25,000 Mean < Median
43
SKEWED RIGHT DISTRIBUTION
10 Annual Incomes
15,000
20,000
22,000
5
24,000 Income
25,000 4
25,000 f 3
26,000 2
28,000 1
30,000 0
$25000
1,000,000
mean = $121,500
median = mode = $25,000 Mean > Median
44
SUMMARY OF SHAPES OF
DISTRIBUTIONS
Symmetric Uniform
Mean = Median
Skewed right Skewed left
Mean > Median Mean < Median
45
Measures of Variation
46
RANGE
The range of a data set is the difference between the maximum and
minimum date entries in the set.
Range = (Maximum data entry) – (Minimum data entry)
Example:
The following data are the closing prices for a certain stock
on ten successive Fridays. Find the range.
Stock 56 56 57 58 61 63 63 67 67 67
The range is 67 – 56 = 11.
47
DEVIATION
The deviation of an entry x in a population data set is the difference
between the entry and the mean µ of the data set.
Deviation of x = x – µ
Example:
Stock Deviation
The following data are the closing x x–µ
prices for a certain stock on five 56 56 – 61 = – 5
successive Fridays. Find the 58 58 – 61 = – 3
deviation of each price. 61 61 – 61 = 0
63 63 – 61 = 2
The mean stock price is 67 67 – 61 = 6
µ = 305/5 = 61.
Σx = 305 Σ(x – µ) = 0
48
VARIANCE AND STANDARD DEVIATION
The population variance of a population data set of N entries is
2 å(x - µ )2
Population variance = s = .
N
“sigma
squared”
The population standard deviation of a population data set of N
entries is the square root of the population variance.
2 å(x - µ )2
Population standard deviation = s= s = .
N
“sigma”
49
FINDING THE POPULATION STANDARD
DEVIATION
Guidelines
In Words In Symbols
1. Find the mean of the population µ = åx
data set. N
2. Find the deviation of each entry. x -µ
3. Square each deviation. (x - µ)2
4. Add to get the sum of squares. SS x = å (x - µ)
2
5. Divide by N to get the population å (x - µ)
2
variance. s2 =
N
6. Find the square root of the
å (x - µ)
2
variance to get the population s=
N
standard deviation.
50
FINDING THE SAMPLE STANDARD
DEVIATION
Guidelines
In Words In Symbols
1. Find the mean of the sample data x = åx
set. n
2. Find the deviation of each entry. x -x
3. Square each deviation. (x - x )2
4. Add to get the sum of squares. SS x = å (x - x )
2
5. Divide by n – 1 to get the sample å (x - x )
2
variance. s2 =
n -1
6. Find the square root of the
å (x - x )
2
variance to get the sample s=
n -1
standard deviation.
51
INTERPRETING STANDARD
DEVIATION
When interpreting standard deviation, remember that is a measure
of the typical amount an entry deviates from the mean. The more
the entries are spread out, the greater the standard deviation.
14 14
12 =4 12 =4
Frequency
Frequency
10 s = 1.18 10 s=0
8 8
6 6
4 4
2 2
0 0
2 4 6 2 4 6
Data value Data value
52
EMPIRICAL RULE (68-95-99.7%)
For data with a (symmetric) bell-shaped distribution, the standard
deviation has the following characteristics.
1. About 68% of the data lie within one standard
deviation of the mean.
2. About 95% of the data lie within two standard
deviations of the mean.
3. About 99.7% of the data lie within three standard
deviation of the mean.
53
EMPIRICAL RULE (68-95-99.7%)
99.7% within 3
standard deviations
95% within 2
standard deviations
68% within
1 standard
deviation
34% 34%
2.35% 2.35%
13.5% 13.5%
–4 –3 –2 –1 0 1 2 3 4
54
CHEBYCHEV’S THEOREM
The Empirical Rule is only used for symmetric
distributions.
Chebychev’s Theorem can be used for any distribution,
regardless of the shape.
55
STANDARD DEVIATION FOR
GROUPED DATA
2
Sample standard deviation = s = å(x - x ) f
n -1
where n = Σf is the number of entries in the data set, and x is the
data value or the midpoint of an interval.
Example:
The following frequency distribution represents the ages
of 30 students in a statistics class. The mean age of the
students is 30.3 years. Find the standard deviation of the
frequency distribution.
Continued.
56
STANDARD DEVIATION FOR
GROUPED DATA
The mean age of the students is 30.3 years.
Class x f x– (x – )2 (x – )2f
18 – 25 21.5 13 – 8.8 77.44 1006.72
26 – 33 29.5 8 – 0.8 0.64 5.12
34 – 41 37.5 4 7.2 51.84 207.36
42 – 49 45.5 3 15.2 231.04 693.12
50 – 57 53.5 2 23.2 538.24 1076.48
n = 30 å = 2988.80
å(x - x )2f 2988.8
s= = = 103.06 = 10.2
n -1 29
The standard deviation of the ages is 10.2 years.
57
Measures of Position
58
QUARTILES
The three quartiles, Q1, Q2, and Q3, approximately divide
an ordered data set into four equal parts.
Median
Q1 Q2 Q3
0 25 50 75 100
Q1 is the median of the Q3 is the median of
data below Q2. the data above Q2.
59
INTERQUARTILE RANGE
The interquartile range (IQR) of a data set is the difference
between the third and first quartiles.
Interquartile range (IQR) = Q3 – Q1.
Example:
The quartiles for 15 quiz scores are listed below. Find the
interquartile range.
Q1 = 37 Q2 = 43 Q3 = 48
(IQR) = Q3 – Q1 The quiz scores in the middle
= 48 – 37 portion of the data set vary by
at most 11 points.
= 11
60
BOX AND WHISKER PLOT
A box-and-whisker plot is an exploratory data analysis tool
that highlights the important features of a data set.
The five-number summary is used to draw the graph.
• The minimum entry
• Q1
• Q2 (median)
• Q3
• The maximum entry
Example:
Use the data from the 15 quiz scores to draw a box-and-
whisker plot.
28 30 33 37 37 38 42 43 43 44 45 48 48 51 55
Continued.
61
BOX AND WHISKER PLOT
Five-number summary
• The minimum entry 28
• Q1 37
• Q2 (median) 43
• Q3 48
• The maximum entry 55
Quiz Scores
28 37 43 48 55
28 32 36 40 44 48 52 56
62
STANDARD SCORES
The standard score or z-score, represents the number of
standard deviations that a data value, x, falls from the
mean, µ.
value - mean x -µ
z= =
standard deviation s
Example:
The test scores for all statistics finals at Union College
have a mean of 78 and standard deviation of 7. Find the
z-score for
a.) a test score of 85,
b.) a test score of 70,
c.) a test score of 78.
Continued.
63
STANDARD SCORES
Example continued:
a.) µ = 78, σ = 7, x = 85
x - µ 85 - 78
z= = 1.0 This score is 1 standard deviation
s = 7 higher than the mean.
b.) µ = 78, σ = 7, x = 70
x - µ 70 - 78
z=
s = 7 = -1.14 deviations lower than the mean.
This score is 1.14 standard
c.) µ = 78, σ = 7, x = 78
x - µ 78 - 78
z= =0 This score is the same as the mean.
s = 7
64
RELATIVE Z-SCORES
Example:
John received a 75 on a test whose class mean was 73.2
with a standard deviation of 4.5. Samantha received a 68.6
on a test whose class mean was 65 with a standard
deviation of 3.9. Which student had the better test score?
John’s z-score Samantha’s z-score
x - µ 75 - 73.2 x - µ 68.6 - 65
z= = z= =
s 4.5 s 3.9
= 0.4 = 0.92
John’s score was 0.4 standard deviations higher than
the mean, while Samantha’s score was 0.92 standard
deviations higher than the mean. Samantha’s test
score was better than John’s.
65