Sunteți pe pagina 1din 23

Chapter 9: Hypothesis Tests for One Population Mean

CH 9.1: The Nature of Hypothesis Testing

Hypothesis testing is a decision-making process for evaluating claims made about


a population.

A statistical hypothesis is a conjecture about a population parameter. This


conjecture may or may not be true.

There are two types of statistical hypotheses for each situation: the null hypothesis
and the alternative hypothesis.

 The null hypothesis, denoted H0, is the hypothesis to be tested.


 The alternative hypothesis denoted Ha or H1, is a hypothesis to be considered as
an alternative to the null hypothesis.

Example Null and Alternative Hypothesis

A. Does a new medication affect the pulse rates of those who take the medication?
We know the mean pulse rate for the population under study is 82, the hypotheses
will be:

    H0:: μ = 82              Ha : μ ≠ 82

This is called a two-tailed test, since the possible side effects could raise or lower
the pulse rate.

B. An additive is being considered that will increase the life of an automobile


battery. If the mean of an auto battery is 36 months, then the hypotheses are:

      H0:: μ = 36              Ha : μ > 36

Since we are only interested in increasing the life of the batteries, the alternative
hypothesis is that the mean is greater than 36 months. This is a one-tailed test.

 C. A contractor wants to lower heating bills using a special insulation. The
average monthly heating bill is $78, the hypotheses are:

      H0:: μ = $78             Ha : μ < $78

Also a one-tailed test since the only interest is in lowering heating costs.
The null and alternative hypotheses are always stated together, and the null
hypothesis contains the equal sign:

Two-Tailed Test One-Tailed Right Test One-Tailed Left Test


H0: = H0 : = H0 : =
Ha : ≠ Ha : > Ha : <

 A statistical test uses the data obtained from a sample to make a decision about
whether or not the null hypothesis should be rejected.

The Basic Logic of Hypothesis Testing

Take a random sample from a population. If the sample data are consistent with the
null hypothesis, do not reject the null hypothesis; if the sample data are
inconsistent with the null hypothesis (in the direction of the alternative hypothesis),
reject the null hypothesis and conclude that the alternative hypothesis is true.

EXAMPLE

A company that produces snack foods uses a machine to package 454 g bags of
pretzels. We assume that the net weights are normally distributed and that the
population standard deviation of all such weights is 7.8 g. A random sample of 25
bags of pretzels has the net weights, in grams, displayed in table below.

Weights, in grams, of 25 randomly selected bags of pretzels

465                  456                  438                  454                  447

449                  442                  449                  446                  447

468                  433                  454                  463                  450

446                  447                  456                  452                  444

447                  456                  456                  435                  450

The mean, x = 450 g.

Do the data provide sufficient evidence to conclude that the packaging machine is
not working properly?
Solution:

Let μ denote the mean net weight of all bags packaged.

 Null and Alternative Hypothesis:

H0: μ = 454 g (The packaging machine is working properly)

Ha: μ ≠ 454 g (The packaging machine is not working properly).

This is a two-tailed test.


 Logic behind carrying out the test: If the null hypothesis is true, x is
normally distributed with mean = 454 g. If we observe an x that is “too
different” from 454 g then we have evidence to reject the null hypothesis.
 Identify the distribution of the variable x : x is normally distributed
with a mean μ (at this point unknown) and a standard deviation of
σ 7.8
σ x= = =1. 56
√ n √ 25
Obtain a precise criterion for deciding whether or not to reject the null hypothesis:
Recall that 95.44% of all possible observations lay within 2 standard deviations to
either side of the mean. If x is not within 2 standard deviations of the 454g, then
we agree that we have evidence against the null hypothesis.
The mean, x = 450 g
x−454 450−454
z= = =−2. 56
1 . 56 1 .56
That is, the sample mean is more than 2 standard deviations away from the mean in
the null hypothesis which gives us enough evidence to reject the null hypothesis.

Type I and Type II Errors:

Decision H0 is true H0 is false


Do not reject H0 Correct decision Type II error
Reject H0 Type I error Correct decision
Type I Error: Rejecting the null hypothesis when it is in fact true.
Type II Error: Not rejecting the null hypothesis when it is in fact false.

The pretzel example: (continued)

H0: μ = 454 g
Ha: μ ≠ 454 g

What does the following mean?

a. Type I error

b. Type II error

c. Correct decision

Recall we rejected H0 because of the test statistic


x−454 450−454
z= = =−2. 56
1 . 56 1 .56
Now suppose some omniscient being tells you that μ = 454 g. What kind of
decision did we make: Type I error, Type II error or a correct decision?

