Sunteți pe pagina 1din 7

Hypothetical Test Parameter Estimation and Hypothesis

Tests
1. Hypothesis Tests
Test of Mean with Known Variance
Sampling
Test of Mean with Unknown Variance
Population
Test of Equality of Two Variances
: ,
Difference of Two Means with Known Variance Sample
Difference of Two Means with Unknown but common X1 , X 2 ,....X n
Variances
2. 2 test for Goodness of Fit ,
Parameter Estimation
3. Independence Test
Hypothesis Tests
Assignment
1 2

1. Hypothesis Test Hypothesis Tests


What is Hypothesis Test? Statistical Test
Quality of a Product
So far = 16.5 = 2.2 New System
New system n = 30
Effective or Not ?
x = 17.6 s n = 2.4

Scenario 1 Not Effective Scenario 2 Effective



population population 2
Rejection
same different region
one-sided (-tailed) test or
two-sided (-tailed) test
16.5 17.6 16.5 17.6

3 4
Normal Distribution and t Distribution with Excel 1) Test of Mean with Known Variance
Significant level = 1% H 0: = 0
Normal Distribution
1 = 5% : 1.64 Two-sided test H 1: 0
X= ( X 1 + X 2 + .... + X n )
n 0.005 0.005
X = X X - 0
X : known n Test Statistics Z= 0.005

NORM .INV ( p, , ) ( )
NORMSINV ( z )
n
-2.58 2.58
Significant level = 1%
t Distribution -2.58 2.58
1 Ex)
X = ( X 1 + X 2 + .... + X n ) 2.74
n 0.005 0.005 H 0 : = 0 : 16.5
X : unknown
1 n X = 17.6, = 2.2, n = 30
S n2 =
n 1 i =1
(x i x) 2

TINV ( p , DOF ) -3.16 3.16


DOF: Degree of Freedom
5 6

2) Test of Mean with Unknown Variance General procedure of hypothesis tests


H 0: = 0 1. Set the null hypothesis H0
One-sided test
H 1: > 0
2. Choose the significant level (generally, 5% or 1%)
(upper-tailed)
3. Determine the critical value from a table of probability:
X - 0 0.01
Test Statistics T= Standard Normal Probability, t-Distribution, 2 Distribution
S
( n ) (two-sided test )
n 2 = 1 (1 )
Significant level = 1% 2.46 4. Apply the following 2equation testing the null hypothesis
Ex) 2.32 x- x-
/ 2 or / 2
H 0 : = 0 : 16.5 H0 is rejected, then H1 is accepted
( ) ( )
n n
X = 17.6, S n = 2.6, n = 30
x-
/ 2 / 2
H0 is accepted
( )
n
In case of t-Distribution, use Sn in stead of
7 8
Error of Hypothesis Tests Ex.
= 0.05, n = 5
Gold content in one coin
Type I Error 0.95 = 1.64
Rejecting the null hypothesis when it is true. H 0 : = 1.00mg
H1 : < 1.00mg
Type II Error
One-sided test
Accept the null hypothesis when it is false.
Known Var.
Type I Type II
Type II Error H1 H0

Type I Error

= 5%
True False
Accept 0.95 A 1.00 Gold Content
Reject X X
9 10

Ex.
3) Test of Equality of Two Variances Products per area of onion
Null Hypothesis H0 : 2X = 2Y X: no fertilizer 6.2 5.7 6.5 6.0 6.3 5.8 5.7 6.0 6.0 5.8
2
S Y: with fertilizer 5.6 5.9 5.6 5.7 5.8 5.7 6.0 5.5 5.7 5.5
Test Statistic: F = X
2
S Y
x = 6.0 y = 5.7
Significance level :
1 10
One - Sided S =
2 1 10
(x i x) 2 S2Y = (yi y) 2
10 1 i =1
10 1 i =1
X
if 2X > 2Y and F > f, m-1, n-1 rejected f , m-1, n-1

if 2X < 2Y and F < f1, m-1, n-1 rejected


Excel Function
FINV(, m-1, n-1)

