No Slide Title

Download Report

Transcript No Slide Title

Economics 173
Business Statistics
Lectures 5 & 6
Summer, 2001
Professor J. Petry
1
Chapter 11
Inference About the
Description of a Single
Population
2
11.1 Introduction
• In this chapter we utilize the approach developed
before for making statistical inference about
populations.
– Identify the parameter to be estimated or tested .
– Specify the parameter’s estimator and its sampling
distribution.
– Construct an interval estimator or perform a test.
3
• We will develop techniques to estimate and test
three population parameters.
– The expected value m
– The variance s2
– The population proportion p (for qualitative data)
• Examples
– A bank conducts a survey to estimate the number of
times customer will actually use ATM machines.
– A random sample of processing times is taken to test the
mean production time and the variance of production
time on a production line.
4
11.2 Inference About a Population
Mean When the Population
Standard Deviation Is
Unknown
• Recall that when s is known x is normally distributed
– If the sample is drawn from a normal population, or if
– the population is not normal but the sample is sufficiently large.
• When s is unknown, we use its point estimator s,
and the Z statistic is replaced then by the t-statistic
5
ZZt t t
Z
ttt
Z
x

m
xm
Z
t
t t t tt t 
Z
ss n
s
s
s
s
sss n
sss s sssssss
When the sampled population is normally distributed,
the statistic t is Student t distributed.
The “degrees of freedom”,
The t distribution is mound-shaped,
a function of the sample size
and symmetrical around zero.
determines how spread the
d.f. = n2
distribution is (compared to the
normal distribution)
n1 < n2
d.f. = n1
0
6
Probability calculations for the t distribution
– The t table provides critical value for various
probabilities of interest.
– The form of the probabilities that appear in table 4
Appendix B are:
P(t > tA, d.f.) = A
– For a given degree of freedom, and for a
predetermined right hand tail probability A, the entry
in the table is the corresponding tA.
– These values are used in computing interval
estimates and performing hypotheses tests.
7
A = .05
tA
t.100
t.05
t.025
t.01
t.005
3.078
1.886
.
.
1.325
6.314
2.92
.
.
1.725
12.706
4.303
.
.
2.086
31.821
6.965
.
.
2.528
.
.
.
.
.
.
.
.
.
.
200
1.286
1.282
1.653
1.645
1.972
1.96
2.345
2.326
63.657
9.925
.
.
2.845
.
.
2.601
2.576
Degrees of Freedom
1
2
.
.
20

8
Testing the population mean when the
population standard deviation is unknown
• If the population is normally distributed, the test
statistic for m when s is unknown is t.
t
x m
s
n
• This statistic is Student t distributed with n-1
degrees of freedom.
9
• Example 11.1 Trainees productivity
– In order to determine the number of workers required
to meet demand, the productivity of newly hired
trainees is studied.
– It is believed that trainees can process and distribute
more than 450 packages per hour within one week
of hiring.
– Can we conclude that this belief is correct, based on
productivity observation of 50 trainees, See file
XM11-01.
10
• Solution
– The problem objective is to describe the population
of the number of packages processed in one hour.
– The data are quantitative.
H0:m = 450
H1:m > 450
– The t statistic
t
x m
s
n
d.f. = n - 1 = 49
11
– Solving by hand
• The rejection region is t > ta,n - 1
• ta,n - 1 = t.05,49 = approximately to 1.676.
• From the data we have

x i  23,019

x i2  10,671,357, thus
23,019
x
 460.38, and
50

x



n

2
s2
i
x i2
n 1
 1507.55.
s  1507.55  38.83
12
Rejection region
• The test statistic is
t
x m
s
n
1.676

460.38  450
38.83
50
1.89
 1.89