α = P(Type I error) = P(rejecting H0 when H0 is true)

β = P(Type II error) = P(not rejecting H0 when Ha is true)

Level of significance, α , is the probability of making a Type I error given that the
null hypothesis is true.

Possible conclusions for a Hypothesis Test


Suppose that a hypothesis test is conducted at a small
significance level.
 If the null hypothesis is rejected, we conclude that the data
provide sufficient evidence to support the alternative
hypothesis.
 If the null hypothesis is not rejected, we conclude that the
data do not provide sufficient evidence to support the
alternative hypothesis.

CH 9.2: Critical-Value Approach to Hypothesis Testing

Test Statistic: The statistic used as a basis for deciding whether the null hypothesis
should be rejected.

Rejection Region: The set of values for the test statistic that leads to rejection of
the null hypothesis.
Non-rejection region: The set of values for the test statistic that leads to non-
rejection of the null hypothesis.
Critical values: The values that separate the rejection and non-rejection regions. A
critical value is considered part of the rejection region.

Two-tailed test Left-tailed test Right-tailed test


Sign in Ha ≠ < >
Rejection region Both sides Left side Right side
 
Possible Conclusions for a Hypothesis Test
 If the null hypothesis is rejected, we conclude that the alternative hypothesis is
true. We say that the test is statistically significant at the α level.
At the α significance level, the data does provide sufficient evidence to reject the
null hypothesis and conclude the alternative hypothesis (state in context of the
application).

 If the null hypothesis is not rejected, we conclude that the data do not provide
sufficient evidence to support the alternative hypothesis. We say that the test
results are not statistically significant at the α level. We never accept the
null hypothesis.
At the α significance level, the data does not provide sufficient evidence to
conclude the alternative hypothesis (state in context of the application).

Hypothesis Test for one population mean whenσ is known:

How to obtain a critical value: Suppose that a hypothesis test is to be performed


at a specified significance level α . Then the critical value(s) must be chosen so
that, if the null hypothesis is true, the probability is α that the test statistic will fall
in the rejection region.

Two-tailed test areas for α = 0.05

Find the left-tailed Critical value for α = .05.


Find the right-tailed Critical value for α = .05.

Some important values of z

z0.10 z0.05 z0.025 z0.01 z0.005


1.282 1.645 1.960 2.326 2.576

These values can be found in the bottom of the t-table

One-Sample z-Test for a Population Mean


Assumptions
1. Normal population (“close” to normal OK) or large sample
2.  known

Critical -Value Approach to Hypothesis Testing

Step 1. The null hypothesis is  = o and the alternative hypothesis is


H1: o or H1: o or H1: o
(two-tailed) (left-tailed) (right-tailed)

Step 2. Decide on the significance level, .

Step 3. Compute the value of the test statistic

x  o
z

n

Step 4. The critical values are


z/2 or -z or +z
(two-tailed) (left-tailed) (right-tailed)

Use the normal table to find the critical value(s).

Step 5. If the value of the test statistic falls in the rejection region, reject Ho;
otherwise, do not reject Ho.

Step 6. State the conclusion in the context of the application.

Example 1: A right tailed test

Price of History Books: In 1997, the mean retail price of all history books was
$43.50. This year’s retail price for 40 randomly selected history books has a mean
of $46.93. The population standard deviation of prices of history books is $7.61.
At the 1% significance level, do the data provide sufficient evidence to conclude
that this year’s mean retail price of all history books has increased from the 1997
mean of $43.50?

Solution:

Let μ denote this year’s mean retail price of all history books. We state the null and
alternative hypotheses as follows.

Step 1: H0: μ = $43.50 (mean price has not increased)

Ha: μ ¿ $43.50 (mean price has increased).

This is a right-sided test

Step 2: Decide on the significance level . ( = 0.01)

Step 3: Compute the value of the test statistic

x −μ 0 46 . 93−43 .50
x σ
n = 40      = $46.93        = $7.61 z= σ / √ n = 7 .61 / √ 40 =2.85

Step 4: Determine the critical value for z α .

 = 0.01, z .01=2.33
Step 5: If the value of the test statistic falls in the rejection region, reject H0;
otherwise, do not reject H0.
Reject H0 because Z = 2.85 falls in the rejection region. The test results are
statistically significant at the 1% level.

Step 6. State the conclusion in the context of the application.


At the 1% significance level, the data does provide sufficient evidence to conclude
that this year’s mean retail price of all history books has increased from the 1997
mean of $43.50.
Example 2: A two-tailed test

