Download mean

Document related concepts
no text concepts found
Transcript
Chapter 3
Descriptive Statistics: Numerical Methods






Measures of Location
Measures of Variability
Measure of Relative Location and Detecting Outliers
Exploratory Data Analysis
Measures of Association between Two Variables
The Weighted mean and Working with Grouped
Data
Copyright © 2010, HJ Shanghai Normal Uni.
x
1
3.1 Measures of Location





Mean (均值)
Median (中位数)
Mode (众数)
Percentiles (百分位数)
Quartiles (四分位数)
Copyright © 2010, HJ Shanghai Normal Uni.
2
Example: Apartment Rents
Given below is a sample of monthly rent values ($)
for one-bedroom apartments. The data is a sample of 70
apartments in a particular city. The data are presented
in ascending order.
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
3
Mean


The mean (平均值) of a data set is the average of
all the data values.
If the data are from a sample, the mean is denoted by
x.
 xi
x
n

If the data are from a population, the mean is
denoted by m (mu).
 xi

N
Copyright © 2010, HJ Shanghai Normal Uni.
4
Example: Apartment Rents

Mean
 xi 34, 356
x

 490.80
n
70
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
5
Median


The median (中位数)is the measure of location
most often reported for annual income and property
value data.
A few extremely large incomes or property values
can inflate the mean.
Copyright © 2010, HJ Shanghai Normal Uni.
6
Median



The median of a data set is the value in the middle
when the data items are arranged in ascending order.
For an odd number of observations, the median is the
middle value.
For an even number of observations, the median is
the average of the two middle values.
Copyright © 2010, HJ Shanghai Normal Uni.
7
Example: Apartment Rents

Median
Median = 50th percentile
i = (p/100)n = (50/100)70 = 35
Averaging the 35th and 36th data values:
Median = (475 + 475)/2 = 475
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
8
Mode




The mode (众数)of a data set is the value that
occurs with greatest frequency.
The greatest frequency can occur at two or more
different values.
If the data have exactly two modes, the data are
bimodal. (双峰)
If the data have more than two modes, the data are
multimodal. (多峰)
Copyright © 2010, HJ Shanghai Normal Uni.
9
Example: Apartment Rents

Mode
450 occurred most frequently (7 times)
Mode = 450
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
10
Percentiles


A percentile (百分位数)provides information
about how the data are spread over the interval from
the smallest value to the largest value.
Admission test scores for colleges and universities
are frequently reported in terms of percentiles.
Copyright © 2010, HJ Shanghai Normal Uni.
11
Percentiles

The pth percentile of a data set is a value such that at
least p percent of the items take on this value or less
and at least (100 - p) percent of the items take on this
value or more.
• Arrange the data in ascending order.
• Compute index i, the position of the pth percentile.
i = (p/100)n
• If i is not an integer, round up.
The pth percentile is
the value in the ith position.
• If i is an integer, the pth percentile is the average of
the values in positions i and i+1.
Copyright © 2010, HJ Shanghai Normal Uni.
12
Example: Apartment Rents

90th Percentile
i = (p/100)n = (90/100)70 = 63
Averaging the 63rd and 64th data values:
90th Percentile = (580 + 590)/2 = 585
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
13
Quartiles




Quartiles (四分位数) are specific percentiles
First Quartile = 25th Percentile
Second Quartile = 50th Percentile = Median
Third Quartile = 75th Percentile
Copyright © 2010, HJ Shanghai Normal Uni.
14
Example: Apartment Rents

Third Quartile
Third quartile = 75th percentile
i = (p/100)n = (75/100)70 = 52.5 = 53
Third quartile = 525
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
15
Measures of Variability


It is often desirable to consider measures of
variability (dispersion), as well as measures of
location.
For example, in choosing supplier A or supplier B we
might consider not only the average delivery time for
each, but also the variability in delivery time for each.
Copyright © 2010, HJ Shanghai Normal Uni.
16
Measures of Variability





Range (极差)
Interquartile Range (四分位点内距)
Variance (方差)
Standard Deviation (标准差)
Coefficient of Variation (变异系数)
Copyright © 2010, HJ Shanghai Normal Uni.
17
Range



