Вы находитесь на странице: 1из 94

Chapter 3

Descriptive Statistics:
Numerical Methods, Part A

Measures of Location
Measures of Variability

Measures of Location

Mean
Median
Mode
Percentiles
Quartiles

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

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

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

If the data are from a population, the mean is


denoted by m (mu).

xi

Example: Apartment Rents


Mean

425
440
450
465
480
510
575

430
440
450
470
485
515
575

xi 34, 356
x

490.80
n
70
430
440
450
470
490
525
580

435
445
450
472
490
525
590

435
445
450
475
490
525
600

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

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.

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.

Example: Apartment Rents


Median
Median = 50th percentile
i = (p/100)n = (50/100)70 = 35.5
Averaging the 35th and 36th data
425
430
values:
440 440
450 450
465 470
480 485
510 515
575 575

430 435
440 445
Median
450 450
470 472
490 490
525 525
580 590

435 435
445 445
= (475 +
450 460
475 475
490 500
525 535
600 600

435 435 440


445 445 450
475)/2 = 475
460 460 465
475 480 480
500 500 500
549 550 570
600 600 615

440
450
465
480
510
570
615

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.

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

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

Using Excel to Compute


the Mean, Median, and Mode
Formula
A Worksheet
B
C
1
2
3
4
5
6

Apartment
1
2
3
4
5

Monthly
Rent ($)
525
440
450
615
480

Mean =AVERAGE(B2:B71)
Median =MEDIAN(B2:B71)
Mode =MODE(B2:B71)

Note: Rows 7-71 are not shown.

Using Excel to Compute


the Mean, Median, and Mode
Value AWorksheet
B
1
2
3
4
5
6

Apartment
1
2
3
4
5

Monthly
Rent ($)
525
440
450
615
480

Mean
Median
Mode

490.80
475.00
450.00

Note: Rows 7-71 are not shown.

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.

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 p th percentile is
the value in the i th position.
If i is an integer, the p th percentile is the average of
the values in positions i and i +1.

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

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

80th Percentile
Example: Apartment Rents
i = (p/100)n = (80/100)70 = 56
Averaging the 56th and 57th data values:
80th Percentile = (535 + 549)/2 = 542
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

435
445
460
475
500
535
600

435
445
460
475
500
549
600

435
445
460
480
500
550
600

Note: Data is in ascending order.

440
450
465
480
500
570
615

440
450
465
480
510
570
615

80th Percentile
Example: Apartment Rents

At least 80% of the


items take on a
value of 542 or less.

At least 20% of the


items take on a
value of 542 or more.

56/70 = .8 or 80%

14/70 = .2 or 20%

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

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

Quartiles

Quartiles are specific percentiles


First Quartile = 25th Percentile
Second Quartile = 50th Percentile = Median
Third Quartile = 75th Percentile

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

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

Using Excel to Compute


Percentiles and Quartiles
Unsorted
Monthly
A
B
C Rent
D ($)
1
2
3
4
5
6

Apart- Monthly
ment Rent ($)
1
525
2
440
3
450
4
615
5
480
Note: Rows 7-71 are not shown.

Using Excel to Compute


Percentiles and Quartiles
Sorting Data
Step 1 Select any cell containing data in column B
Step 2 Select the Data pull-down menu
Step 3 Choose the Sort option
Step 4 When the Sort dialog box appears:
In the Sort by box, make sure that
Monthly Rent ($) appears and that
Ascending is selected
In the My list has box, make sure that
Header row is selected
Click OK

Using Excel to Compute


Percentiles and Quartiles
Sorted
A Monthly
B
CRent ($)
D
1
2
3
4
5
6

Apart- Monthly
ment Rent ($)
1
425
2
430
3
430
4
435
5
435
Note: Rows 7-71 are not shown.

Using Excel to Compute


Percentiles and Quartiles
th Percentiles Index
Formula
Worksheet
for
90
A
B
C
D
E
F

1
2
3
4
5
6

Apart- Monthly
Number of
ment Rent ($)
Observations Percentile Index i
1
425
70
90
=(E2/100)*D2
2
430
3
430
4
435
5
435
Note: Rows 7-71 are not shown.

Using Excel to Compute


Percentiles and Quartiles
th Percentiles Index
Value
Worksheet
for
90
A
B
C
D
E
F