Clocking the Cheetah: The cheetah is the fastest land animal on earth. One
estimate of the top speed of the cheetah is 60 miles per hour.

Below is a histogram of the top speeds, in mph, for a sample of 35 cheetahs, for
which the mean is 59.526 mph. The population standard deviation is known to 3.2
mph.
Histogram of SPEEDS

10

8
Frequency

0
55 60 65 70 75
SPEEDS

At the 5% significance level, do the data provide sufficient evidence to conclude


that the mean top speed of all cheetahs differ from 60 mph?
Solution:
μ0=60
x=59.526
n=35
σ=3.2
α=.05
two sided test

Step 1.

H0:  = 60
Ha:   60

Step 2.  = .05

Step 3. Compute the value of the test statistic

x  o
z

n

59 .526−60
z=
3.2
√ 35 = -0.88

Step 4. The critical values are


α =.05  α /2 = .025  z α =z 0.025=1.96
2

z/2 = 1.96

Draw a picture of the rejection and non-rejection region.


Step 5. If the value of the test statistic falls in the rejection region, reject Ho;
otherwise, do not reject Ho. Since -0.88 is in the non-rejection region, the test
results are not statistically significant at the 5% level.

Step 6. State the conclusion in the context of the application.

At the 5% significance level the data does not provide sufficient evidence to
conclude that the mean top speed of all cheetahs differs from 60 mph.

CH 9.3: P-Value Approach to Hypothesis Testing

P-Value is the area of the tail or tails defined by the test statistic. It is the
probability of observing a value of the test statistic as extreme or more extreme
than that observed. By extreme we mean “far from what we would expect to
observe if the null hypothesis is true.”

 The probability is calculated assuming that the null hypothesis is true


 We use the P-value to quantify how unlikely the sample mean is
 Just like in the critical value approach, we calculate the test statistic
x −μ 0
 z0 = σ /√n
 We then calculate the P-value, the probability that the sample mean would be
this extreme, or more extreme, if the null hypothesis was true

Determining the P-value for two-tailed, left-tailed, and right-tailed test is slightly
different:

For the two-tailed test, the “unlikely” regions are regions which their values are
too high or too low. The probability of being at this difference means

 The chance of being this far is too low, or


 The chance of being this far is too high
For the left-tailed test, the “unlikely” region is a region which its values are too
low. The probability of being at this difference means

 The chance of being this far is too low

For the right-tailed test, the “unlikely” region is a region which its values that are
too high

The probability of being at this difference means

 The chance of being this far is too high


Consider again the history book example (page 8): Recall

x −μ 0 46 . 93−43 .50
z0 = σ /√n = 7 .61 / √ 40 = 2.85
P-value = P(Z>2.85)

= 1 – P(Z<2.85)

= 1 – 0.9978 = 0.0022

If the null hypothesis is true we would expect to see a z-value as extreme as 2.85
with probability 0.0022 (only 2 times in 1000).

We would reject the null hypothesis at any α greater than the p-value.

Understanding the connection between the two approaches using the history
book example (page 8):

1. From the critical value approach draw the rejection/non-rejection regions on


the z-axis and plot the z-score. Note that the area of the rejection region is
α
2. Notice that the p-value is the area of the right tail defined by the z-score.
Since the z-score is in the rejection region, the area of the right tail defined
by the z-score must be less than the area of the rejection region, α .

Guide lines for using the P-value to assess the evidence against the null hypothesis
without referring to significance level.

The P-value approach to hypothesis testing

 Step 1. The null hypothesis is  = 0 and the alternative hypothesis is


Ha: 0 or Ha: o or Ha: 0
(two-tailed) (left-tailed) (right-tailed)
Step 2. Decide on the significance level, .

Step 3. Compute the value of the test statistic


x  o
z

n
Step 4. Determine the P-value. The P-value is the area of the tail(s) beyond the test
statistic.

 For a two-tailed test:


 P-value = P(Z < -|z| or Z > |z|) =2P(Z > |z|)
 For Left Tail: P-value = P(Z < z)
 For Right Tail: P-value = P(Z > z)

Step 5. Use the decision rule:


If P-value < a Reject H0
Otherwise Do not reject H0

Step 6. State the conclusion in the context of the application.

CH 9.4: Hypothesis Tests for One-population Mean when σ is known


Example: A right tailed test. This question was solved using critical value approach on
page 8.)

