Lecture No.3 Inference For Two Population Mean The paired t test

advertisement
Lecture No.3
Inference For Two Population Mean
The paired t test for two population means
(critical-value approach)
Assumptions
1.paird samples
2.normal populations or large samples
Step 1: the null hypothesis is
H O : 1  2
and the alternative
hypothesis is
H a : 1  2 (two  tailed ) H O : 1   2 (left tailed )
H O : 1  2 ( right tailed )
Step 2 : decide on the significance level, 
Step 3: compute the value of the test statistic
T
Where
d

d
n
d
Sd / n
where d = paired difference
Step 4: the critical value (s) are
 t / 2 (two  tailed ) or
1
 t (left  tailed )
or
t (right  tailed ) with degrees of freedom (df= n-1)
2
Step 5 : if the value of the t test statistics falls in the rejection
region, reject HO ; otherwise, fail to reject H0
Step 6 : interpret the results of the hypothesis test.
The paired t test for two population means
(p-value approach)
Assumptions
1.independent samples
2.normal populations or large sample
Step 1: the null hypothesis is
H O : 1  2
and the alternative
hypothesis is
H a : 1  2 (two  tailed ) H O : 1   2 (left tailed )
H O : 1  2 ( right tailed )
Step 2 : decide on the significance level, 
Step 3: compute the value of the test statistic
T
Where
d

d
n
d
Sd / n
where d = paired difference
3
Step 4: the value of t-statistics has df= n-1. Use a table to
estimate the p-value or obtain it exactly by using technology.
4
Step 5 : if the P- value less than or equal  , ( p  value   ), reject
HO ; otherwise, fail to reject H0
Step 6 : interpret the results of the hypothesis test.
Example : the gas mileages of 10 randomly selected
cars, both with and without a new gasoline additive, are
displayed in the second and third columns in table
below.
At the 5% significance level, do the data provide
sufficient evidence to conclude that, on average, the
gasoline additive improves gas mileage?
Car
Gas mileage with
additive
Gas mileage without
additive
1
25.7
24.9
Paired
difference
0.8
2
20.0
18.8
1.2
3
28.4
27.7
0.7
5
4
13.7
13.0
0.7
5
18.8
17.0
1.8
6
12.5
11.3
1.2
7
28.4
27.8
0.6
8
8.1
8.2
-0.1
9
23.1
23.1
0
10
10.4
9.9
0.5
Solution:
Step 1: state the null hypothesis and the alternative hypothesis
1
denote the mean gas mileage when the additive is used
2
denote the mean gas mileage when the additive is not
used
H O : 1  2
H a : 1   2
( mean gas mileage with additive is not greater)
(mean gas mileage with additive is greater)
Note that the hypothesis test is right-tailed because a
greater than sign (>) appears in the alternative hypothesis.
Step 2 : decide on the significance level, 
  0.05
6
Step 3: compute the value of the test statistic
d 7.4

d

 0.74
n
Sd 
d
T
2
 ( d ) 2 / n
n 1
10
8.36  (7.4) 2 / 10

 0.566
10  1
d
0.74

 4.134
Sd / n 0.566 / 10
Critical-value approach
Step 4: the critical value (s) are
t (right  tailed ) with degrees of freedom (df= n-1)
7
From a table the critical values wit (df = 10-1=9) are
t t0.05 1.833
Step 5 : if the value of the t test statistics falls in the rejection
region, reject HO ; otherwise, fail to reject H0
From step 3 the value of the test statistics is t =4.134, which
fall in the rejection region, thus we do reject HO .
Step 6 : interpret the results of the hypothesis test.
at 5% significance level, the data provide sufficient
evidence to conclude that, the gasoline additive
improves gas mileage
p-value approach
Step 4: from a table(with df = 10-1) the p-value ( in right tailed)
is the probability of observing a value of t of 4.134 or greater,
we find that p < 0.005 ( using technology, we obtain p = .0013)
Step 5: p value < 0.05) so we reject HO
at 5% significance level, the data provide sufficient
evidence to conclude that, the gasoline additive
improves gas mileage
use SPSS program
use the SPSS program to perform the hypothesis in
previous example
STEP 1: Enter The Data As Shown Below
8
Step 3 : the result shown below
T-Test
Paired Samples Statistics
Pair
1
ADDITI
WITH.ADD
Mean
18.9100
18.1700
N
Std. Deviation
7.47209
7.42848
10
10
9
Std. Error
Mean
2.36288
2.34909
Pa ired Sa mples Correlations
N
Pair 1
ADDITI & W ITH.ADD
10
Correlation
.997
Sig.
.000
Pa ired Sa mples Test
Pair 1
ADDITI - W ITH.ADD
Paired Differences
Mean
St d. Deviat ion
.7400
.56608
Example:
10
t
4.134
df
9
Sig. (2-tailed)
.003
11
W    Ri  6
W    Ri  99
W  min( W  , W  )  6
12
From wilcoxon signed ranks table we fined the critical value at N=14 and
 0.05 WL  21 . WU  84 , so W = 6 < 21 so we reject null hypothesis
Note : if n > 15 we can use normal distribution for
testing wilcoxon signed ranks where the Z statistic as follow:
Z
W  W
W
Where
W 
n(n 1)
4
,
W 
n(n  1)(2n  1)
24
And we reject H0 if absolute value of Zcal > critical value Ztab
Example using SPSS program
13
Wilcoxon Signed Ranks Test
14
Ra nks
N
3a
9b
0c
12
DRUG_B - DRUG_A Negative Ranks
Positive Ranks
Ties
Total
Mean Rank
2.33
7.89
a. DRUG_B < DRUG_A
b. DRUG_B > DRUG_A
c. DRUG_A = DRUG_B
Test Statisticsb
Z
As ymp. Sig. (2-tailed)
DRUG_B DRUG_A
-2.511a
.012
a. Based on negative ranks .
b. Wilcoxon Signed Ranks Test
15
Sum of Ranks
7.00
71.00
SPSS output
Wilcoxon Signed Ranks Test
Ra nks
N
Cases per 100,000
population, 1993 Cases per 100,000
population, 1992
Negative Ranks
Positive Ranks
Ties
Total
56 a
89 b
62 c
207
Mean Rank
79.35
69.01
Sum of Ranks
4443.50
6141.50
a. Cases per 100,000 populat ion, 1993 < Cases per 100,000 population, 1992
b. Cases per 100,000 populat ion, 1993 > Cases per 100,000 population, 1992
c. Cases per 100,000 populat ion, 1992 = Cases per 100,000 population, 1993
Test Statisticsb
Z
As ymp. Sig. (2-tailed)
Cases per
100,000
population,
1993 - Cases
per 100,000
population,
1992
-1.678a
.093
a. Based on negative ranks.
b. Wilcoxon Signed Ranks Test
16
17
Wilcoxon Signed Ranks Test
Ra nks
N
11 a
1b
0c
12
Pronet halol - Placebo Negative Ranks
Positive Ranks
Ties
Total
a. Pronet halol < Placebo
b. Pronet halol > Placebo
c. Placebo = Pronethalol
18
Mean Rank
6.09
11.00
Sum of Ranks
67.00
11.00
Test Statisticsb
Z
As ymp. Sig. (2-tailed)
Pronethalol Placebo
-2.201a
.028
a. Based on positive ranks.
b. Wilcoxon Signed Ranks Test
19
Download