1
2
3
4
5
6

Apart- Monthly
Number of
ment Rent ($)
Observations Percentile
1
425
70
90
2
430
3
430
4
435
5
435
Note: Rows 7-71 are not shown.

Index i
63.00

Using Excel to Compute


Percentiles and Quartiles
rd Quartiles Index
Value
Worksheet
for
3
A
B
C
D
E

1
2
3
4
5
6

Apart- Monthly
Number of
ment Rent ($)
Observations Percentile
1
425
70
75
2
430
3
430
4
435
5
435
Note: Rows 7-71 are not shown.

Index i
52.50

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.

Measures of Variability

Range
Interquartile Range
Variance
Standard Deviation
Coefficient of Variation

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.

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

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

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.

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

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

Variance
The variance is a measure of variability that
utilizes all the data.
It is based on the difference between the
value of each observation (xi) and the mean (x
for a sample, for a population).

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.
( x x )2
s2

i
n 1

If the data set is a population, the variance


is denoted by 2.
2
(
x

i
2
N

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).

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)

Example: Apartment Rents


Variance
s2

( xi x )2

n1

2 , 996.16

Standard Deviation
s s 2 2996.47 54.74

Coefficient of Variation
s
54.74
100
100 11.15
x
490.80

the standard
deviation is
about 11%
of the mean

Using Excel to Compute the Sample


Variance, Standard Deviation, and
Coefficient of Variation

Formula
A Worksheet
B
C
1
2
3
4
5
6
7

Apart- Monthly
ment Rent ($)
1
525
2
440
3
450
4
615
5
480
6
510

Mean
Median
Mode
Variance
Std. Dev.
C.V.

=AVERAGE(B2:B71)
=MEDIAN(B2:B71)
=MODE(B2:B71)
=VAR(B2:B71)
=STDEV(B2:B71)
=E6/E2*100

Note: Rows 8-71 are not shown.

Using Excel to Compute the Sample


Variance, Standard Deviation, and
Coefficient of Variation

Value AWorksheet
B
1
2
3
4
5
6
7

Apart- Monthly
ment Rent ($)
1
525
2
440
3
450
4
615
5
480
6
510

Mean
Median
Mode
Variance
Std. Dev.
C.V.

490.80
475.00
450.00
2996.16
54.74
11.15

Note: Rows 8-71 are not shown.

Using Excels
Descriptive Statistics Tool
Step 1 Select the Tools pull-down menu
Step 2 Choose the Data Analysis option
Step 3 Choose Descriptive Statistics from the
list of
Analysis Tools
continued

Using Excels
Descriptive Statistics Tool
Step 4 When the Descriptive Statistics dialog
box
appears:
Enter B1:B71 in the Input Range box
Select Grouped By Columns
Select Labels in First Row
Select Output Range
Enter D1 in the Output Range box
Select Summary Statistics
Click OK

Using Excels
Descriptive Statistics Tool
B
C
ValueA Worksheet
(Partial)
1
2
3
4
5
6
7
8

Apart- Monthly
ment Rent ($)
1
525
2
440
3
450
4
615
5
480
6
510
7
575

Monthly Rent ($)


Mean
Standard Error
Median
Mode
Standard Deviation
Sample Variance

Note: Rows 9-71 are not shown.

490.8
6.542348114
475
450
54.73721146
2996.162319

Using Excels
Descriptive Statistics Tool
B
C
ValueA Worksheet
(Partial)
9
10
11
12
13
14
15
16

8
9
10
11
12
13
14
15

430
440
450
470
485
515
575
430

Kurtosis
Skewness
Range
Minimum
Maximum
Sum
Count

Note: Rows 1-8 and 17-71 are not shown.

E
-0.334093298
0.924330473
190
425
615
34356
70

Try This
Graduate

Starting
Salary

3,450

3,550

3,650

3,480

3,355

3,310

3,490

3,730

3,540

10

3,925

11

3,520

12

3,480

Find the following:


(a) Mean
3,540
(b) Median 3,505
(c) Mode
3,480
(d) 85th percentile
3,730
3,505
(e) 50th percentile
3,465
(f) First quartile
(g) Third quartile
3,600
(h) Range
615
(i) Interquartile range
135
27,440.91
(j) Sample Variance
(k) Standard Deviation
165.65
(l) Coefficient of
4.7%
Variation