• Since 1.89 > 1.676 we reject the null hypothesis in favor
of the alternative.
• There is sufficient evidence to infer that the mean
productivity of trainees one week after being hired is
greater than 450 packages at .05 significance level.
13
Test of Hypothesis About MU (SIGMA Unknown)
Data
505
Test of MU = 450 Vs MU greater than 450
400
Sample standard deviation = 38.8271
499
Sample mean = 460.38
415
Test Statistic: t = 1.8904
418
P-Value = 0.0323
.
.
.
.05
.0323
• Since .0323 < .05, we reject the null hypothesis in favor of the
alternative.
• There is sufficient evidence to infer that the mean productivity of
trainees one week after being hired is greater than 450
packages at .05 significance level.
14
Estimating the population mean when the
population standard deviation is unknown
• Confidence interval estimator of m when s is
unknown
x  ta
s
2
n
d.f .  n  1
15
• Example 11.2
– An investor is trying to estimate the return on
investment in companies that won quality awards
last year.
– A random sample of 50 such companies is selected,
and the return on investment is calculated had he
invested in them.
– Construct a 95% confidence interval for the mean
return.
2
– From the data we determine, x  14.75 s  66.90
16
• Solution
– The problem objective is to describe the population
of annual returns from buying shares of quality
award-winners.
– The data are quantitative.
– Solving by hand
2
• From the data we determine x  14.75 s  66.90
s  8.18
x  ta 2
s
n
 14.75  2.009
8.18
50
 12.43,17.07
17
Checking the required conditions
• We need to check that the population is normally
distributed, or at least not extremely non-normal.
• There are statistical methods to test for normality
(to be introduced later).
• Currently, we can plot the histogram of the data
set.
18
A Histogram for XM11- 01
14
12
10
8
6
4
2
0
400
425
12
10
450
475
500
525
550
Packages
A Histogram for XM11- 02
575
More
8
6
4
2
0
5
10
15
20
25
Returns
30
35
More
19
11.3 Inference About a Population
Variance
• Some times we are interested in making inference
about the variability of processes.
• Examples:
– The consistency of a production process for quality
control purposes.
– Investors use variance as a measure of risk.
• To draw inference about variability, the parameter
of interest is s2.
20
• The sample variance s2 is an unbiased,
consistent and efficient point estimator for s2.
(n  1) s 2
• The statistic
has a distribution called
s2
Chi-squared, if the population is normally
distributed.
2
 
d.f. = 1
d.f. = 5
(n  1) s 2
s
2
d.f .  n  1
d.f. = 10
21
The 2 table
A =.01
A =.01
1 - A =.99
21-A
2 A
.010
.990
2.01,10  23.2093
Degrees of
2
freedom  .995
1
0.0000393
.
.
10
2.15585
.
.
.
.
2.990 2.975
2.010 2.005
0.0001571
0.0009821
.
.
6.6349
7.87944
2.55821
.
.
3.24697
.
.
.
. 23.2093
.
.
.
25.1882
.
.
.
22
Estimating the population variance
• From the following probability statement
P(21-a/2 < 2 < 2a/2) = 1-a
we have (by substituting 2 = [(n - 1)s2]/s2.)
(n  1)s 2
 2a / 2
 s2 
(n  1)s 2
12a / 2
23
• Example 11.3 (operation management application)
– A container-filling machine is believed to fill 1 liter
containers so consistently, that the variance of the
filling will be less than 1 cc (.001 liter).
– To test this belief a random sample of 25 1-liter fills
was taken, and the results recorded.
– The data are provided in file XM11-03.
– Do these data support the belief that the variance is
less than 1cc at 5% significance level?
24
• Solution
– The problem objective is to describe the population of
1-liter fills from a filling machine.
– The data are quantitative, and we are interested in the
variability of the fills.
– The complete test is:
H0: s2 = 1
2
(
n

1
)
s
H1: s2 <1 The test statistic is  2 
.
2
s
The rejection region is  2  12a,n1
25
– Solving by hand
• Note that (n - 1)s2 = S(xi - x)2 = Sxi2 - Sxi/n
• From the sample (data is presented in units of cc-1000 to
avoid rounding) we can calculate Sxi = -3.6, and Sxi2 = 21.3.
• Then (n - 1)s2 = 21.3 - (-3.6)2/25 = 20.8.
• The complete test is shown next There is insufficient evidence
2
to reject the hypothesis that
(
n

1
)
s
20.8
2
 
 2  20.8,