The range (极差)of a data set is the difference
between the largest and smallest data values.
It is the simplest measure of variability.
It is very sensitive to the smallest and largest data
values.
Copyright © 2010, HJ Shanghai Normal Uni.
18
Example: Apartment Rents

Range
Range = largest value - smallest value
Range = 615 - 425 = 190
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
19
Interquartile Range



The interquartile range (四分位点内距)of a data
set is the difference between the third quartile and
the first quartile.
It is the range for the middle 50% of the data.
It overcomes the sensitivity to extreme data values.
Copyright © 2010, HJ Shanghai Normal Uni.
20
Example: Apartment Rents

Interquartile Range
3rd Quartile (Q3) = 525
1st Quartile (Q1) = 445
Interquartile Range = Q3 - Q1 = 525 - 445 = 80
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
21
Variance


The variance (方差)is a measure of variability that
utilizes all the data.
x
It is based on the difference
between the value of
each observation (xi) and the mean (x for a sample, 
for a population).
Copyright © 2010, HJ Shanghai Normal Uni.
22
Variance


The variance is the average of the squared differences
between each data value and the mean.
If the data set is a sample, the variance is denoted by
s2 .
s2 

2
(
x

x
)
 i
n 1
If the data set is a population, the variance is denoted
by  2. (sigma)
2
(
x


)

i
2 
N
Copyright © 2010, HJ Shanghai Normal Uni.
23
Standard Deviation



The standard deviation (标准差)of a data set is the
positive square root of the variance.
It is measured in the same units as the data, making
it more easily comparable, than the variance, to the
mean.
If the data set is a sample, the standard deviation is
denoted s.
s  s2

If the data set is a population, the standard deviation
is denoted  (sigma).

Copyright © 2010, HJ Shanghai Normal Uni.
2
24
Coefficient of Variation


The coefficient of variation (变异系数)indicates
how large the standard deviation is in relation to the
mean.
If the data set is a sample, the coefficient of variation
is computed as follows:
s
(100)
x

If the data set is a population, the coefficient of
variation is computed as follows:

(100)

Copyright © 2010, HJ Shanghai Normal Uni.
25
Example: Apartment Rents

Variance

s 
n 1
2

( xi  x ) 2
 2 , 996.16
Standard Deviation
s  s2  2996. 47  54. 74

Coefficient of Variation
s
54. 74
 100 
 100  11.15
x
490.80
Copyright © 2010, HJ Shanghai Normal Uni.
26
课堂练习
一项关于大学生体重状况的研究发现,男生的平均体重
为60kg,标准差为5kg;女生的平均体重为50kg,标准
差为5kg。请回答下面的问题:
要求:(1)男生的体重差异大还是女生的体重差异大?
为什么?
(2)以磅为单位(1磅=2.2kg)求体重的平均数
和标准差。
(3)粗略地估计一下,男生中有百分之几的人体
重在55kg~65kg之间?
(4)粗略地估计一下,女生中有百分之几的人体
重在40kg~60kg之间?
Copyright © 2010, HJ Shanghai Normal Uni.
27
Chapter 3
Descriptive Statistics: Numerical Methods




Measures of Relative Location and Detecting
Outliers
Exploratory Data Analysis
Measures of Association Between Two Variables
The Weighted Mean and
Working with Grouped Data
x
Copyright © 2010, HJ Shanghai Normal Uni.
28
Measures of Relative Location
and Detecting Outliers




z-Scores (Z-分数)
Chebyshev’s Theorem (切比雪夫定理)
Empirical Rule (经验法则)
Detecting Outliers (异常值检测)
Copyright © 2010, HJ Shanghai Normal Uni.
29
z-Scores (Z-分数)


The z-score is often called the standardized value.
It denotes the number of standard deviations a data
value xi is from the mean.
xi  x
zi 
s



A data value less than the sample mean will have a zscore less than zero.
A data value greater than the sample mean will have
a z-score greater than zero.
A data value equal to the sample mean will have a zscore of zero.
Copyright © 2010, HJ Shanghai Normal Uni.
30
Example: Apartment Rents

z-Score of Smallest Value (425)
xi  x 425  490.80
z

 1. 20