Descriptive Statistics:
Numerical Methods, Part B
Measures of Relative Location and
Detecting Outliers
Exploratory Data Analysis
Measures of Association Between Two
Variables
The Weighted Mean and
Working with Grouped Data

Measures of Relative Location


and Detecting Outliers
z-Scores
Chebyshevs Theorem
Empirical Rule
Detecting Outliers

z-Scores
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


z-score 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
z-score of zero.

Example: Apartment Rents


z-Score of Smallest Value (425)
xi x 425 490.80
z

1.20
s
54.74
-1.20
-1.11 -1.11 -1.02
-1.02 for
-1.02Apartment
-1.02 -1.02 -0.93
-0.93
Standardized
Values
Rents
-0.93 -0.93 -0.93 -0.84 -0.84 -0.84 -0.84 -0.84 -0.75 -0.75
-0.75 -0.75 -0.75 -0.75 -0.75 -0.56 -0.56 -0.56 -0.47 -0.47
-0.47 -0.38 -0.38 -0.34 -0.29 -0.29 -0.29 -0.20 -0.20 -0.20
-0.20 -0.11 -0.01 -0.01 -0.01 0.17 0.17 0.17 0.17 0.35
0.35 0.44 0.62 0.62 0.62 0.81 1.06 1.08 1.45 1.45
1.54 1.54 1.63 1.81 1.99 1.99 1.99 1.99 2.27 2.27

Try this
Suppose annual salaries for sales associates from a particular store have a
bell-shaped distribution with a mean of $32,500 and a standard deviation
of $2,500.

The z-score for a sales associate from this store who earns $37,500 is
Answer: 2
The z-score for a sales associate from this store who earns $28,000 is
Answer: -1.8

Chebyshevs 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.
Chebyshevs theorem requires z > 1, but z need not
be an integer.

Chebyshevs Theorem
At least 75% of the data values must be
within z = 2 standard deviations of the mean.
At least 89% of the data values must be

within z = 3 standard deviations of the mean.


At least 94% of the data values must be
within z = 4 standard deviations of the mean.

Chebyshevs Theorem
Example: Test Scores

= 70 and s = 5

For a test score of 82, 2.4 (82-70/5) indicates 82 is 2.4


standard deviation above the mean

At least (1 1/(2.4)2) = .826or 82.6%


of the score must be between

x - z(s) = 70 2.4(5) = 58
and
x + z(s) = 70 + 2.4(5) = 82

Try this
Suppose annual salaries for sales associates from a particular store have a
bell-shaped distribution with a mean of $32,500 and a standard deviation
of $2,500.
.

Use Chebyshev's theorem to calculate the percentage of sales associates


with salaries between $26,250 and $38,750.

Answer: 84%
(1 - 1/z2)
Z= (38,750 32,500)/2500 = 2.5
(1 - 1/2.52)

Empirical Rule
For data having a bell-shaped distribution:

Approximately 68% of the data values will be


within one standard deviation of the mean.

Empirical Rule
For data having a bell-shaped distribution:

Approximately 95% of the data values will be


within two standard deviations of the mean.

Empirical Rule
For data having a bell-shaped distribution:

Almost all (99.7%) of the items will be


three standard deviations of the mean.

within

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

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

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.
It might be a data value that was incorrectly
included in the data set.
It might be a correctly recorded data value
that belongs in the data set !

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

-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

Try this

Suppose annual salaries for sales associates from a particular store have a
bell-shaped distribution with a mean of $32,500 and a standard deviation
of $2,500
Use the empirical rule to calculate the percentage of sales associates with
salaries between $27,500 and $37,500.

Answer: 95%
Still suppose that the distribution of annual salaries for sales
associates at this store is bell-shaped. A sales associate makes
$42,000. Should this salary be considered an outlier? Explain.

Answer: Yes because this salary is more than 3 standard


deviations from the mean. It has a z-score of 3.8.

Exploratory Data Analysis


Five-Number Summary
Box Plot

Five-Number Summary

Smallest Value
First Quartile
Median
Third Quartile
Largest Value

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

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

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.
continued

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 * .

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

50
0

52
5

550

575 600

625

Try this
Annual sales in million of dollars, for 21 pharmaceutical
companies follow:

a.
b.
c.
d.

8408