Price of History Books: In 1997, the mean retail price of all history books was
$43.50. This year’s retail price for 40 randomly selected history books has a mean
of $46.93. The population standard deviation of prices for this year’s history books
is $7.61.
At the 1% significance level, do the data provide sufficient evidence to conclude
that this year’s mean retail price of all history books has increased from the 1997
mean of $43.50? Use the P-Value approach

Solution:
Let μ denote this year’s mean retail price of all history books. We state the null and
alternative hypotheses as follows.
Step 1: H0: μ = $43.50 (mean price has not increased)
Ha: μ > $43.50 (mean price has increased).
This is a right-tailed test
Step 2: Decide on the significance level .
 = 0.01
Step 3: Compute the value of the test statistic
n = 40                x = $46.93                  σ = $7.61
x −μ 0 46 . 93−43 .50
z= σ / √ n = 7 .61 / √ 40 =2.85
Step 4: Calculate the p-value. For Right Tail:
P-value = P(Z > z) = P(Z>2.85)
= 1 – P(Z<2.85)
= 1 – 0.9978 = 0.0022
Step 5: Use the decision rule:
If P-value < a Reject Ha
Otherwise Do not reject Ha
p-value = 0.0022
 = 0.01
p-value<  Reject Ha
Reject Ho The test results are statistically significant at the 1% level.

Step 6. State the conclusion in the context of the application.


At the 1% significance level, the data does provide sufficient evidence to conclude
that this year’s mean retail price of all history books has increased from the 1997
mean of $43.50.
Example: A two-tailed p-value
A can of 7-Up states that the contents of the can are 355 ml. A quality control
engineer is worried that the filling machine is miscalibrated. In other words, she
wants to make sure the machine is not under- or over-filling the cans. She
randomly selects 9 cans of 7-Up and measures the contents. She obtains the
following data.
351 360 358 356 359 358 355 361 352
(Sample mean=356.7)

Use the P-value approach to determine if there is evidence at the a=0.05 level of
significance to support the quality control engineer’s claim. Prior experience
indicates that s =3.2ml. Assume the volume is normally distributed.
CH 9.5: Hypothesis Tests for One-population Mean when σ is Unknown
We use a one sample-t-test for a Population Mean if:
 The sample is large or the underlying distribution is normal,
 σ is unknown
Hypothesis Tests for one Population Mean when  is unknown
 We’ll use a t-distribution instead of the standard normal distribution
We will only do the critical value approach. We will use SPSS to make use of the
p-value approach for a hypothesis tests.
Example: Fun sized Snickers bars are supposed to weigh 20 grams. To guard
against consumer advocacy trouble, they are designed to weigh 20.1 grams. A
quality control engineer is concerned that the mean weight of the candy might not
be 20.1 grams. She obtains a random sample of 11 candy bars and weighs them.
The sample yields a mean of 20.3 grams and a standard deviation of 0.64 grams.
Test the claim that the Snickers do not have a mean weight of 20.1 at the 0.01 level
of significance. Assume the weights are normally distributed.
Hint:
 If σ known use z-test.
 If σ unknown use t-test with n-1 degrees of freedom.
Solution:

Step 1.
H0:  = 20.1 grams
H1:   20.1 grams

Step 2. Decide on the significance level, .


 = 0.01

Step 3. Compute the value of the test statistic

x  o
t
s
n

x=20 .3
μ0 =20 .1
s=0 .64
n=11
x−μ0
t=
s
√n
20 .3−20 .1
t=
0 .64
√ 11
t=1.036

Step 4. Use the t-table to determine the critical value using n-1, 11- 1 = 10 degrees
of freedom.
10
t
 = 0.01  /2 = 0.005  0.005 = 3.169.
Step 5. If the value of the test statistic falls in the rejection region, reject H0;
otherwise, do not reject H0.

The value of the test statistic does not fall in the rejection region. Do not reject H0.
Step 6. State the conclusion in the context of the application.

At the 1% significance level the data does not provide sufficient evidence to
conclude that the mean weight of the Snickers bars differs from 20.1 grams.

Example:
The mean number of sunny days per year in Worcester has historically been
tracked to be 210. An environmental scientist observes that in the past 10 years
there were an average of 225 sunny days in 2016. The population standard
deviation is known to be 12 days.
At the 5% significance level test the hypothesis that the mean number of sunny
days has increased.
The mean height of bears is known to be normal. It is believed that the population
mean is 63 inches. A sample of 12 bears yields a mean of 65 inches and a standard
deviation of 5 inches. At the 5% significance level test the hypothesis that the
mean height of bears is greater than 63 inches?

S-ar putea să vă placă și