s
54. 74
Standardized Values for Apartment Rents
-1.20
-0.93
-0.75
-0.47
-0.20
0.35
1.54
-1.11
-0.93
-0.75
-0.38
-0.11
0.44
1.54
-1.11
-0.93
-0.75
-0.38
-0.01
0.62
1.63
-1.02
-0.84
-0.75
-0.34
-0.01
0.62
1.81
-1.02
-0.84
-0.75
-0.29
-0.01
0.62
1.99
Copyright © 2010, HJ Shanghai Normal Uni.
-1.02
-0.84
-0.56
-0.29
0.17
0.81
1.99
-1.02
-0.84
-0.56
-0.29
0.17
1.06
1.99
-1.02
-0.84
-0.56
-0.20
0.17
1.08
1.99
-0.93
-0.75
-0.47
-0.20
0.17
1.45
2.27
-0.93
-0.75
-0.47
-0.20
0.35
1.45
2.27
31
Example:Z-scores for the class-size

Sample mean: 44; sample standard deviation:8
Copyright © 2010, HJ Shanghai Normal Uni.
32
Chebyshev’s Theorem (切比雪夫定理)
At least (1 - 1/z2) of the items in any data set will be
within z standard deviations of the mean, where z is
any value greater than 1.
• At least 75% of the items must be within
z = 2 standard deviations of the mean.
• At least 89% of the items must be within
z = 3 standard deviations of the mean.
• At least 94% of the items must be within
z = 4 standard deviations of the mean.
与均值的距离必定在z个标准差以内的数据比例至少为(1 - 1/z2)
Copyright © 2010, HJ Shanghai Normal Uni.
33
Example: the midterm test scores



the midterm test scores for 100 students in a college
business statistics course had a mean of 70 and a
standard deviation of 5. How many students had
test scores between 60 and 80? How many students
had test scores between 58 and 82?
60-80:
• Z60 =(60-70)/5=-2 ; Z80=(80-70)/5=2;
• At least (1 - 1/(2)2) = 0.75 or 75% of the students
have scores between 60 and 80.
58-82?
Copyright © 2010, HJ Shanghai Normal Uni.
34
Example: Apartment Rents

Chebyshev’s Theorem (切比雪夫定理)
Let z = 1.5 with
x = 490.80 and s = 54.74
At least (1 - 1/(1.5)2) = 1 - 0.44 = 0.56 or 56%
of the rent values must be between
x - z(s) = 490.80 - 1.5(54.74) = 409
and
x + z(s) = 490.80 + 1.5(54.74) = 573
Copyright © 2010, HJ Shanghai Normal Uni.
35
Example: Apartment Rents

Chebyshev’s Theorem (continued)
Actually, 86% of the rent values
are between 409 and 573.
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
36
Empirical Rule(经验法则)
For data having a bell-shaped distribution:
• Approximately 68% of the data values will be
within one standard deviation of the mean.
Copyright © 2010, HJ Shanghai Normal Uni.
37
Empirical Rule
For data having a bell-shaped distribution:
• Approximately 95% of the data values will be
within two standard deviations of the mean.
Copyright © 2010, HJ Shanghai Normal Uni.
38
Empirical Rule
For data having a bell-shaped distribution:
• Almost all (99.7%) of the items will be
within three standard deviations of the mean.
Copyright © 2010, HJ Shanghai Normal Uni.
39
Copyright © 2010, HJ Shanghai Normal Uni.
40
Example: Apartment Rents

Empirical Rule
Within +/- 1s
Within +/- 2s
Within +/- 3s
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
Interval
436.06 to 545.54
381.32 to 600.28
326.58 to 655.02
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
% in Interval
48/70 = 69%
68/70 = 97%
70/70 = 100%
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
41
应用:six sigma(六西格玛)

用“σ”度量质量特性总体上对目标值
的偏离程度。几个西格玛是一种表
示品质的统计尺度。任何一个工作
程序或工艺过程都可用几个西格玛
表示。

六个西格玛可解释为每一百万个机
会中有3.4个出错的机会,即合格率
是99.99966%。而三个西格玛的合
格率只有93.32%。

六个西格玛的管理方法重点是将所
有的工作作为一种流程,采用量化
的方法 分析流程中影响质量的因素
,找出最关键的因素加以改进从而
达到更高的客户满意度。
Copyright © 2010, HJ Shanghai Normal Uni.
42
Detecting Outliers (异常值检测)