0.05
f1-, m-1, n-1
3.18
11 12
4) Difference of Two Means with Known Variance Ex.1
Turnaround time for scheduling methods A and B of computer OS.
Population X : N( X , X ) sampling ( x1 , x 2 ,...., x m ) Method n x
Y : N( Y , Y ) ( y1 , y 2 ,...., y n ) A 40 3.64 0.53
X and Y are independent B 40 4.25 0.44
then E(X - Y) = X Y
Method A is more than 0.4 second faster than method B. Is this true?
2X 2Y
Var( X - Y) = + Supposesignificance level is 5%.
m n
Null Hypothesis H 0 : X Y = 0 H 0 : A B -0.4 (One - side)
( X - Y) - X Y ( X - Y) - 0 x A = 3.64 x B = 4.25 A = 0.53 B = 0.44
Test Statistic : Z = =
2X 2Y 2X 2Y
+ +
m n m n
Significance level :
=0.05
Two - Sided
Z < / 2 or Z > / 2 rejected
1-=0.95
One - Sided
H 0 : X Y 0 Z < rejected -1.65 0
H 0 : X Y < 0 Z > rejected
13 14

5) Difference of Two Means with Unknown but common


Variances
Null Hypothesis H 0 : X Y = 0
Population X : N( X , X ) sampling ( x1 , x 2 ,...., x m )
Y : N( Y , Y ) ( y1 , y 2 ,...., y n ) ( X - Y ) - ( X Y ) ( X - Y ) - 0
Test Statistic : T = =
X and Y are independen t 1 1 1 1
X = Y = Sp + Sp +
m n m n
then E( X - Y) = X Y
Significan ce level :
m -1 n -1
E(S 2p ) = E ( S2X + S2Y ) = 2
m+ n-2 m+ n-2 Two - Sided
Var( X - Y) =
2 2
+ T < t / 2 ,n + m-2 or T > t / 2 ,n + m-2 rejected
m n
m -1 2 n -1 One - Sided
m -1 2 n -1 S2p = SX + S2Y
E( SX + 2
SY ) m+n-2 m+n-2 H 0 : X Y 0 T < t ,n + m-2 rejected
m+n-2 m+n-2 m -1 1 m
=
m -1
E (SX ) +
2 n -1 2
E (SY )
= ( xi x ) 2
m + n - 2 m 1 i =1
H 0 : X Y < 0 T > t ,n + m -2 rejected
m+n-2 m+n-2 n -1 1 n
=
m -1
X +
2 n -1
Y2
+ ( yi y ) 2
m + n - 2 n 1 i =1
m+n-2 m+n-2

Pooled Sample Variance 15 16


Ex.2 Damages to cars of types A and B. 2. 2 test for Goodness of Fit
Method n x s 2n (f1 , f 2 , ...., f r ) : Observed Frequencies
A 5 43.3 4.5 (e1 , e 2 , ...., e r ) : Theoretical Frequencies from Assumed Distribution
B 4 45.2 3.8 r
(ei f i ) 2
W =
Car A withstands the crash better than B. Is this true? i =1 ei
Suppose significance level is 5%. (Chi Square) Distribution with (f = r - 1) Degrees of Freedom as n
2

H0 : A B 0 if w < c1 , f ,
H 0 : A2 = B2 m=5 n=4 then assumed theoretical distribution is acceptable with the significance level
Significance Level 5% x A = 43.3 x B = 45.2 s 2A = 4.5 s 2B = 3.8
0.1
S2A = 4.5 S2B = 3.8
Chi Function CHIDIST(x,f)
0.08
DOF:5
0.06 DOF:10
DOF:20
0.04

0.02
ChiDist(x, f) 0
0 2 4 6 8 10 12 14 16 18 20

17 18

Ex.1 2 Test with unknown parameters


