Sie sind auf Seite 1von 15

HYPOTHESIS TESTING (cont.

)
THE p -VALUE OF A TEST OF HYPOTHESIS
‘historical’ µ
Ex 1: σ
For the past few years, the number of customers of a drive-in bottleshop has
averaged 20 per hour, with a standard deviation of 3 per hour. This year,
another bottleshop 1 km away opened a drive-in window. The manager of the
first shop believes that this will result in a decrease in the number of customers.
A random sample of 15 hours showed that the mean number of customers per
hour was 18.6. Can we conclude at the 5% level of significance that the
manager’s belief is correct? n 100-C
x-bar

Follow the six-step process.


i. Set up the null and alternative hypotheses.
The question suggests that HA : µ < 20, so H0 : µ = 20.
ii. Determine the test statistic and its sampling distribution.
Since σ is known, the test statistic is Z.
iii. Specify the significance level.
It is given, α = 0.05.
2
iv. Define the decision rule.
This is a left-tail test, so the entire rejection region is located under the left
tail of the sampling distribution.
The critical value is -zα = -z0.05 = -1.645.
Reject H0 if the value of the test statistic calculated from the sample
is smaller than -1.645.
v. Take a sample and calculate the value of the test statistic.
 3 x  0 18.7  20
x    0.775 z obs    1.677
n 15 x 0.775

vi. Make a statistical decision and draw the conclusion.


Since zobs = -1.677 < -1.645 = -zα, we reject H0 and conclude at the 5%
level of significance that the average number of customers per hour has
decreased.

Note: There are two interesting issues


1) What if the hypothetical population mean is not 20 but 21?
2) What if we change the significance level?
3
1) If the hypothetical population mean is not 20 but 21
H0 : µ = 21 and HA : µ < 21, so the observed test statistic becomes

x  0 18.7  21
z obs    2.968
x 0.775
which is smaller, i.e. even further
from zero than the original test
statistic value, -1.677.
Z
-1.645 0
Reject H0 in favour of HA. Rejection Non-rejection
region region

Similarly, any other hypothetical population mean value greater than 20


produces an observed test statistic below –1.677 leading to the rejection of HA.

In general,
a) If we perform a left-tail test at a given significance level, then HA : µ < µ0,
and H0 : µ = µ0 is equivalent with H0 : µ  µ0.
b) If we perform a right-tail test at a given significance level, then HA : µ > µ0,
and H0 : µ = µ0 is equivalent with H0 : µ  µ0.
4
2) If we change the significance level, e.g. increase it from 5% to 10%, then
the critical value is -1.282 instead of -1.645, but the observed test statistic
remains the same, -1.677.

Reject H0 in favour of HA.

On the other hand, if we decrease the


significance level from 5% to 1%, the Z
critical value becomes -2.326 and we
-2.326
-1.645
-1.282 0
cannot reject H0.
Rejection Non-rejection
region region

In general, if we can reject H0 at a given significance level, then


a) we can reject it at a higher level too;
b) but we may or may not be able reject it at a lower level.
Since the level of significance is the probability of rejecting a true H0,
the lower the better, and the smallest α value that would lead to the
rejection of H0 is called the p-value of the hypothesis test.

5
(Ex 1)
What is the p-value of this test?
P(Z  z obs )  P(Z  1.677)
 P( Z  1.677) p-value

 0.5  P(0  Z  1.677)


Z
 0.5  0.4535  0.0465 zobs = -1.677 0

In this example, any significance level higher than 0.0465 leads to the
rejection of H0.

Note: The calculation of the p-value depends on whether the test is a left-tail
test, a right-tail test or a two-tail test.
Assuming e.g. that the test statistic is Z,
a) If the test is left tailed, the p-value is equal to P (Z < zobs);
b) If the test is right tailed, the p-value is equal to P (Z > zobs);
c) If the test is two tailed, the p-value is equal to 2P (Z > |zobs|);
In each case, reject H0 if the p-value is smaller than the significance level, α.

6
Ex 2:
A diet doctor claims that the average Australian is more than 10 kg overweight.
To test his claim, a random sample of 100 Australians were weighed, and the
difference between their actual weight and their ideal weight was calculated.
Can we infer at the 5% significance level that the doctor’s claim is true?
H0 : µ = 10 and HA : µ > 10 Right-tail test
The data set is saved on the textbook CD in the Xr10-38 Excel file.
X-bar is greater than 10, but is
t-Test: Mean it large enough to reject H0?
Kgs 0
Mean 12.175
Standard Deviation 7.898
Hypothesized Mean 10.000 x   0 12.175  10
df 99.000 t obs    2.7539
t Stat 2.754 sx 0.7898
P(T<=t) one-tail 0.004
t Critical one-tail 1.660 P- value = 0.004
P(T<=t) two-tail 0.007
t Critical two-tail 1.984
7
The critical value is 1.660, and since tobs = 2.754 > 1.660 = tα, we reject H0 and
conclude at the 5% level of significance that the average Australian is more
than 10 kg overweight.

Alternatively, we can make use of the p-value for a one-tail test with H0 : µ = 10
and HA : µ > 10.

Performing a right-tail test, we can reject H0 if the test statistic is positive, and
the p-value is smaller than α.

Since both conditions are satisfied, we can reject H0 at the 5% level.

Note:
We have applied two different decision rules to decide whether to reject H0.
The first one was based on the comparison of the observed test statistic value
to the critical value, while the second one made use of the p-value. The two
decision rules led to the same conclusion.