the variance is equal to 1cc,
2
s
1
in favor of the hypothesis that
2
2
1a ,n1   .95,251  13.8484.
it is smaller.
Since 13.8484  20.8, do not reject
the null hypothesis.
26
a = .05
1-a = .95
Rejection
region
 2  13.8484
13.8484 20.8
2
.295,251
Do not reject the null hypothesis
27
11.4 Inference About a Population
Proportion
• When the population consists of qualitative or
categorical data, the only inference we can make
is about the proportion of occurrence of a certain
value.
• The parameter “p” was used before to calculate
probabilities using the binomial distribution.
28
• Statistic and sampling distribution
– the statistic employed is
x
pˆ  where
n
x  the number of successes.
n  sample size.
– Under certain conditions, [np > 5 and n(1-p) > 5],
pˆ is approximately normally distributed, with
m = p and s2 = p(1 - p)/n.
29
• Test statistic for p
Z
pˆ  p
p(1  p) / n
where np  5 and n(1  p)  5
• Interval estimator for p (1-a confidence level)
pˆ  za / 2 pˆ (1  pˆ ) / n
provided npˆ  5 and n(1  pˆ )  5
30
• Example 11.5 (marketing application)
– For a new newspaper to be financially viable, it has
to capture at least 12% of the Toronto market.
– In a survey conducted among 400 randomly selected
prospective readers, 58 participants indicated they
would subscribe to the newspaper if its cost did not
exceed $20 a month.
– Can the publisher conclude that the proposed
newspaper will be financially viable at 10%
significance level?
31
• Solution
– The problem objective is to describe the population
of newspaper readers in Toronto.
– The responses to the survey are qualitative.
– The parameter to be tested is “p”.
– The hypotheses are:
H0: p = .12
H1: p > .12
We want to prove that the newspaper is financially viable
32
– Solving by hand
• The rejection region is z > za = z.10 = 1.28.
• The sample proportion is pˆ  58 400  .145
• The value of the test statistic is
Z
pˆ  p
p(1  p) / n

.145  .12
.12(1  .12) / 400
 1.54
• The p-value is = P(Z>1.54) = .0618
There is sufficient evidence to reject the null hypothesis
in favor of the alternative hypothesis. At 10% significance
level we can argue that at least 12% of Toronto’s readers
will subscribe to the new newspaper.
33
Test of p = 0.12 Vs p greater than 0.12
Sample Proportion = 0.145
Test Statistic = 1.5386
P-Value = 0.0619
34
• Example 11.6 (marketing application)
– In a survey of 2000 TV viewers at 11.40 p.m. on a
certain night, 226 indicated they watched “The Tonight
Show”.
– Estimate the number of TVs tuned to the Tonight Show
in a typical night, if there are 100 million potential
television sets. Use a 95% confidence level.
– Solution
pˆ  z a / 2 pˆ (1  pˆ ) / n  .113  1.96 .113(. 887) / 2000
.113  .014
35
Selecting the Sample Size to Estimate the
Proportion
• The interval estimator for the proportion is
pˆ  z a / 2 pˆ (1 pˆ ) / n
• Thus, if we wish to estimate the proportion to within W,
we can write W  z a / 2 pˆ (1  pˆ ) / n
• The required sample size is
 z a / 2 pˆ (1  pˆ ) / n
n
W




2
36
• Example
– Suppose we want to estimate the proportion of
customers who prefer our company’s brand to within
.03 with 95% confidence.
– Find the sample size needed to guarantee that this
requirement is met.
2
 1.96 pˆ (1  pˆ ) 