An outlier is an unusually small or unusually large
value in a data set.
A data value with a z-score less than -3 or greater
than +3 might be considered an outlier.
It might be:
• an incorrectly recorded data value
• a data value that was incorrectly included in the
data set
• a correctly recorded data value that belongs in the
data set
Copyright © 2010, HJ Shanghai Normal Uni.
43
Example: Apartment Rents

Detecting Outliers
The most extreme z-scores are -1.20 and 2.27.
Using |z| > 3 as the criterion for an outlier,
there are no outliers in this data set.
Standardized Values for Apartment Rents
-1.20
-0.93
-0.75
-0.47
-0.20
0.35
1.54
-1.11
-0.93
-0.75
-0.38
-0.11
0.44
1.54
-1.11
-0.93
-0.75
-0.38
-0.01
0.62
1.63
-1.02
-0.84
-0.75
-0.34
-0.01
0.62
1.81
-1.02
-0.84
-0.75
-0.29
-0.01
0.62
1.99
Copyright © 2010, HJ Shanghai Normal Uni.
-1.02
-0.84
-0.56
-0.29
0.17
0.81
1.99
-1.02
-0.84
-0.56
-0.29
0.17
1.06
1.99
-1.02
-0.84
-0.56
-0.20
0.17
1.08
1.99
-0.93
-0.75
-0.47
-0.20
0.17
1.45
2.27
-0.93
-0.75
-0.47
-0.20
0.35
1.45
2.27
44
Exploratory Data Analysis (探索性数据分析)


Five-Number Summary (五数据概括法)
Box Plot (箱形图)
Copyright © 2010, HJ Shanghai Normal Uni.
45
Five-Number Summary





Smallest Value (最小值)
First Quartile (第一四分位数)
Median (中位数)
Third Quartile (第三四分位数)
Largest Value (最大值)
Copyright © 2010, HJ Shanghai Normal Uni.
46
Example: Apartment Rents

Five-Number Summary
Lowest Value = 425
First Quartile = 450
Median = 475
Third Quartile = 525
Largest Value = 615
425
440
450
465
480
510
575
430
440
450
470
485
515
575
430
440
450
470
490
525
580
435
445
450
472
490
525
590
435
445
450
475
490
525
600
Copyright © 2010, HJ Shanghai Normal Uni.
435
445
460
475
500
535
600
435
445
460
475
500
549
600
435
445
460
480
500
550
600
440
450
465
480
500
570
615
440
450
465
480
510
570
615
47
Box Plot



A box is drawn with its ends located at the first and third
quartiles.
A vertical line is drawn in the box at the location of the
median.
Limits are located (not drawn) using the interquartile range
(IQR).
• The lower limit is located 1.5(IQR) below Q1.
• The upper limit is located 1.5(IQR) above Q3.
• Data outside these limits are considered outliers.
Copyright © 2010, HJ Shanghai Normal Uni.
48
Box Plot (Continued)


Whiskers (dashed lines) are drawn from the ends of
the box to the smallest and largest data values inside
the limits.
The locations of each outlier is shown with the
symbol * .
Copyright © 2010, HJ Shanghai Normal Uni.
49
Example: Apartment Rents

Box Plot
Lower Limit: Q1 - 1.5(IQR) = 450 - 1.5(75) = 337.5
Upper Limit: Q3 + 1.5(IQR) = 525 + 1.5(75) = 637.5
There are no outliers.
37
5
40
0
42
5
45
0
47
5
Copyright © 2010, HJ Shanghai Normal Uni.
50
0
52
5
550
575 600
625
50
Measures of Association
Between Two Variables


Covariance (协方差)
Correlation Coefficient (相关系数)
Copyright © 2010, HJ Shanghai Normal Uni.
51
Covariance



The covariance (协方差)is a measure of the linear
association between two variables.
If the data sets are samples, the covariance is denoted
by sxy.
 ( xi  x )( yi  y )
sxy 
n 1
If the data sets are populations, the covariance is
denoted by  xy.
 xy
 ( xi   x )( yi   y )

N
Copyright © 2010, HJ Shanghai Normal Uni.
52
Covariance


Positive values indicate a positive relationship.
Negative values indicate a negative relationship.
Copyright © 2010, HJ Shanghai Normal Uni.
53
Correlation Coefficient (相关系数)