Type of Theoretical Expected Observ. if pi = pi (1 , 2 ,....., m ) includes m unknown parameters, then f = r - m - 1
Instructions Probability Freq. Freq.
pi ei fi
Ex.6.6
Transfer 0.31 62 72 No. of Storms Observ. Theor.
Indexing 0.18 36 30 per year Freq. fi Freq. ei (fi-ei)2 (fi-ei)2/ei
Branching 0.17 34 32 0 20 19.93915 0.00360 0.00020
Floating-Point 0.12 24 14 1 23 23.86656 0.75690 0.03170
Fixed-Point 0.07 14 22 2 15 14.28377 0.50410 0.03530
Shifting 0.04 8 10 3 6 5.69908 0.01000 0.00130
2
8
1.70541
4
7 . 90
Miscellaneous 0.11 22 20
Total 1 200 200 5 0 0.50604
66 66.00000 0.06850

c1-, f
k
P( x = k ) = e
k!

= P( x = k 1)
19 k 20
Ex.3 x
x 1 24.69
1 24.69 2 34.24
2 34.24 3 15.25
3 15.25 4 5.11
4 5.11 5 26.83
5 26.83 6 7.55
6 7.55 7 22.64
7 22.64 8 13.92
8 13.92 9 22.31
9 22.31 10 35.65
10 35.65 11 20.29
11 20.29 12 33.91
12 33.91 13 26.41
13 26.41 14 43.97
14 43.97 15 46.52
15 46.52 16 14.01
16 14.01 17 20.45
17 20.45 Norm.Dist(10, 23.784,10.052)=0.085147 18 22.93
Observ Normal
Log-Normal Theor.
Theor.
18 22.93 19 18.95
19 18.95 Norm.Dist(20, 23.784,10.052)=0.353304 20 30.63 Freq. fi F(x)
F(x) f(x)
f(x) Freq.
Freq.eiei (fi-ei)2/ei
(fi-ei)2/ei
20 30.63
Observ Normal Theor. 21 20.09 0 2 0.008988
1.7E-134 0.085147
0.026525 2.554 0.120
0.796 1.822427
21 20.09
Freq. fi F(x) f ( x)dx Freq. ei (fi-ei)2/ei
f(x) 22 16.76 10 8 0.085147
0.026525 0.268157
0.384579 8.045 1.084567
11.537 0.000
22 16.76 23 38.76
23 38.76 0 2 0.008988 0.085147 2.554 0.120 20 12 0.353304
0.411105 0.378549
0.369864 11.356 0.036
11.096 0.073664
24 18.36
24 18.36 10 8 0.085147 0.268157 8.045 0.000 25 12.21 30 6 0.731853
0.780968 0.214804
0.150273 6.444 0.031
4.508 0.493653
25 12.21 20 12 0.353304 0.378549 11.356 0.036 26 28.89 40 2 0.946657
0.931242 0.048791
0.04786 1.464 0.196
1.436 0.221704
26 28.89 30 6 0.731853 0.214804 6.444 0.031 27 24.74
27 24.74 50 0 0.995448
0.979102 0.004552
0.020898 0.137 0.137
0.627 0.626954
40 2 0.946657 0.048791 1.464 0.196 28 20.09
28 20.09
29 32.87
30 11 11 30.000 0.521
30.000 4.322968
29 32.87 50 0 0.995448 0.004552 0.137 0.137
30 14.48
30 14.48 30 1 1 30.000 0.521
21 30 713.51 22
30 713.51

