Beruflich Dokumente
Kultur Dokumente
Definitions
A hypothesis test is a process that uses sample statistics to test a claim
about the value of a population parameter.
A verbal statement, or claim, about a population parameter is called a
statistical hypothesis.
A null hypothesis H0 is a statistical hypothesis that contains a statement
of equality such as , =, or .
A alternative hypothesis Ha is the complement of the null hypothesis.
It is a statement that must be true if H0 is false and contains a statement
of inequality such as >, , or <.
To write the null and alternative hypotheses, translate the claim made
about the population parameter from a verbal statement to a
mathematical statement.
Example:
A manufacturer claims that its rechargeable batteries have an average life
of at least 1,000 charges.
Null hypothesis
H0: 1000 (Claim)
Condition of equality
Ha: < 1000 Complement of the
null hypothesis
Always begin the hypothesis test assuming that the null hypothesis is true.
At the end of the test, one of two decisions will be made:
1. reject the null hypothesis, or
2. fail to reject the null hypothesis.
A type II error occurs if the null hypothesis is not rejected when it is false.
Actual Truth of H0
Decision H0 is true H0 is false
Level of Significance
In a hypothesis test, the level of significance is your maximum allowable
probability of making a type I error. It is denoted by .
Commonly used levels of significance are: = 0.10, = 0.05, = 0.01
By setting the level of significance at a small value, you are saying that you
want the probability of rejecting a true null hypothesis to be small.
H0: μ k
Ha: μ < k
P is the area to
the left of the test
statistic.
z
Test -3 -2 -1 0 1 2 3
statistic
Right-tailed Test : If the alternative hypothesis contains the greater-than symbol
(>), the hypothesis test is a right-tailed test.
z
-3 -2 -1 0 1 2 3
Two-tailed Test : If the alternative hypothesis contains the not-equal-to symbol
(), the hypothesis test is a two-tailed test. In a two-tailed test, each tail has an
area of P. H0: μ = k
P is twice the area Ha: μ k
P is twice the area
to the right of the
to the left of the positive test
negative test statistic.
statistic.
z
-3 -2 -1 0 1 2 3
Definition: The critical region, also called the rejection region, is that set
of values of the test statistic for which the null hypothesis is rejected.
The statistical test of the null hypothesis H0 is completely specified once
the test statistic and the critical region are specified. If TS denotes the test
statistic and C denotes the critical region, then the statistical test of the null
hypothesis H0 is as follows:
“Reject H0 if TS is in C
Do not reject H if TS is not in C
The rejection of the null hypothesis H0 is a strong statement that H0 does
not appear to be consistent with the observed data. The result that H0 is not
rejected is a weak statement that should be interpreted to mean that H0 is
consistent with the data.
Example ;Suppose a test of H0: μ = 0 against Ha: μ 0 resulted in rejection of
H0 at the 5 percent level of significance. Which of the following statements is
(are) accurate?
(a) The data proved that μ is significantly different from 0, meaning that it is far
away from 0.
(b) The data were significantly strong enough to conclude that μ is not equal to 0.
(c) The probability that μ is equal to 0 is less than 0.05.
Digression : Standard Normal Probabilities
clear all
x=-3:0.01:3;
y=normcdf(x);
y1=normpdf(x);
plot(x,y)
hold
plot(x,y1,'r')
grid
Let us look at the outcome of TS in the example considered:
• H0 is rejected at the 5% level of significance. This means that the TS resulted
in sample mean which leads to the value of standard normal variable
abs(Z)>1.96. Thus we conclude that sample mean is significantly far away from
the value assumed in H0. In particular, the probability of rejecting H0 when it is
true (that is making an error of type 1) is less than 5%.
Depending on the value of TS we can further extend the level of confidence.
•If on the other hand, TS yields a
value which is closer to the value
assumed in H0 and falls in “don’t
reject” region all we can say is that
the sample data is consistent with
the “null hypothesis”. It yields
insufficient information for rejecting
it. We may have made an error of
Type 2 in not rejecting H0. However,
without furher knowledge on the true
value of the population mean we can
not estimate Type 2 error probability.
Tests concerning the Mean of Normal Population : Known Variance
Suppose that X1, . . . , Xn are a sample from a normal distribution having
an unknown mean μ and a known variance σ2, and suppose we want to
test the null hypothesis that the mean μ is equal to some specified value
against the alternative that it is not. That is, we want to test
H0: μ = μ 0
against the alternative hypothesis
Ha: μ μ0
for a specified value μ0.
Since the natural point estimator of the population mean μ is the sample mean
1 n
X Xi it would seem reasonable to reject the hypothesis that the
n i 1
population mean is equal to μ0 when X is far away from μ0. That is, the critical
region of the test should be of the form
C X i , i 1, n, 0 X c
for a suitable value of c.
Suppose we want the test to have significance level α. Then c must be
chosen so that the probability,
P( X 0 c)
X
so using the standardized variable Z
n
X we can write
/ n
n c
P ( X 0 c ) P Z
Since the probability that the absolute value of a standard normal exceeds
some value is equal to twice the probability that a standard normal
exceeds that value
n c n c
P ( X 0 c ) 2 P Z
or P Z
2
Since zα/2 is defined to be such that PZ z / 2 it follows that
2
c
n z / 2 c z / 2
n
n c
Hence the condidition P( X 0 c) P Z
P Z z / 2 can be written as,
2
X z / 2 X z / 2
n n
Thus since the hypothesis is H0 : = 0 and the critical region is
Thus we conclude that, when the true signal value is 9.2, there is an
85.47 percent chance that the 0.05 significance level test will not reject
the null hypothesis that the signal value is equal to 10.
Example : To test the hypothesis H0: μ = 105 against Ha: μ 105 a
sample of size 9 is chosen. If the sample mean is 100, find the p value if
the population standard deviation is known to be
(a) σ = 5 ; (b) σ = 10 ; (c) σ = 15
In which cases would the null hypothesis be rejected at the 5 percent
level of significance? What about at the 1 percent level?
What happens when the sample size is increased to 36?
P ( Z a ) P ( Z a ) P ( z a )
2 P ( Z a ) 2 1 ( a )
A- The p values are obtained as:
100 105
(a) P Z 9 3 2 P Z 3 2 1 (3) 0.0026 p
5
100 105
(b) P Z 9 1.5 2 P Z 1.5 2 1 (1.5) 0.1336 p
10
100 105
(c ) P Z 9 1 2 P Z 1 2 1 (1) 0.3174 p
15
Thus we conclude that the null hypothesis will be rejected for (b) and (c) at
5 % confidence level but will not be rejected for the case of (a) . (a) will not
be rejected also at 1% confidence level.
Increasing sample size fourfold increases the standard normal values twofold.
We then have
(a) 2 P Z 6 0=
p P (b) 2 P Z 3 0.0026 p (c) 2 P Z 2 0.0456 p
Thus, in this case all tests will not reject the null hypothesis at 5 %
confidence level, but the hypothesis will be rejected for test (c) at 1%
confidence level.
Example : Traffic authorities claim that traffic lights are red for a time that is
normal with mean 30 seconds and standard deviation 1.4 seconds. To test this
claim, a sample of 40 traffic lights was checked. If the average time of the 40
red lights observed was 32.2 seconds, can we conclude, at the 5 percent level
of significance, that the authorities are incorrect? What about at the 1
percent level of significance?
A- In this case H0: =30, =1.4, n=40 and X =32.2. Hence,
32.2 30
P Z 40 9.9 2 P Z 9.9 0
1.4
Thus we can conclude that the authorities are incorrect both at 5% and
also at 1% significance levels.
One-Sided Tests
(a) Right handed tests: In many situations, the hypothesis we are
interested in testing is that the mean is less than or equal to some
specified value μ0 versus the alternative that it is greater than that value.
That is, we are often interested in testing
H 0 : 0 versus H a : 0
Since we would want to reject H0 only when the sample mean is much
larger than μ0 (and no longer when it is much smaller), it can be shown, in
exactly the same fashion as was done in the two-sided case, that the
significance-level-α test is to
X z
n
Reject H 0 if
0
The p value is then equal to the probability that a standard normal random
variable
X 0 is at least as large as the value of z
n
The null hypothesis is then rejected at any significance level greater
than or equal to the p value.
(b) Left handed tests: In this case all we need to do is reverse the inequalities
for the right handed test.
We have assumed so far that the underlying population distribution is the
normal distribution. However, we have only used this assumption to
conclude that
X
n
0
has a standard normal distribution. But by the central limit theorem this
result will approximately hold, no matter what the underlying population
distribution, as long as n is reasonably large. A rule of thumb is that a
sample size of n ≥ 30 will almost always suffice.
Example :The following data come from a normal population having
standard deviation 4:
{105, 108, 112, 121, 100, 105, 99, 107, 112, 122, 118, 105}
Use them to test the null hypothesis that the population mean is less
than or equal to 108 at the
(a) 5 percent level of significance ;
(b) 1 percent level of significance;
(c) What is the p value?
A- Sample mean is obtained as 109.5, sample size is 12 and SD is 4. Hence, at
5% level of significance
Null hypothesis is 0=108
H 0 : 0 versus H a : 0
X z
n
Reject H 0 if 1.645
0
12
109.5 108 1.3 1.645 Don' t reject
4
Thus there is about 12% probability for the sample mean to be 14.717 when
the actual value is 14.4. Hence, don’t reject the null hypothesis. Another
way of arriving to this conclusion is to note that the hypothesis is to be rejected
if the test statistics (TS) > 1.96 That is reject if
n
TS X o is greater than 1.96
Example: It is known that the value received at a local receiving station is
equal to the value sent plus a random error that is normal with mean 0 and
standard deviation 2. If the same value is sent 7 times, compute the p value for
the test of the null hypothesis that the value sent is equal to 14, if the values
received are : {14.6, 14.8, 15.1, 13.2, 12.4, 16.8, 16.3} H0:=14 (=2,n=7)
Compute the probability that the null hypothesis (the value 14 is sent) will be
rejected, at the 5 percent level of significance, when the actual value sent is 15.
A- Sample mean is 14.742. The standard normal variable and p value are
calculated as, 7
14.743 14 0.983 p value 2 P(Z 0.983) 0.326
2
At 5% significance level H0 will be rejected when sample mean is in the interval
X 14 z0.025 1.96 X 14 1.481 X 12.52 or X 15.48
7
2
X 15 12.52 15 15.48 15
Then since, Z 3.28 ; Z 0.635
2/ 7 0.756 0.756
the probability of rejecting H0 when the actual value is 15 is
P Z 3.28 P Z 0.635 0.0005 0.2635 0.264
Example : Consider a test of H0: μ ≤ 100 versus Ha:μ > 100. Suppose that a
sample of size 20 has a sample mean of 108. Determine the p value of this
outcome if the population standard deviation is known to equal 15.
A- 20
Z 108 100 2.385
15
p value P( Z 2.385) 1 2.385 1 .9914 0.0086
Case of Unknown Variance
The t Test for the Mean of a Normal Population
When σ is no longer assumed to be known, it is reasonable to estimate it by
the sample standard deviation S. In which case the T distribution needs to be
used, thus
X X
2
X X
n n
Z T with S
i
0
S
0
n 1
Since the absolute value of such a random variable will exceed tn−1,α/2 with
probability α, it follows that a significance-level-α test of H0: μ = μ0 versus
Ha: μ μ0 is, when σ is unknown
Reject H0 if |T| ≥ tn−1,α/2
Not reject H0 otherwise
Example :Among a clinic’s patients having high blood cholesterol levels of
at least 240 volunteers were recruited to test a new drug designed to reduce
blood cholesterol. A group of 40 volunteers were given the drug for 60 days,
and the changes in their blood cholesterol levels were noted. If the average
change was a decrease of 6.8 with a sample standard deviation of 12.1, what
conclusions can we draw? Use the 5 percent level of significance.
A-
Let us define the null hypothesis as Ho: the new drug has no effect
T
n
X o 40 6.8 3.554 T39.0.025 z 0.025 1.96
S 12.1
Thus since, T>1.96 the null hypothesis should be rejected at 5% confidence level.
The p value, that is the upper limit of confidence level for not rejecting the null
hypothesis can be calculated as,
On the other hand, since the sample size is large enough we could have
approximated the p value by using the normal approximation to binomial
probabilities.
Since np = 920(0.50) = 460 and np(1 − p) = 460(0.5) = 230, this would
have yielded the following:
X 460 478 460
p value P( X 478) P P( Z 1.187) 0.117
230 230
Note that when one uses continuity correction and replaced 478 by 477.5
one obtains p value as 0.1242 which is a much better approximation to
the exact value of 0.1243.
Example : A computer chip manufacturer claims that at most 2 percent of
the chips it produces are defective. An electronics company, impressed by
that claim, has purchased a large quantity of chips. To determine if the
manufacturer’s claim is plausible, the company has decided to test a sample
of 400 of these chips. If there are 13 defective chips (3.25 percent) among
these 400, does this disprove (at the 5 percent level of significance) the
manufacturer’s claim?
A- If p is the probability that a chip is defective, then we should test the null
hypothesis H0: p ≤ 0.02 against Ha: p > 0.02
That is, to see if the data disprove the manufacturer’s claim, we must take that
claim as the null hypothesis. Since 13 of the 400 chips were observed to be
defective, the p value is equal to the probability that such a large number of
defectives would have occurred if p were equal to 0.02 (its largest possible
value under H0). Therefore,
p value = P{X ≥ 13} = 0.0619 where X is binomial (400, 0.02)
and so the data, though clearly not in favor of the manufacturer’s claim,
are not quite strong enough to reject that claim at the 5 percent level of
significance. 12
400
1 0.02i 0.984001
i 0 i
Let us also calculate this probability using normal approximation to the binomial
distribution..
np 400 0.02 8
SD np 1 p 8 ( 0.98 ) 2.8
X
P X 13 P Z
5
1.786
SD 2.8
1 ( 1.786 ) 1 0.963 0.037
where X is a binomial random variable with parameters n and p0. That is, when
the null hypothesis is that p is at least as large as p0, then the p value
is equal to the probability that a value as small as or smaller than the one
observed would have occurred if p were equal to p0.
Two-Sided Tests of p
Computation of the p value of the test data becomes slightly more involved
when we are interested in testing the hypothesis
H0: p = p0 against the two-sided alternative Ha: p p0
for a specified value p0.
Again suppose that a sample of size n is chosen, and let XS denote the number
of members of the sample who possess the characteristic of interest. We will
want to reject H0 when =XS /n, the proportionp̂ of the sample with the
characteristic, is either much smaller or much larger than p0 or, equivalently,
when XS is either very small or very large in relation to np0. Since we want
the total probability of rejection to be less than or equal to α when p0 is indeed
the true proportion, we can attain these objectives by rejecting for both large
and small values of XS with probability,
when H0 is true, α/2. That is, if we observe a value such that the probability is
less than or equal to α/2 that XS would be either that large or that small when
H0 is true, then H0 should be rejected.
Therefore, if the observed value of X is XS, then H0 will be rejected if either
P{X ≤ XS} ≤ α/2 or P{X ≥ XS} ≤/2