The coefficient can take on values between -1 and +1.
Values near -1 indicate a strong negative linear
relationship.
Values near +1 indicate a strong positive linear
relationship.
If the data sets are samples, the coefficient is rxy.
rxy 

sxy
sx s y
If the data sets are populations, the coefficient is
 xy
Copyright © 2010, HJ Shanghai Normal Uni.
 xy

 x y
 xy
.
54
The Weighted Mean and
Working with Grouped Data




Weighted Mean (加权平均值)
Mean for Grouped Data (分组数据均值)
Variance for Grouped Data (分组数据方差)
Standard Deviation for Grouped Data (分组数据标
准差)
Copyright © 2010, HJ Shanghai Normal Uni.
55
Weighted Mean (加权平均值)



When the mean is computed by giving each data
value a weight that reflects its importance, it is
referred to as a weighted mean.
In the computation of a grade point average (GPA),
the weights are the number of credit hours earned for
each grade.
When data values vary in importance, the analyst
must choose the weight that best reflects the
importance of each value.
Copyright © 2010, HJ Shanghai Normal Uni.
56
Weighted Mean
x =  wi xi
 wi
where:
xi = value of observation i
wi = weight for observation i
Copyright © 2010, HJ Shanghai Normal Uni.
57
Grouped Data




The weighted mean computation can be used to
obtain approximations of the mean, variance, and
standard deviation for the grouped data.
To compute the weighted mean, we treat the
midpoint of each class as though it were the mean of
all items in the class.
We compute a weighted mean of the class midpoints
using the class frequencies as weights.
Similarly, in computing the variance and standard
deviation, the class frequencies are used as weights.
Copyright © 2010, HJ Shanghai Normal Uni.
58
Mean for Grouped Data (分组数据均值)

Sample Data
fM

x
f
i
fM


i
i
i

Population Data
i
N
where:
fi = frequency of class i
Mi = midpoint of class i
Copyright © 2010, HJ Shanghai Normal Uni.
59
Example: Apartment Rents
Given below is the previous sample of monthly rents
for one-bedroom apartments presented here as grouped
data in the form of a frequency distribution.
Rent ($) Frequency
420-439
8
440-459
17
460-479
12
480-499
8
500-519
7
520-539
4
540-559
2
560-579
4
580-599
2
600-619
6
Copyright © 2010, HJ Shanghai Normal Uni.
60
Example: Apartment Rents

Mean for Grouped Data
Rent ($)
420-439
440-459
460-479
480-499
500-519
520-539
540-559
560-579
580-599
600-619
Total
fi
8
17
12
8
7
4
2
4
2
6
70
Mi
429.5
449.5
469.5
489.5
509.5
529.5
549.5
569.5
589.5
609.5
Copyright © 2010, HJ Shanghai Normal Uni.
f iMi
3436.0
7641.5
5634.0
3916.0
3566.5
2118.0
1099.0
2278.0
1179.0
3657.0
34525.0
34, 525
 493. 21
70
This approximation
differs by $2.41 from
the actual sample
mean of $490.80.
x
61
Variance for Grouped Data (分组数据方差)

Sample Data
2
f
(
M

x
)

i
i
s2 
n 1

Population Data
2
f
(
M


)

i
i
2 
N
Copyright © 2010, HJ Shanghai Normal Uni.
62
Example: Apartment Rents

Variance for Grouped Data
s2  3, 017.89

Standard Deviation for Grouped Data (分组数据标
准差)
s  3, 017.89  54. 94
This approximation differs by only $.20
from the actual standard deviation of $54.74.
Copyright © 2010, HJ Shanghai Normal Uni.
63
小结






中心位置的度量:均值、中位数、众数
数据集其它位置的描述:百分位数,四分位点
变异程度或分散程度:极差、四分位点内距、方差、
标准差、变异系数、Z分数、切比雪夫定理
构建五数概括法和箱形图
两变量之间的协方差和相关系数
加权平均值、分组数据的均值、方差和标准差
Copyright © 2010, HJ Shanghai Normal Uni.
64
Copyright © 2010, HJ Shanghai Normal Uni.
65
Copyright © 2010, HJ Shanghai Normal Uni.
66
End of Chapter 3, Part B
Copyright © 2010, HJ Shanghai Normal Uni.
67
Related documents