3. Independence Test Ex.4 < (f ij


f i .f . j
)2 /
f i .f . j
>
Performance <Observed> N N
Performance is
Degree High Medium Low Total Performance Performance
B.S. 18 35 15 68 closely related to Degree High Medium Low Total
Degree High Medium Low Total
M.S. 12 17 3 32 the degree? B.S. 18 35 15 68
B.S. 0.2824 0.0037 0.6224 0.9084
Total 30 52 18 100 M.S. 12 17 3 32
Total 30 52 18 100 M.S. 0.6 0.0078 1.3225 1.9303
Total 0.8824 0.0115 1.9449 2.8387
X and Y are independent
p ij = P(X A i Y B j ) Contingency Table f i. f. j
<Estimated> m n ( f ij )2
= P(X A i ) P (Y B j ) = pi. p. j =
X
Y
B1 B2
Category 2
Bn Total f i. f. j f i. f. j N
f i. f. j
=
Theoretical Frequency A1 f11 f12 f1n f1. e ij = Np ij = N = i =1 j =1
A2 f21 f22 f2n f2.
N N N N
f f. j
e ij = Np ij = N i. = Performance
N N Category
Degree High Medium Low Total
1
Test
2
Am fm1 fm2 fmn fm. B.S. 20.4 35.36 12.24 68
f i. f. j Total f.1 f.2 f.n N M.S. 9.6 16.64 5.76 32
m n ( f ij eij ) 2 m n ( f ij )2 Total 30 52 18 100
W = = N
i =1 j =1 eij i =1 j =1
f i. f. j
N

23 24
Assignments (1) Assignments (2)
Prob. 1 Prob. 1
The average height of 15 years-old boys was 159.73cm and its standard deviation was 5.71cm in a country. The A sound engineer wishes to demonstrate that the frequency X of the sound emitted by one sound blaster is more than
average of 90 boys in a province was 160.90. Is there any difference in the average height of this province from the 5 Hz greater than the frequency Y by anther blaster. Independent samples yield the values =1128 Hz, =1121 Hz,
nationwide average ? Assume the significance level of 5%. =12, =10. Both sample size are 50. Is the engineers claim justified at the significance level of =0.01?

Prob. 2 Prob. 2
The table below presents how a sleeping pill increased the sleeping time for 10 patients. Was the drug effective? Test Two machine are used to fill juice containers that are nominally rated at one quart. The following data are recorded
for the significance level of both 1% and 5%. in quarts by measuring actual juice content in randomly selected containers:
Patient 1 2 3 4 5 6 7 8 9 10 Machine A: 1.02 1.01 1.02 1.03 1.00 1.01
Increase of Sleeping time 0.7 -1.1 -0.2 1.2 0.1 3.4 3.7 0.8 1.8 2.0 Machine B: 1.00 0.99 0.98 0.98 1.00 0.99
Prob. 3 Given that the container populations are normally distributed with equal variances, can it be concluded at the =0.01
level of significance that the machines give different quantities of juice on average?
Two workers produced 25 potteries: The sample variance of diameter was 0.0810mm and 0.1255mm, respectively.
Any difference in their skill? Evaluate the equality of variance with the significance level of 5%.
Prob. 3
Prob. 4 Airline B claims that its arrival times are superior to those of airline A on city-to-city flights common to both airlines.
To test the claim, eight routes are selected and a flight for each airline is randomly observed on each route as below:
The distribution of hardness of a mineral sampled from two mines is given as below. Any difference in their skill?
Evaluate the equality of variance with the significance level of 5%. Airline A: 2.41 6.50 3.29 1.22 2.59 2.81 5.35 1.78
Airline B: 2.30 5.86 3.71 1.10 2.34 2.24 5.00 1.95
Hardness 41 42 43 44 45 46 47 48
Assume that the differences comprise a random sample from a normal distribution. Is the claim of airline B justified
Number of mine 1 0 2 5 11 7 1 0 0 at =0.01 level of significance?
samples mine 2 2 4 4 5 4 4 1 1
25 26

Assignments (3)
Prob. 1
<Prob. 6.5 of the textbook>

Prob. 2
<Prob. 6.9 of the textbook>

Prob. 3
Electric motors are purchased from two manufactures, A and B. Two hundred motors are randomly selected and
subject to continuous use test. Depending the time to failure, each motors is placed into a category; 1 (less than
100 hours), 2(100 to 200 hours), 3(200 to 300), and 4(more than 300 hours). Table below gives the results. Is it
concluded at the =0.01 level of significance that longevity depends on the manufacture?

Manufacturer Longevity
1 2 3 4
A 8 34 42 20
B 9 50 28 9
Prob. 4
Complete Q.7 and Q.8 in Assignment (3): Comprehensive Check-Up.

27

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