– Solution

n
W = .03; 1 - a = .95,
therefore a/2 = .025,
so z.025 = 1.96

.03

Since the sample has not yet
been taken, the sample proportion
is still unknown.
We proceed using either one of the
following two methods:
37
• Method 1:
– There is no knowledge about the value of pˆ
• Let pˆ  .5 , which results in the largest possible n needed
for a pˆ  W 1-a confidence interval.
• If the sample proportion does not equal .5, the actual W
will be narrower than .03.
• Method 2:
– There is some idea about the value of pˆ
• Use the value of pˆ to calculate the sample size
 1.96 .5(1  .5)
n
.03

2

  1,068
 1.96 .2(1  .2)

n
.03

2

  683

38
Chapter 12
Inference about the
Comparison of
Two Populations
39
12.1 Introduction
• Variety of techniques are presented whose
objective is to compare two populations.
• We are interested in:
– The difference between two means.
– The ratio of two variances.
– The difference between two proportions.
40
12.2 Inference about the Difference b/n
Two Means: Independent Samples
• Two random samples are drawn from the two
populations of interest.
• Because we are interested in the difference
between the two means, we shall build the
statistic x for each sample (and support the
analysis by the statistic S2 as well).
41
The Sampling Distribution of x  x
1


2
x1  x 2 is normally distributed if the (original)
population distributions are normal .
x1  x 2 is approximately normally distributed if the
(original) population is not normal, but the sample
size is large.

Expected value of

The variance of
x 1  x 2 is m1 - m2
x 1  x 2 is s12/n1 + s22/n2
42
• If the sampling distribution of x1  x 2 is normal or
approximately normal we can write:
( x 1  x 2 )  ( m1  m 2 )
Z
s12 s 22

n1 n2
• Z can be used to build a test statistic or a
confidence interval for m1 - m2
43
• Practically, the “Z” statistic is hardly used,
because the population variances are not known.
( x 1  x 2 )  ( m1  m 2 )
Zt 
sS?1122 sS?2222

n1 n2
• Instead, we construct a “t” statistic using the
sample “variances” (S12 and S22).
44
• Two cases are considered when producing the
t-statistic.
– The two unknown population variances are equal.
– The two unknown population variances are not equal.
45
Case I: The two variances are equal
• Calculate the pooled variance estimate by:
2
2
(
n

1
)
s

(
n

1
)
s
2
1
2
2
Sp  1
n1  n2  2
n2 = 15
n1 = 10
S
2
1
S 22
S p2
Example: S12 = 25; S22 = 30; n1 = 10; n2 = 15. Then,
(10  1)(25)  (15  1)(30)
Sp 
 28.04347
10  15  2
2
46
• Construct the t-statistic as follows:
( x1  x 2 )  (m1  m 2 )
t
1
2 1
sp (  )
n1 n2
d.f .  n1  n2  2
• Perform a hypothesis test
H0: m1  m2 = 0
H1: m1  m2 > 0;
or < 0;
or
0
Build an interval estimate
( x1  x 2 )  t a 2
1 1
sp (  )
n1 n2
2
w here 1  a is the confidencelev el.
47
Case II: The two variances are unequal
t
( x1  x 2 )  (m1  m 2 )
d.f. 
2
1
2
2
s s
(  )
n1 n2
( s12 n1  s 22 ) 2
2
1
2
2
2
( s n1 ) ( s n2 )

n1  1
n2  1
2
48
Run a hypothesis test
as needed, or,
build an interval estimate
Estimator
s12
s 22
(x 1  x 2 )  t a 2

