Hypothesis Testing: ECE 3530 (Spring 2010
Hypothesis Testing: ECE 3530 (Spring 2010
Hypothesis Testing: ECE 3530 (Spring 2010
Antonio Paiva
What is hypothesis testing?
Very important!!
Note that failure to reject H0 does not mean the null
hypothesis is true. There is no formal outcome that
says \accept H0." It only means that we do not have
su cient evidence to support H1.
What is hypothesis testing? (cont.)
Example
In a jury trial the hypotheses are:
H0: defendant is innocent;
H1: defendant is guilty.
Do not critical
reject H0 value
Case study (cont.)
H0 is true H1 is true
Do not Correct Type II
reject H0 decision error
Type I Correct
Reject H0
error decision
Types of errors (cont.)
De nition
The acceptance of H1 when H0 is true is called a Type I
error. The probability of committing a type I error is called
the level of signi cance and is denoted by .
Example
Convicting the defendant when he is innocent!
X
So, the level of signi cance is = 0:0282.
Types of errors (cont.)
De nition
Failure to reject H0 when H1 is true is called a Type II error.
The probability of committing a type II error is denoted by .
= Pr(Type II error)
= Pr(X < 10 when p = 0:15)
9
X
= b(x; n = 100; p = 0:15) = 0:0551
x=0
E ect of the critical value
Reject H0
Theorem
If X is a binomial random variable with n trials and
probability of success of each trial p, then the limiting
form of the distribution of
X np
Z= p np(1 p) n!1
is the standard normal distribution.
H0 is true: Reject H0
= 0:05
(Type I error rate)
25 33
H1 is true: p = 0:06
Fail to reject H0 Accept H1
= 0:6468
(Type II error rate)
30
Visual interpretation with normal approximation
H0 is true: Reject H0
= 0:05
(Type I error rate)
25 33
H1 is true: p = 0:08
Fail to reject H0 Accept H1
= 0:0936
(Type II error rate)
40
Visual interpretation with normal approximation
H0 is true: Reject H0
= 0:05
(Type I error rate)
25 33
H1 is true: p = 0:10
Fail to reject H0 Accept H1
= 0:0036
(Type II error rate)
50
Power of a test
De nition
The power of a test is the probability of rejecting H 0
given that a speci c alternate hypothesis is true. That is,
Power = 1 :
Summary
0
reject H0
One-tailed vs. two-tailed tests (cont.)
reject H0 0
One-tailed vs. two-tailed tests (cont.)
H1: 6= 0,
0
reject H0 reject H0
Two-tailed test: example
98 102
In this case the test statistic is the sample mean
because this is a continuous random variable.
Two-tailed test: example (cont.)
area =2 area =2
98 102
= 100
Pr z =2 < =pn
< z =2 = 1
X
0
area 1
area =2 area =2
X
a 0
reject H0 b reject H0
Tests concerning sample mean (cont.)
(variance known)
a= z
0 =2p n
b= 0 + z =2p n ;
Example
A batch of 100 resistors have an average of 102
Ohms. Assuming a population standard deviation of 8
Ohms, test whether the population mean is 100 Ohms
at a signi cance level of = 0:05.
Step 1:
H0: =100
H1 : 6= 100;
Example continued
Step 3: In this case, the test statistic is speci ed by the
problem to be the sample mean X.
z = z
a= 0 =2p n 0 0:025 p 100
8
= 100 1:96 = 98:432
10
8
Case A:
In this case, we are interested in testing,
H0: =0
H1: > 0.
area 1
area
0
reject H0
One-sided sample mean test (cont.)
(variance known)
0
Pr =p
n <z =1 :
X
Case B:
In this case, we are interested in testing,
H0: =0
H1: < 0.
area 1
area
0
reject H0
One-sided sample mean test (cont.)
(variance known)
0
Pr z<
n
=p
=
X
Example
A quality control engineer nds that a sample of 100 light
bulbs had an average life-time of 470 hours. Assuming a
population standard deviation of = 25 hours, test whether
the population mean is 480 hours vs. the alternative
hypothesis < 480 at a signi cance level of = 0:05.
Step 1:
H0: =480
H1 : < 480;
Step 2: = 0:05
One-sided sample mean test (cont.)
(variance known)
Example continued
Step 3: The test statistic is the sample mean X. Reject H0 if
25
H1: 6= 0,
based a sample X1; X2; : : : ; Xn, but now with unknown
2
variance . For our decision we use the sample mean X
2
and the sample variance s .
We know that in this case the sampling distribution for
X is the t-distribution.
Tests concerning sample mean (cont.)
(variance unknown)
b= 0 + t =2 p n ;
Example solution:
Step 1:
H0 : = 46 kWh
H1 : < 46 kWh;
Step 2: = 0:05
Tests concerning sample mean (cont.)
(variance unknown)
X
0
Step 3: The test statistic is T = s=pn .
Reject H0 if T < t0:05 for v = n 1 = 11 degrees of
freedom; that is, reject H0 if T < 1:796.
Step 4: We have that X = 42, s = 11:9 and n = 12. So,
42 46
T= p = 1:16 > 1:796:
11:9= 12
De nition
The p-value is the lowest level of signi cance at which the
observed value of a test statistic is signi cant (i.e., one
rejects H0).
Hypothesis testing using the p-value (cont.)
area is the
p-value
value of test
statistic
Hypothesis testing using the p-value (cont.)
Example
Suppose that, for a given hypothesis test, the p-value is
0.09. Can H0 be rejected?
Depends! At a signi cance level of 0.05, we cannot
reject H0 because p = 0:09 > 0:05. However, for signi
cance levels greater or equal to 0:09, we can reject H 0.
Hypothesis testing using the p-value (cont.)
Example
A batch of 100 resistors have an average of 101.5 Ohms.
Assuming a population standard deviation of 5 Ohms:
(a) Test whether the population mean is 100 Ohms at a
level of signi cance 0.05.
(b) Compute the p-value.
Hypothesis testing using the p-value (cont.)
Example continued
(a) H0 : = 100; H1 : 6= 100 X = 101:5
therefore,
Test statistic is X. Reject H0 if reject H0.
z
X<100 0:025p n = 100 1:96
or
10 = 99:02
5
10 = 100:98
Hypothesis testing using the p-value (cont.)
Example continued
(b) The observed z-value is
X 100
101:5
p
Z= = n = 5=10
Then, the p-value is
Example continued
area=0.025 area=0.025
area = 0.0013 area = 0.0013