3,653

7,478

6,452

8,879

2,459

11,413

608

1,374

5,794

4,019

1,850

2,818

1,356

10,498

14,138

1,872

8,305

4,341

739

2,127

Provide a five-number summary


Compute the lower and upper limits
Do the data contain any outliers?
Largest in the list is 14,138, Suppose a data entry error had
been made and the sales had been entered as $41,138 million.
Would the method of detecting outliers in part identify this
problem

A. ) 5 number summary: 608, 1872, 4019, 8305,


14138
B. ) Lower limit: -7777.5
Upper limit: 17,955
c.) No; data are within limits
d) 41,138 would be an outlier

Measures of Association
between Two Variables

Covariance
Correlation Coefficient

Covariance
The covariance is a measure of the linear
association between two variables.
Positive values indicate a positive
relationship.
Negative values indicate a negative
relationship.

Covariance
If the data sets are samples, the covariance is denoted by sxy.

( xi x )( yi y )
n 1
If the data sets are populations, the covariance is denoted by xy
.
sxy

xy

( xi x )( yi y )

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.
sxy
rxy
sx s y
xy .
If the data sets are populations, the coefficient is
xy
xy
x y

Covariance and Correlation Coefficient


Example: Golfing Study
A golfer is interested in investigating the
relationship, if any, between driving distance and
18-hole score.
Average Driving
Average
Distance (yds.) 18-Hole Score
277.6
69
259.5
71
269.1
70
267.0
70
255.6
71
272.9
69

Covariance and Correlation Coefficient


Example: Golfing Study
x

277.6
259.5
269.1
267.0
255.6
272.9

69
71
70
70
71
69

Average 267.0 70.0


Std. Dev. 8.2192 .8944

( xi x ) ( y i y )
10.65
-7.45
2.15
0.05
-11.35
5.95

-1.0
1.0
0
0
1.0
-1.0

( xi x )( yi y )
-10.65
-7.45
0
0
-11.35
-5.95

Total -35.40

Covariance and Correlation Coefficient


Example: Golfing Study

Sample Covariance
sxy

( x x )( y

n1

y)

35.40

7.08
61

Sample Correlation Coefficient


sxy

7.08
rxy

-.9631
sx sy (8.2192)(.8944)

Using Excel to Compute the


Covariance and Correlation Coefficient
Example: Golfing Study
Excel Formula Worksheet

1
2
3
4
5
6
7
8

A
Average
Drive
277.6
259.5
269.1
267.0
255.6
272.9

B
C
D
18-Hole
Score
69
Pop. Covariance =COVARIANCE.S(A2:A7,B2:B7)
71 Samp. Correlation =CORREL(A2:A7,B2:B7)
70
70
71
69

Using Excel to Compute the


Covariance and Correlation Coefficient
Example: Golfing Study
Excel Value Worksheet

1
2
3
4
5
6
7
8

A
Average
Drive
277.6
259.5
269.1
267.0
255.6
272.9

B
C
18-Hole
Score
69
Pop. Covariance
71 Samp. Correlation
70
70
71
69

-5.9
-0.9631

Sample Covariance = sxy = n/(n 1)xy = 6/(6 1)(-5.9) = -7.08

TRY THIS
The following observations are given for two variables.

y
5
8
18
20
22
30
10
7

x
2
12
3
6
11
19
18
9

a. Compute and interpret the sample covariance for the above data.
b. Compute and interpret the sample correlation coefficient.

a. 19.286 (rounded). Since the covariance is positive,


it indicates a positive relationship between x and y.

b. 0.345. There is a positive relationship between x and y.


The relationship is not very strong.

y
5
8
18
20
22
30
10
7

x
2
12
3
6
11
19
18
9

Mean
Standard Deviation

15
8.831761

10
6.324555

Sample Covariance

135
7

19.28571

Sample Corellation
Coefficient

19.28571
(8.83176)(6.32456)

0.34527

15
15
15
15
15
15
15
15

(y-y)

10
10
10
10
10
10
10
10

-10
-7
3
5
7
15
-5
-8
0

(x-x) (y-y)(x-x)
-8
80
2
-14
-7
-21
-4
-20
1
7
9
135
8
-40
-1
8
0
135

The following data represent the daily demand (y in thousands of


units) and the unit price (x in dollars) for a product.
Daily Demand (y)