n1 n 2
where 1  a is the confidencelevel.
49
• Example 12.1
– Do people who eat high-fiber cereal for
breakfast consume, on average, fewer
calories for lunch than people who do not eat
high-fiber cereal for breakfast?
– A sample of 150 people was randomly drawn.
Each person was identified as a consumer or
a non-consumer of high-fiber cereal.
– For each person the number of calories
consumed at lunch was recorded.
50
Calories consumed at lunch
Consmers Non-cmrs
568
498
589
681
540
646
636
739
539
596
607
529
637
617
633
555
.
.
.
.
705
819
706
509
613
582
601
608
787
573
428
754
741
628
537
748
.
.
.
.
Solution:
• The data are quantitative.
• The parameter to be tested is
the difference between two means.
• The claim to be tested is that
mean caloric intake of consumers (m1)
is less than that of non-consumers (m2).
51
• Identifying the technique
–The hypotheses are:
H0: (m1 - m2) = 0
H1: (m1 - m2) < 0
m1 < m2)
– To check the relationships between the variances, we use a
computer output to find the samples’ standard deviations.
We have S1 = 64.05, and S2 = 103.29. It appears that the
variances are unequal.
– We run the t - test for unequal variances.
52
Calories consumed at lunch
Consmers Non-cmrs
568
498
589
681
540
646
636
739
539
596
607
529
637
617
633
555
.
.
.
.
705
819
706
509
613
582
601
608
787
573
428
754
741
628
537
748
.
.
.
.
t-Test: Two-Sample Assuming
Unequal Variances
Consumers
Nonconsumers
Mean
604.023 633.234
Variance
4102.98 10669.8
Observations
43
107
Hypothesized Mean Difference
0
df
123
t Stat
-2.09107
P(T<=t) one-tail 0.01929
t Critical one-tail 1.65734
P(T<=t) two-tail 0.03858
t Critical two-tail 1.97944
• At 5% significance level there is
sufficient evidence to reject the null
hypothesis.
53
• Solving by hand
– The interval estimator for the difference between two
means is
s2 s2
(x  x )  t
( 1  2)
1 2
a 2 n
n
1
2
64.052 103.292
 (604.02  633.239)  1.9796

43
107
 29.21  27.65
54
• Example 12.2
– Do job design (referring to worker movements) affect
worker’s productivity?
– Two job designs are being considered for the
production of a new computer desk.
– Two samples are randomly and independently selected
• A sample of 25 workers assembled a desk using design A.
• A sample of 25 workers assembled the desk using design B.
• The assembly times were recorded
– Do the assembly times of the two designs differs?
55
Assembly times in Minutes
Design-A Design-B
5.2
6.8
6.7
5.0
5.7
7.9
6.6
5.2
Solution
8.5
7.6
6.5
5.0
• The data are quantitative.
5.9
5.9
6.7
5.2
6.6
6.5
• The parameter of interest is the difference
.
.
between two population means.
.
.
.
.
.
.
• The claim to be tested is whether a difference
between the two designs exists.
56
• Solving by hand
(6.288  6.016)  0
 0.93
1
1
1.075(  )
25 25
d.f .  25  25  2  48
t
–The hypotheses test is:
H0: (m1 - m2) = 0
H1: (m1 - m2)  0
– To check the relationship between the two variances calculate
the value of S1 and S2. We have S1= 0.92, and S2 =1.14.
We can infer that the two variances are equal to one another.
– To calculate the t-statistic we have:
Let us determine the
x1  6.288 x2  6.016 s  0.8481 s  1.2996
rejection region
2
1
S p2 
2
2
(25  1)(0.8481)  (25  1)(1.2996)
 1.075
