You are on page 1of 13

Two-Sample

Test of Hypothesis
Hypothesis Testing:
Two Population Means
 The test statistic is the standard normal
(Z) if :
– The population standard deviations are known, or
– The population standard deviations are unknown
but the two samples both contain at least 30
observation.
X1  X 2
Z 
2 2
s1 s2

n1 n2
cont..
 Note : The Z test statistic
– No assumption about the shape of either
population is required
– The samples are from independent population
(that are not related in any way)
– Variance of distribution of differences in sample
means :
2 2 2
s1 s2
s X1 X 2  
n1 n2
cont..
 The test statistic is the t distribution if one
or both the samples contain fewer than 30
observation
– Both populations must follow the normal
distribution
– The population must have equal standard
deviation
– The samples are independent
Cont..
 Pooled Sample Variance:
( n  1) s 2
 ( n  1) s 2

sp 
2 1 1 2 2
n1  n2  2
 Test Statistic: X1  X 2
t 
 1 1 
s 
2
 
 n1
p
n2 

X1  X 2
t
 ( n1  1) s12  ( n2  1) s2 2  1 1 
 
 n1  n2  2  n  n 
  1 2 
cont..
 Dependent samples are samples that are
paired observation or related in some
fashion.
d
t 
sd / n
– where d is the average of the differences d   d
n
– sd is the standard deviation of the differences
– n is the number of pairs (differences)

( d  d ) 2 (  d ) 2
d2 
sd  or sd  n
n 1 n 1
Contoh

 Dosen berpendapat bahwa nilai ujian kls A


lebih rendah dari pada kls B. Untuk
membuktikan pendapat tersebut, diambil
sampel masing-masing 50 orang. Hasilnya
rata-rata kelas A = 60 dengan simpangan
baku = 15 dan rata-rata kelas B = 70
dengan simpangan baku = 20. Ujilah
pendapat tersebut dengan  = 5%
Contoh
Mhs UTS UAS Dengan  = 0,05 ujilah
A 64 54 apakah ada perbedaan
B 62 77 nilai UTS dan UAS ?
C 45 50
D 66 54
E 70 89
F 62 56
G 80 72
H 54 65
I 65 76
t-Test: Paired Two Sample for Means

UTS UAS
Mean 63.11111 65.88888889
Variance 94.86111 178.8611111
Observations 9 9
Pearson Correlation 0.509675
Hypothesized Mean Difference 0
df 8
t Stat -0.70193
P(T<=t) one-tail 0.251314
t Critical one-tail 1.859548
P(T<=t) two-tail 0.502629
t Critical two-tail 2.306004
Contoh
Berikut adalah data gaji karyawan perusahaan A dan
perusahaan B

Observasi Persh A Persh B


1 155 154
2 228 207
3 141 147
4 162 157
5 211 196
6 164 150
7 184 170
8 172 165
Apakah ada perbedaan yang signifikan ? Gunakan  = 5%
t-test for two independent groups
Group 1 Group 2
177.125 168.250 mean
29.289 22.037 std. dev.
8 8 n
14 df
8.875 difference (Group 1 - Group 2)
671.741 pooled variance
12.959 standard error of difference
0.000 hypothesized difference
0.68 t
.2523 p-value (one-tail)
.5046 p-value (two-tail)
Hypothesis Testing:
Two Population Proportions
pˆ 1  pˆ 2
Z
Pc (1  Pc ) Pc (1  Pc )

n1 n2
 Pcis the weighted mean of the two sample
proportions, computed by:
pˆ 1  pˆ 2
Z X1  X 2
1 1 Pc 
Pc (1  Pc )   n1  n2
 n1 n2 
Contoh
 Pimpinan perusahaan berpendapat bahwa
konsumen lebih menyukai produk A dari
pada B. Untuk membuktikan pendapat tsb
tim marketing melakukan penelitian
dengan mengambil sampel 200 orang.
Hasilnya 70 orang menyukai produk A dan
65 orang menyukai produk B. Ujilah
dengan taraf sifnifikasi 5%

You might also like