Testing of Hypothesis - Two Samples
Testing of Hypothesis - Two Samples
Testing of Hypothesis - Two Samples
(Significance Test)
TWO INDEPENDENT
UNIVARIATE
POPULATIONS
Sampling
In order to compare two groups (populations), we have to select
samples from both the groups. If the observations in one sample
are independent of those in the other, then those are
called independent samples.
Eg. Suppose we want to compare two drugs. We select a sample of
patients and randomly allocate them to the two drugs. These two
groups of patients (and also the observations coming from them)
will constitute independent samples since they were randomly
allocated to the two groups corresponding to the two drugs.
Significance test for difference
between population proportions
Notations:
• p1 (p2) : population proportion of success in the first
(second) group.
• n1 (n2) : sizes of random samples drawn from the first
(second) populations.
Assumptions :
• Independent random samples from the two groups.
• Large enough sample sizes so that in each sample there
are at least 5 success and 5 failures.
Hypotheses:
H 0 : p1 p 2 H 0 : p1 p 2 H 0 : p1 p 2
H 1 : p1 p 2 H 0 : p1 p 2 H 0 : p1 p 2
Test Statistic: difference between sample proportions
= pˆ pˆ
1 2
ˆ1 p
p ˆ2
z obs ~ N (0,1), under H 0
1 1
p (1 p )
ˆ ˆ
n1 n2
Critical Region :
x1 x 2 36 31 67
pˆ .549
n1 n 2 72 50 122
Example: contd.
z
pˆ1 pˆ 2 p1 p2
1 1
pˆ (1 pˆ )
n1 n2
.50 .62 0 1.31
1 1
.549 (1 .549)
72 50
Assumptions :
• Independent random samples from the two populations
(normal distributions) are drawn.
• n1 and n2 large (small)
Hypotheses:
H 0 : 1 2 H 0 : 1 2 H 0 : 1 2
H 1 : 1 2 H 0 : 1 2 H 0 : 1 2
Test Statistic: difference between sample means
= ˆ ˆ x x (unbiased estimators )
1 2 1 2
By CLT,
12 22
x1 x2 (~) N 1 2 ,
n1 n2
( x1 x2 ) ( 1 2 )
zobs ~ N (0,1), under H 0
12 22
n1 n2
Critical Region :
H 0 : 1 2
H 1 : 1 2
x1 x2
Z 0bs
12 22
n1 n2
Example : contd..
Reject H0 if Z0bs ≥ 1.645 at α = 0.05
Computations:
Since x =121 minutes, x2 =112 minutes,
1
σ1 = σ22 = 82 = 64 minutes and n1= n2 = 10, the value of the test
2
statistics is,
121 112
Z0 2.52
8 2
8 2
10
10
Conclusion: Since Z0 = 2.52 > 1.645, we reject H0: μ1 - μ2 = 0 at the 0.05
level of significance and conclude that adding the new ingredient to the
paint significantly reduces the drying time.
Significance test for difference
between population means
(population sd’s are unknown)
Small sample
Notations:
• μ1 (μ2) : population mean in the first (second) group.
•σ1 (σ2) : population sd in the first (second) group.
• n1 (n2) : sizes of random samples drawn from the first
(second) populations.
Assumptions :
• Independent random samples are drawn from normal
distributions
• σ1 = σ2 = σ (say)
Hypotheses:
H 0 : 1 2 H 0 : 1 2 H 0 : 1 2
H 1 : 1 2 H 0 : 1 2 H 0 : 1 2
Test Statistic: difference between sample means
1 n2
ˆ 2 s2'
n2 1 i 1
( x 2i x 2 ) 2
Pooled estimator of 2 is
( n 1) s '2
( n 1) s '2
s '2 1 1 2 2
n1 n2 2
2 1 1
x1 x2 ~ N 1 2 , ( )
n1 n2
( n1 n2 2) s '2
~ 2
n1 n2 2
2
( x1 x2 ) ( 1 2 )
tobs ~ t n1 n2 2 , under H 0
1 1
s '
n1 n2
Critical Region :
Men : 72 69 98 66 85 76 79 80 77
Women : 81 67 90 78 81 80 76
Hypothesis:
H0 : µf = µm H1: µf ≠ µm
Solution:
Women Men
Mean 79 78
Variance 47.33333333 90
Observations 7 9
Pooled Variance 71.71428571
Hypothesized Mean
Difference 0
df 14
t Stat 0.234318967
P(T<=t) one-tail 0.409064729
t Critical one-tail 1.761310115
P(T<=t) two-tail 0.818129458
t Critical two-tail 2.144786681
BIVARIATE POPULATION
Sampling
Assumptions :
• samples are drawn from normal distributions.
PAIRED t-TEST
Define the differences between each pair of observations as
Dj = x1j - x2j, j = 1,2, … , n.
Hypotheses:
H0 : D 0 H0 : D 0 H0 : D 0
H1 : D 0 H 0 : D 0 H 0 : D 0
PAIRED t-TEST
Test Statistic
1
1
d di
n
s
2
D
n 1
( di d ) 2
Critical Region :
Before after
Mean 177.125 168.25
Variance 857.8392857 485.6429
Observations 8 8
Pearson Correlation 0.981101026
Hypothesized Mean Difference 0
df 7
t Stat 2.861003291
P(T<=t) one-tail 0.012151345
t Critical one-tail 1.894578604
P(T<=t) two-tail 0.024302691
t Critical two-tail 2.364624251