Unit Price (x)

47
39
35
44
34
20
15
30

1
3
5
3
6
8
16
6

a. Compute and interpret the sample covariance for the above


data.
b. Compute and interpret the sample correlation coefficient.
a. -47. Since the covariance is negative, it indicates a negative
relationship between x and y.

b. -0.922. There is a strong negative relationship between


daily demand and unit price.

Mean
Standard Deviation

Daily Demand (y)


Unit Price (x)
47
1
39
3
35
5
44
3
34
6
20
8
15
16
30
6
33
6
11.08409
4.598136

Sample Covariance

-329
7

Sample Corellation
Coefficient

-47
50.96618

-47

-0.92218

x
33
33
33
33
33
33
33
33

(y-y)
6
6
6
6
6
6
6
6

14
6
2
11
1
-13
-18
-3
0

(x-x) (y-y)(x-x)
-5
-70
-3
-18
-1
-2
-3
-33
0
0
2
-26
10
-180
0
0
0
-329

The Weighted Mean and


Working with Grouped Data
Weighted Mean
Mean for Grouped Data
Variance for Grouped Data
Standard Deviation for Grouped Data

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.

Weighted Mean
x = w i xi
wi

where:

xi = value of observation i
wi = weight for observation i

Example
Purchase

Cost per Pound

Number of Pounds

1,200

3.4

500

2.8

2,750

2.9

1,000

3.25

800

Answer: 2.96

Try this
Compute the weighted mean for the following
x
Weight (w )
data.
9
10
i

8
5
3
2

12
4
5
3

Answer: 6.676
xi
9
8
5
3
2
Weighted Mean

Weight (wi)
10
12
4
5
3
227
34

90
96
20
15
6
6.67647

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.

Mean for Grouped Data


Sample Data

fM

x
f

fM

Population Data

where:

fi = frequency of class i
Mi = midpoint of class i

Sample Mean for Grouped Data


Example: Apartment Rents
The previously presented sample of apartment
rents is shown here as grouped data in the form of
a frequency distribution.
Rent ($)
420-439
440-459
460-479
480-499
500-519
520-539
540-559
560-579
580-599
600-619

Frequency
8
17
12
8
7
4
2
4
2
6

Sample Mean for Grouped Data


Example: Apartment Rents
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

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
x
493.21
70
This approximation
differs by $2.41 from
the actual sample
mean of $490.80.

Variance for Grouped Data


For sample data
2
f i ( Mi x )
s
n 1
2

For population data


2
f
(
M

i
i
2
N

Sample Variance for Grouped Data


Example: Apartment Rents
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

Mi - x
-63.7
-43.7
-23.7
-3.7
16.3
36.3
56.3
76.3
96.3
116.3

(M i - x)2 f i (M i - x)2
4058.96 32471.71
1910.56 32479.59
562.16
6745.97
13.76
110.11
265.36
1857.55
1316.96
5267.86
3168.56
6337.13
5820.16 23280.66
9271.76 18543.53
13523.36 81140.18
208234.29

continued

Sample Variance for Grouped Data

Example: Apartment Rents


Sample Variance
s2 = 208,234.29/(70 1) = 3,017.89

Sample Standard Deviation


s 3,017.89 54.94
This approximation differs by only $.20
from the actual standard deviation of $54.74.

Try this

The following is the frequency distribution for the speeds of


a sample of automobiles traveling on an interstate highway.
Speed (MPH)
50 - 54
55 - 59
60 - 64
65 - 69
70 - 74
75 - 79

The mean is
The variance is
The standard deviation is

Frequency
2
4
5
10
9
5
35

Answer: 67
Answer: 50
Answer: 7.071

*
Speed (MPH)

Frequency (Fi)

50 - 54
55 - 59
60 - 64
65 - 69
70 - 74
75 - 79

2
4
5
10
9
5
35

Mean
Variance
Standard Deviation

Midpoint
52
57
62
67
72
77

67
50.00
7.071067812

FiMi
104
228
310
670
648
385
2345
35

Mean
67
67
67
67
67
67

Mi-Xi (Mi-Xi)2
-15
225
-10
100
-5
25
0
0
5
25
10
100

fi(Mi-xi)2
450.00
400.00
125.00
225.00
500.00
1,700.00

Вам также может понравиться