8
Note: On the basis of an Excel t -test output H0 : µ = µ0 can be rejected
1) in favor of HA : µ  µ0 if | tobs | > tα/2, or two tail p-value < α;
2) in favor of HA : µ < µ0 if tobs < -tα, or tobs < 0 and one tail p-value < α;
3) in favor of HA : µ > µ0 if tobs > tα, or tobs > 0 and one tail p-value < α.

Ex 3:
A market is considered profitable by an e-grocer if average orders exceed $85.
A random sample of orders were taken and the order values recorded in file
Xr9-79. Do the data provide sufficient evidence at the 5% level of significance
to establish that the market would be profitable?

H0 : µ = 85 and HA : µ > 85 Right-tail test

9
t-Test: Mean

Orders
Mean 89.266
Standard Deviation 17.296
Hypothesized Mean 85.000
df 84.000
t Stat 2.274
P(T<=t) one-tail 0.013
t Critical one-tail 1.663
P(T<=t) two-tail 0.026
t Critical two-tail 1.989

The observed test statistic is positive, and

The one tail p-value is 0.013 < (0.05 = α).

We can reject H0 at the 5% level of significance and conclude that the


market would be profitable.

10
HYPOTHESIS TESTS FOR COMPARING TWO
(SUB-) POPULATION MEANS
Independent samples
• Occasionally, we wish to compare two populations and to verify some
statement about the difference between the two population means.
E.g.: Do males spend less on newspapers than females?

Are the average number of hours spent watching television by


graduates and non-graduates the same?

In examples like these ones there are two populations, but only one variable.
Given that the difference between the two population means, µ1 and µ2, is
influenced only by the factor which distinguishes the two populations,
we want to test H0 : µ1 = µ2 (i.e. µ1 - µ2= 0)
against HA : µ1  µ2 (i.e. µ1 - µ2 0) two-tail test,
or HA : µ1 < µ2 (i.e. µ1 - µ2< 0) left-tail test,
or HA : µ1 > µ2 (i.e. µ1 - µ2> 0) right-tail test.
11
– In order to answer questions like these ones, we have to take
independent random samples from both populations, find the sample
means and standard deviations, and specify the sampling distribution of
the test statistic.
In general, the test statistic is equal to

Point estimator – Hypothesized parameter value


Standard error of the point estimator

In this case, X 1  X 2 H 0 : 1   2  0 or in general,


H 0 : 1   2  1,0   2, 0

It depends on whether the population standard deviations are


i. known or not,
ii. if they are unknown, whether they are equal or not.
If the point estimator is at least approximately normally distributed
(i.e. the populations are normal or the sample sizes are 30 or more),
the test statistic is Z (when σ1 and σ2 are known) or t (otherwise).
12
Ex 4:
Automobile insurance companies take many factors into consideration when
setting the rates. These factors include age, marital status, and kilometres
driven per year. In order to determine the effect of gender, 100 male and 100
female drivers were surveyed. Each was asked how many kilometres he or she
drove in the past year. The distances (in thousands of kilometres) are stored in
an Excel file. Assuming equal variances, can we conclude at the 5%
significance level that male and female drivers differ in the numbers of
kilometres driven per year?
t-Test: Two-Sample Assuming Equal Variances H0 : µ1 = µ2 (µ1 - µ2= 0)

Male Female
Mean 72.320 68.770 HA : µ1  µ2 (µ1 - µ2 0)
Variance 26.301 36.199
Observations 100.000 100.000 The two tail p-value of
Pooled Variance 31.250
Hypothesized Mean Difference 0.000
0.000 is less than 0.05 the
df 198.000 significance level.
t Stat 4.490 Therefore, reject H0
P(T<=t) one-tail 0.000 The distances driven are
t Critical one-tail 1.653
significantly different.
P(T<=t) two-tail 0.000
t Critical two-tail 1.972

13
Matched pairs (dependent samples)

Sometimes, we wish to study whether a certain treatment has some


effect on a population.

E.g. Has the professional development course improved the performance of


the employees?

In this case there is only one population (employees) and one variable
(performance), which is observed twice (before and after the course).
Denoting the difference between the before and after measurements as D, we
intend to test H0 : µD = µ1 - µ2= 0 against a two-tail or one-tail alternative.

The observations are matched pairs (i.e. the samples are not independent), and
the point estimator of the mean difference is X  X
1 2

If this point estimator is at least approximately normally distributed (i.e. D is


normal or the sample size is 30 or more), the test statistic is t (the standard
error is estimated from the paired sample).
14
Ex 6:
In order to determine the effect of advertising in the Yellow Pages, Telstra took a
sample of 50 retail stores that did not advertise on the Yellow Pages last year
but did so this year. The annual sales (in thousands of dollars) for each store in
both years were recorded. Can we infer at the 5% significance level that
advertising in the Yellow Pages improves sales?

H0 : µD = 0 , HA : µD > 0

t-Test: Paired Two Sample for Means


The one tail p-value of 0.026 is
Variable 1 Variable 2 less than 0.05 the significance
Mean 77.040 71.080
Variance 403.876 313.300 level. Therefore, reject H0
Observations 50.000 50.000 Advertising in the Yellow Pages
Pearson Correlation 0.376 improves sales.
Hypothesized Mean Difference 0.000
df 49.000
t Stat 1.987
P(T<=t) one-tail 0.026
t Critical one-tail 1.677
P(T<=t) two-tail 0.053
t Critical two-tail 2.010

15

Das könnte Ihnen auch gefallen