Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
TESTING
.
x o
Z
/of the
n hypothesized mean in
and o is value
Ho
Z Z
or
Z Z
2
10
Ho: = 70
Ha: 70
Select = .05 arbitrarily (So Z 2 Z .025 1.96)
T.S.:
x
71.8 70
/ n
8.9 / 100
R.R.: Reject Ho if Z Z 2
2.02
or Z Z 2
12
13
Test on a Single :
Variance Known - Right-Sided Test: Example
Ho: = 70 or 70
Ha: > 70
= .05
x
2.02
T.S.: Z
/ n
Test on a Single :
Variance Known - Left-Sided Test
Suppose we wanted to test Ha: < 70;
then
Ho: = 70 or 70
Ha: < 70
= .05
x
Z
2.02
T.S.:
/ n
16
Test on a Single :
Variance Known - Left-Sided Test
R.R.: Reject Ho if Z < Z
Decision: We do not reject Ho since
Z(=2.02) not < Z.05(= -1.645)
Conclusion: No evidence that the true
mean is less than 70
Note: (- Z = -1.645)
17
19
Test on a Single :
2 Unknown
If is unknown, we use its estimate, s, from the
sample
x
t
The test statistic becomes
s/ n
Because of s this statistic is not
Z-distributed. It has a student-t distribution with
(n-1) degrees of freedom
x
~ t n1
s/ n
20
Test on a Single :
2 Unknown - Example
We wish to test a research (alternative)
hypothesis that the mean energy
consumption per home is less than 46
kilowatt-hours ( < 46)
The energy consumption, X, is ND
A sample of n = 12 homes gave x = 42
and s = 11.19 kilowatt-hours
21
Test on a Single :
Variance Unknown - Steps
Ho: = 46 or 40
Ha: < 46
= .05
T.S.:
x
42 46
t
1.16
s / n 11.9 / 12
not <
22
Test on a Single :
Variance Unknown - Steps
Conclusion: No evidence that the true
average energy expenditure is less than 46
kw-hr
Note: Because we are performing a
1-sided test (see Ha) all the error probability
is in one region (the left) of the distribution;
hence we use t , not t/2
23
Test on a Single :
Variance Unknown - Size of n
For the above t-test ( unknown) we may use
the Z-test as an approximation when n 30. This
is a consequence of the Central Limit Theorem
The T.S. for the Z-approximation is
where the
from the large sample size (n
Z s-value
25
8.9
71.8 1.96
T.S.: x Z 2
n
100
(70.06,72.54)
26
27
1. 1 and
2 are known
2
2
2
2
28
Test on ( 1 2) When
2
2
1 And 2 Are Known - 1
Consider a 2-sided test
Ho: 1 2 = do (do is a specified value)
Ha: 1 2 do
T.S.:
( x1 x2 ) d o
R.R.: Reject Ho if
(Note: do = ( 1 2)0
12
n1
22
n2
or
Z Z
Z Z
2
29
Test on ( 1 2) When
2
2
1 And 2 Are Known - 2
Recall that there can be 3 different Ha s and each
has a different R.R.
1. Ha: 1 2 do
R.R.: Reject Ho if
2. Ha: 1 2 > do
R.R.: Reject Ho if
3. Ha: 1 2 < do
R.R.: Reject Ho if
or
Z Z
Z Z
Z Z
Z Z
30
1 2 0
H a : 1 u 2 or u1 u 2 0
X
T .S . : Z
X 2 1 2 0
n1 n2
2
1
2
2
81 76 0
2
5* 2 3* 4
25
36
5.85
Z Z 0.025
Test on ( 1 2) When
2
2
1 And 2Are Known - Example
Work example 10.6, page 314
32
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
2
2
and ( 1 2 ) - 1
2
For unknown we
must use the sample estimates
1
and
s12
s22
When
2
, 2the common variance is
1 2
2; 2 2 2
1
2
We must use the sample estimate of 2 (i.e.
) 2
sp
This is computed as a pooled variance from the two
samples
33
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
2
2
and ( 1 2 ) - 2
S ( n1 1) S ( n2 1)
S
( n1 1) ( n2 1)
2
p
2
1
2
2
34
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
2
2
and ( 1 2 ) - 3
sp
1
n1
n12
t t ,n1 n2 2
2
35
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
2
2
and ( 1 2 ) - 4
P346
10.6
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
2
2
and ( 1 2 ) - 1
S12
n1
S 22
n2
38
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
and ( 12 22 ) - 2
The degree of freedom for this t-distribution
is not (n1+n22). It is (pronounced new),
where
( s / n1 s / n2 )
2
2
2
2
( s1 / n1 ) ( s2 / n2 )
n1 1
n2 1
2
1
2
2
39
Test on ( 1 2)
2
2
When 1 and 2 are Unknown
and ( 12 22 ) - 3
Consider a 2-sided test
Ho: 1 2 = do
Ha: 1 2 do
T.S.: t ( x1 x2 ) d o
S12
n1
S 22
n2
40
d do
t
Sd / n
43
Paired t-test:
Example - Data
See example 10.7, page 316
We want to test whether androgen level in
deer blood after 30 minutes of capture is
different from the level at time of capture
Data on 15 deers at time of capture (x2) and
30 minutes after capture (x1) are taken
(x2i x1i) = di are computed for i = 1 to 15
d 9.848 and sd = 18.474
44
Paired t-test:
Example - Test
H o: d = 0
H a: d 0
= .05
T.S.: t
d 0
9.848 0
2.06
sd n 18.474 / 15
R.R.: Reject Ho if
PAIRED T-Test
(example 2)
Q: Weight loss program
n=10 participants
X1
Starting
Weight
210
240
150
190
200
150
180
185
X2
Ending
Weight
200
180
155
200
150
140
170
168
Starting
Weight
210
240
150
190
200
150
180
185
X2
Ending
Weight
200
180
155
200
150
140
170
168
di
Weight
lost
10
60
-5
-10
50
10
10
17
x
Find d , find Sd, like solving
for
H0: d = 0
Ha: d 0
T.S. t=
d 0
Sd / n
, Sx
Test on / : Example
2
1
2
2
2
2
49
Test on / : Example
2
1
2
2
Ho: / 1 or
Ha: / 1 or
= .05
2
T.S.:
s1
Fo 2 3.84 / 4.54 0.85
s2
2
1
2
1
2
2
2
2
2
1
2
1
2
2
2
2
50
Test on / : Example
2
1
2
2
Test on / : Comments
2
1
2
2
F.95 ,10,12
1
F.05,12,10
52
.
.
53
p po
po qo / n
or
x npo
Z
npo qo
p po
po qo / n
R.R.: Reject Ho if Z Z or
2
Z Z
2
55
p 1 p 2 p1 p2
p1q1 p2q2
2
p 1 p 2
n1
n2
1 p 1 ) ~ ND
When samples are large ( p
A suitable T.S. is therefore
( p 1 p 2 ) ( p1 p2 )o
p1q1
n1
p2q2
n2
56
x1 x2
p
n1 n2
57
( p1 p2 ) ( p1 p2 )o
Z
1
1
p
q
(
)
n
n
R.R.: Reject H if
1 or 2
o
Z Z
Z Z
58
( n 1) S /
2
2
o
= .05
where
T.S.:
is
a specified value
2
(
n
1
)
S
/
R.R.: Reject H if
2
2
o or
,n1
2
2
2
2
1 2 ,n1
60
Test on 2: Comments
2 is always positive, so the left-tail critical
2
region is 1
2
2
2
1 .975 for = .05
2
2
.975 is the 2 value with area .975 to its right
This 2 test is for a single population
variance. For comparing 2 population
variances, we use the F-test
61
2
2
S /
S /
2
1
2
2
2
1
2
2
~ Fn1 1,n2 1
If we assume
12 ) as in
2
2(i.e.
21 2
2 1
Ho, Sthen
and2 can be used
1
F S2
as a test statistic2for this test
62
2
2
F F1 ,n1 1,n2 1
2
63
.
.
64
Test of Independence
0 lights
1 light
2 lights
3 lights
4 lights
Sums
Morning
20
65
64
159
Afternoon
12
20
75
72
187
Night
10
10
16
10
54
Sums
22
26
50
156
146
400
The table indicates the number of times a certain amount of traffic lights were stopped at (0,1,2,3,
or 4) by a vehicle on a workday within a small city. The data are for 400 vehicles. Let L = the
number of lights stopped at by a vehicle. The 2 factors (variables) are number of lights and time.
The question: Does the number of lights stopped at depend on the time.
Calculations: The above are the observed frequencies (Oi). Find the expected frequencies (Ei) for
each cell from Ei=ni*nj/n; e.g. For the first cell Ei = 22*159/400.
Now compare Ei and Oi using the Chi-square statistic as done in goodness of fit tests.
X
1.45 x 1.95
1.95 x 2.45
2.45 x 2.95
2.95 x 3.45
f i Oi
2
1
4
15
3.45 x 3.95
10
3.95 x 4.45
4.45 x 4.95
3
40
66
Calculation of pi
Calculate pi as follows:
P(1.45<x<1.95)
1.45
1.95
=P(
<Z<
) = 0.0125
67
f i Oi
pi
Ei
Oi Ei 2 / Ei
1.45 x 1.95
0.0125
0.5
7 8 .5 2 / 8 . 5
1.95 x 2.45
0.0525
2.1
2.45 x 2.95
5.9
2.95 x 3.45
15
10.3
15 10.3 2 / 10.3
3.45 x 3.95
10
10.7
10 10.7 2 / 10.7
3.95 x 4.45
7.0
8 10.5 2 / 10.5
4.45 x 4.95
3.5
3.05 2
40
H 0 : xi ~ ND 3.5; 2 0.72
H a : xi not ~ ND
T . S . : 2 Oi Ei 2 / Ei 3.05
2
2
D.R. : Reject H o if
k p 1
(k-p-1=4-2-1=1)
69