Title: Statistics with Economics and Business Applications
1Statistics with Economics and Business
Applications
Chapter 8 Test of Hypotheses for Means and
Proportions Null and alternative hypotheses,
test statistic, type I and II errors,
significance level, p-value
2 Review
- I. Whats in last lecture?
- Small-Sample Estimation of a Population Mean
Chapter 7 - II. What's in the next two lectures?
- Hypotheses tests for means and proportions
Read Chapter 8
3Introduction
- Setting up and testing hypotheses is an essential
part of statistical inference. In order to
formulate such a test, usually some theory has
been put forward, either because it is believed
to be true or because it is to be used as a basis
for argument, but has not been proved. - Hypothesis testing refers to the process of using
statistical analysis to determine if the
differences between observed and hypothesized
values are due to random chance or to true
differences in the samples. - Statistical tests separate significant effects
from mere luck or random chance. - All hypothesis tests have unavoidable, but
quantifiable, risks of making the wrong
conclusion.
4Introduction
- Suppose that a pharmaceutical company
- is concerned that the mean potency m of an
antibiotic meet the minimum government potency
standards. They need to decide between two
possibilities
- The mean potency m does not exceed the required
minimum potency. - The mean potency m exceeds the required minimum
potency. - This is an example of a test of hypothesis.
5Introduction
- Similar to a courtroom trial. In trying a person
for a crime, the jury needs to decide between one
of two possibilities - The person is guilty.
- The person is innocent.
- To begin with, the person is assumed innocent.
- The prosecutor presents evidence, trying to
convince the jury to reject the original
assumption of innocence, and conclude that the
person is guilty.
6Five Steps of a Statistical Test
- A statistical test of hypothesis consist of
five steps - Specify statistical hypothesis which include a
null hypothesis H0 and a alternative hypothesis
Ha - Identify and calculate test statistic
- Identify distribution and find p-value
- Make a decision to reject or not to reject the
null hypothesis - State conclusion
7Null and Alternative Hypothesis
- The null hypothesis, H0
- The hypothesis we wish to falsify
- Assumed to be true until we can prove otherwise.
- The alternative hypothesis, Ha
- The hypothesis we wish to prove to be true
Court trial Pharmaceuticals H0 innocent
H0 m does not exceeds required potency Ha
guilty Ha m exceeds required potency
8Examples of Hypotheses
- You would like to determine if the diameters of
the ball bearings you produce have a mean of 6.5
cm.
- H0 ???6.5
- Ha ????6.5
- (Two-sided or two tailed alternative)
9Examples of Hypotheses
- Do the 16 ounce cans of peaches meet the claim
on the label (on the average)? - Notice, the real concern would be selling the
consumer less than 16 ounces of peaches.
- H0 ? ? 16
- Ha ??lt 16
- One-sided or one-tailed alternative
10Comments on Setting up Hypothesis
- The null hypothesis must contain the equal sign.
- This is absolutely necessary because the
distribution of test statistic requires the null
hypothesis to be assumed to be true and the value
attached to the equal sign is then the value
assumed to be true. - The alternate hypothesis should be what you are
really attempting to show to be true. - This is not always possible.
There are two possible decisions reject or fail
to reject the null hypothesis. Note we say fail
to reject or not to reject rather than
accept the null hypothesis.
11Two Types of Errors
- There are two types of errors which can
- occur in a statistical test
- Type I error reject the null hypothesis when it
is true - Type II error fail to reject the null
hypothesis when it is false
Actual Fact Your Decision H0 true H0 false
Fail to reject H0 Correct Type II Error
Reject H0 Type I Error Correct
Actual Fact Jurys Decision Guilty Innocent
Guilty Correct Error
Innocent Error Correct
12Error Analogy
- Consider a medical test where the hypotheses are
equivalent to - H0 the patient has a specific disease
- Ha the patient doesnt have the disease
- Then,
- Type I error is equivalent to a false negative
- (I.e., Saying the patient does not have the
disease when in fact, he does.) - Type II error is equivalent to a false positive
- (I.e., Saying the patient has the disease when,
in fact, he does not.)
13Two Types of Errors
- Define
- a P(Type I error) P(reject H0 when H0 is
true) - b P(Type II error) P(fail to reject H0 when H0
is false)
We want to keep the both a and ß as small as
possible. The value of a is controlled by the
experimenter and is called the significance
level. Generally, with everything else held
constant, decreasing one type of error causes the
other to increase.
14Balance Between ??and ?
- The only way to decrease both types of error
simultaneously is to increase the sample size. - No matter what decision is reached, there is
always the risk of one of these errors. - Balance identify the largest significance level
a as the maximum tolerable risk you want to have
of making a type I error. Employ a test procedure
that makes type II error b as small as possible
while maintaining type I error smaller than the
given significance level a.
15Test Statistic
- A test statistic is a quantity calculated from
sample of data. Its value is used to decide
whether or not the null hypothesis should be
rejected. - The choice of a test statistic will depend on
the assumed probability model and the hypotheses
under question. We will learn specific test
statistics later. -
- We then find sampling distribution of the test
statistic and calculate the probability of
rejecting the null hypothesis (type I error) if
it is in fact true. This probability is called
the p-value
16P-value
- The p-value is a measure of inconsistency
between the hypothesized value under the null
hypothesis and the observed sample. - The p-value is the probability, assuming that H0
is true, of obtaining a test statistic value at
least as inconsistent with H0 as what actually
resulted. - It measures whether the test statistic is likely
or unlikely, assuming H0 is true. Small p-values
suggest that the null hypothesis is unlikely to
be true. The smaller it is, the more convincing
is the rejection of the null hypothesis. It
indicates the strength of evidence for rejecting
the null hypothesis H0
17Decision
- A decision as to whether H0 should be
rejected results from comparing the p-value
to the chosen significance level a - H0 should be rejected if p-value ? a.
- H0 should not be rejected if p-value gt a.
When p-valuegta, state fail to reject H0 or not
to reject rather than accepting H0. Write
there is insufficient evidence to reject H0.
Another way to make decision is to use critical
value and rejection region, which will not be
covered in this class.
18Five Steps of a Statistical Test
- A statistical test of hypothesis consist of
five steps - Specify the null hypothesis H0 and alternative
hypothesis Ha in terms of population parameters - Identify and calculate test statistic
- Identify distribution and find p-value
- Compare p-value with the given significance level
and decide if to reject the null hypothesis - State conclusion
19Large Sample Test for Population Mean
- Step 1 Specify the null and alternative
hypothesis - H0 m m0 versus Ha m ? m0 (two-sided test)
- H0 m m0 versus Ha m gt m0 (one-sided test)
- H0 m m0 versus Ha m lt m0 (one-sided test)
- Step 2 Test statistic for large sample (n30)
-
20Intuition of the Test Statistic
- If H0 is true, the value of should be
close to m0, and z will be close to 0. If H0 is
false, will be much larger or smaller than m0,
and z will be much larger or smaller than 0,
indicating that we should reject H0. Thus
Ha m ? m0
- z is much larger or smaller than 0 provides
evidence against H0 - z is much larger than 0 provides evidence
against H0 - z is much smaller than 0 provides evidence
against H0
Ha m gt m0
Ha m lt m0
How much larger (or smaller) is large (small)
enough?
21Large Sample Test for Population Mean
- Step 3 When n is large, the sampling
distribution of z will be approximately standard
normal under H0. Compute sample statistic
z is defined for any possible sample. Thus it is
a random variable which can take many different
values and the sampling distribution tells us the
chance of each value. z is computed from the
given data, thus a fixed number.
22Large Sample Test for Population Mean
- Ha m ? m0 (two-sided test)
- Ha m gt m0 (one-sided test)
- Ha m lt m0 (one-sided test)
P(zgtz), P(zgtz) and P(zltz) can be found from
the normal table
23Example
- The daily yield for a chemical plant has
averaged 880 tons for several years. The quality
control manager wants to know if this average has
changed. She randomly selects 50 days and
records an average yield of 871 tons with a
standard deviation of 21 tons. Conduct the test
using a.05.
24Example
Decision since p-valuelta, we reject the
hypothesis that µ880. Conclusion the average
yield has changed and the change is statistically
significant at level .05.
In fact, the p-value tells us more the null
hypothesis is very unlikely to be true. If the
significance level is set to be any value greater
or equal to .0024, we would still reject the null
hypothesis. Thus, another interpretation of the
p-value is the smallest level of significance at
which H0 would be rejected, and p-value is also
called the observed significance level.
25Example
A homeowner randomly samples 64 homes similar
to her own and finds that the average selling
price is 252,000 with a standard deviation of
15,000. Is this sufficient evidence to conclude
that the average selling price is greater than
250,000? Use a .01.
26Example
Decision since the p-value is greater than a
.01, H0 is not rejected. Conclusion there is
insufficient evidence to indicate that the
average selling price is greater than 250,000.
27Small Sample Test for Population Mean
- Step 1 Specify the null and alternative
hypothesis - H0 m m0 versus Ha m ? m0 (two-sided test)
- H0 m m0 versus Ha m gt m0 (one-sided test)
- H0 m m0 versus Ha m lt m0 (one-sided test)
- Step 2 Test statistic for small sample
-
Step 3 When samples are from a normal
population, under H0 , the sampling distribution
of t has a Students t distribution with n-1
degrees of freedom
28Small Sample Test for Population Mean
- Step 3 Find p-value. Compute sample statistic
- Ha m ? m0 (two-sided test)
- Ha m gt m0 (one-sided test)
- Ha m lt m0 (one-sided test)
P(tgtt), P(tgtt) and P(tltt) can be found from
the t table
29Example
- A sprinkler system is designed so that the
average time for the sprinklers to activate after
being turned on is no more than 15 seconds. A
test of 5 systems gave the following times - 17, 31, 12, 17, 13, 25
- Is the system working as specified? Test using
- a .05.
30Example
- Data 17, 31, 12, 17, 13, 25
- First, calculate the sample mean and standard
deviation.
31Approximating the p-value
- Since the sample size is small, we need to
assume a normal population and use t
distribution. We can only approximate the p-value
for the test using Table 4.
Since the observed value of t 1.38 is smaller
than t.10 1.476, p-value gt .10.
32Example
Decision since the p-value is greater than .1,
than it is greater than a .05, H0 is not
rejected. Conclusion there is insufficient
evidence to indicate that the average activation
time is greater than 15 seconds.
Exact p-values can be calculated by computers.
33Large Sample Test for Difference Between Two
Population Means
34Large Sample Test for Difference Between Two
Population Means
- Step 1 Specify the null and alternative
hypothesis - H0 m1-m2D0 versus Ha m1- m2? D0
- (two-sided test)
- H0 m1-m2D0 versus Ha m1- m2gt D0
- (one-sided test)
- H0 m1-m2D0 versus Ha m1- m2lt D0
- (one-sided test)
- where D0 is some specified difference that
you wish to test. D00 when testing no difference.
35Large Sample Test for Difference Between Two
Population Means
- Step 2 Test statistic for large sample sizes
when - n130 and n230
Step 3 Under H0, the sampling distribution of z
is approximately standard normal
36Large Sample Test for Difference Between Two
Population Means
- Step 3 Find p-value. Compute
-
- Ha m1- m2? D0 (two-sided test)
- Ha m1- m2gt D0 (one-sided test)
- Ha m1- m2lt D0 (one-sided test)
37Example
Avg Daily Intakes Men Women
Sample size 50 50
Sample mean 756 762
Sample Std Dev 35 30
- Is there a difference in the average daily
intakes of dairy products for men versus women?
Use a .05.
38Example
Decision since the p-value is greater than a
.05, H0 is not rejected. Conclusion there is
insufficient evidence to indicate that men and
women have different average daily intakes.
39Small Sample Testing the Difference between Two
Population Means
Note that both population are normally
distributed with the same variances
40Small Sample Testing the Difference between Two
Population Means
- Step 1 Specify the null and alternative
hypothesis - H0 m1-m2D0 versus Ha m1- m2? D0
- (two-sided test)
- H0 m1-m2D0 versus Ha m1- m2gt D0
- (one-sided test)
- H0 m1-m2D0 versus Ha m1- m2lt D0
- (one-sided test)
- where D0 is some specified difference that
you wish to test. D00 when testing no difference.
41Small Sample Testing the Difference between Two
Population Means
- Step 2 Test statistic for small sample sizes
Step 3 Under H0, the sampling distribution of t
has a Students t distribution with n1n2-2
degrees of freedom
42Small Sample Testing the Difference between Two
Population Means
- Step 3 Find p-value. Compute
-
- Ha m1- m2? D0 (two-sided test)
- Ha m1- m2gt D0 (one-sided test)
- Ha m1- m2lt D0 (one-sided test)
43Example
Two training procedures are compared by
measuring the time that it takes trainees to
assemble a device. A different group of trainees
are taught using each method. Is there a
difference in the two methods? Use a .01.
Time to Assemble Method 1 Method 2
Sample size 10 12
Sample mean 35 31
Sample Std Dev 4.9 4.5
44Example
Time to Assemble Method 1 Method 2
Sample size 10 12
Sample mean 35 31
Sample Std Dev 4.9 4.5
45Example
Decision since the p-value is greater than a
.01, H0 is not rejected. Conclusion there is
insufficient evidence to indicate a difference in
the population means.
df n1 n2 2 10 12 2 20
46The Paired-Difference Test
- We have assumed that samples from two
populations are independent. Sometimes the
assumption of independent samples is
intentionally violated, resulting in a
matched-pairs or paired-difference test. - By designing the experiment in this way, we can
eliminate unwanted variability in the experiment - Denote data as
Pair 1 2 n
Population 1 x11 x12 x1n
Population 2 x21 x22 x2n
Difference d1 x11- x21 d2x12- x22 dnx1n- x2n
47The Paired-Difference Test
- Step 1 Specify the null and alternative
hypothesis - H0 m1-m2D0 versus Ha m1- m2? D0
- (two-sided test)
- H0 m1-m2D0 versus Ha m1- m2gt D0
- (one-sided test)
- H0 m1-m2D0 versus Ha m1- m2lt D0
- (one-sided test)
- where D0 is some specified difference that
you wish to test. D00 when testing no difference.
48The Paired-Difference Test
- Step 2 Test statistic for small sample sizes
Step 3 Under H0, the sampling distribution of t
has a Students t distribution with n-1 degrees
of freedom
49The Paired-Difference Test
- Step 3 Find p-value. Compute
-
- Ha m1- m2? D0 (two-sided test)
- Ha m1- m2gt D0 (one-sided test)
- Ha m1- m2lt D0 (one-sided test)
50Paired t Test Example
A weight reduction center advertises that
participants in its program lose an average of at
least 5 pounds during the first week of the
participation. Because of numerous complaints,
the states consumer protection agency doubts
this claim. To test the claim at the 0.05 level
of significance, 12 participants were randomly
selected. Their initial weights and their
weights after 1 week in the program appear on the
next slide. Set up and perform an appropriate
hypothesis test.
51Paired Sample Example continued
52Paired Sample Example continued
Each member serves as his/her own pair. weight
changesinitial weightweight after one week
53Paired Sample Example continued
Decision since the p-value is smaller than a
.05, H0 is rejected. Conclusion there is strong
evidence that the mean weight loss is less than 5
pounds for those who took the program for one
week.
54Key Concepts
- I. A statistical test of hypothesis consist of
five steps - Specify the null hypothesis H0 and alternative
hypothesis Ha in terms of population parameters - Identify and calculate test statistic
- Identify distribution and find p-value
- Compare p-value with the given significance level
and decide if to reject the null hypothesis - State conclusion
55Key Concepts
- II. Errors and Statistical Significance
- Type I error reject the null hypothesis when it
is true - Type II error fail to reject the null
hypothesis when it is false - The significance level a P(type I error)
- b P(type II error)
- The p-value is the probability of observing a
test statistic as extreme as or more than the one
observed also, the smallest value of a for which
H 0 can be rejected - When the p-value is less than the significance
level a , the null hypothesis is rejected
56Key Concepts
- Test for a population mean H0 µµ0
large
small
57Key Concepts
- IV. Test for Difference Between Two Population
Mean H0 µ1-µ2D0
large
small
58Key Concepts
- V. The Paired-Difference Test
- Ha m1- m2? D0 (two-sided test)
- Ha m1- m2gt D0 (one-sided test)
- Ha m1- m2lt D0 (one-sided test)