25  25  2
57
• The rejection region is
t  t a 2, d.f.  t 0.025,48  2.009
Notice the absolute value
|t|
For a = 0.05
• The test: Since t= 0.93 < 2.009, there is
insufficient evidence to reject the null hypothesis.
.025
Rejection region
.093 2.009
58
• Conclusion: From this experiment, it is unclear at
5% significance level if the two job designs are
different in terms of worker’s productivity.
.025
Rejection region
.093 2.009
59
Design-A Design-B
6.8
5.2
5.0
6.7
7.9
5.7
5.2
6.6
7.6
8.5
5.0
6.5
5.9
5.9
5.2
6.7
6.5
6.6
.
.
.
.
.
.
.
.
Degrees of freedom
t - statistic
P-value of the one tail test
P-value of the two tail test
The Excel printout
t-Test: Two-Sample Assuming Equal Variances
Design-A
Mean
6.288
2
S1 0.847766667
Variance
Observations
25
Pooled Variance
1.075416667
Hypothesized Mean Difference
0
df
48
t Stat
0.927332603
P(T<=t) one-tail
0.179196744
t Critical one-tail
1.677224191
P(T<=t) two-tail
0.358393488
t Critical two-tail
2.01063358
Design-B
6.016
1.3030667
25
2
S22
Sp
m1  m 2
60
A 95% confidence interval for m1 - m2 is calculated as follows:
( x1  x 2 )  t a 2
1 1
sp (  ) 
n1 n2
2
1
1
 6.288  6.016  2.0106 1.075(  ) 
25 25
 0.272  0.5896  [ 0.3176, 0.8616]
Thus, at 95% confidence level
-0.3176 < m1 - m2 < 0.8616
Notice: “Zero” is included in the interval
61
Checking the required Conditions for the
equal variances case (example 12.2)
Design A
12
The distributions are not
bell shaped, but they
seem to be approximately
normal. Since the technique
is robust, we can be confident
about the results.
10
8
6
4
2
0
5
5.8
6.6
Design B
7.4
8.2
More
4.2
5
5.8
7
6
5
4
3
2
1
0
6.6
7.4
More
62
12.4 Matched Pairs Experiment
• What is a matched pair experiment?
• Why matched pairs experiments are needed?
• How do we deal with data produced in this way?
The following example demonstrates a situation
where a matched pair experiment is the correct
approach to testing the difference between two
population means.
63
Example 12.3
• To determine whether a new steel-belted radial tire lasts
longer than a current model, the manufacturer designs
the following experiment.
– A pair of newly designed tires are installed on the rear wheels
of 20 randomly selected cars.
– A pair of currently used tires are installed on the rear wheels
of another 20 cars.
– Drivers drive in their usual way until the tires worn out.
– The number of miles driven by each driver were recorded.
See data next.
64
Solution
New-Design
70
83
78
46
74
56
74
52
99
57
77
84
72
98
81
63
88
69
54
97
m1
Exstng-Dsn
47
65
59
61
75
65
73
85
97
84
72
39
72
91
64
63
79
74
76
43
• Compare two populations of
quantitative data.
• The parameter is m1 - m2
The hypotheses are:
H0: (m1 - m2) = 0
H1: (m1 - m2) > 0
Mean distance driven before worn out
occurs for the new design tires
m2
Mean distance driven before worn out
occurs for the existing design tires
65
• The hypotheses are
H0: m1 - m2 = 0
H1: m1 - m2 > 0
The test statistic is
x1  x 2  (m1  m 2 )
t
1
2 1
sp (  )
n1 n1
We run the t test, and
obtain the following
Excel results.
t-Test: Two-Sample Assuming
Equal Variances
New Dsgn Exstng dsgn
Mean
73.6
69.2
Variance
243.4105263
226.8
Observations
20
20
Pooled Variance 235.1052632
Hypothesized Mean Difference0
df
38
t Stat
0.907447484
P(T<=t) one-tail 0.184944575
t Critical one-tail 1.685953066
P(T<=t) two-tail
0.36988915
t Critical two-tail 2.024394234
We conclude that there is insufficient
evidence to reject H0 in favor of H1.
66
New design
7
6
5
4
3
2
1
0
45
60
75
90
105
More
105
More
Existing design
12
10
8
6
4
2
0
45
60
75
90
While the sample mean of the new design is larger than the sample mean
of the existing design, the variability within each sample is large enough
for the sample distributions to overlap and cover about the same range.
It is therefore difficult to argue that one expected value is different than
the other.
67