Professional Documents
Culture Documents
Statistics 3
Statistics 3
CHAPTER OUTLINE
9-1 Hypothesis Testing
9-1.1 Statistical Hypotheses
Tests of Hypotheses
for a Single Sample
1
Hipotez Testleri Hipotez Testleri
• Uygulamada çoğu zaman örneklem istatistikleri • Elbette ki üretim prosesinde yapılan bir değişiklikten sonra
yardımıyla ana kütle parametreleri hakkında bir karara elde edilen ölçüm sonuçları ile önceki ölçüm sonuçları
varmaya da çalışılmaktadır. Meselâ arasında farklılıklar çıkacaktır.
• Bir makine üzerinde yapılan bir ayarlamanın kusurlu mamul • Bu farklılık iki sebepten kaynaklanmış olabilir.
oranını düşürüp düşürmediği,
• Birincisi rassal sebeplerden kaynaklanan farklılıklar,
• yeni geliştirilen bir ilacın hastalığın tedavisinde etkin olup
olmadığı,
ikincisi ise yapılan ayarlamadan kaynaklanan farklılıklardır.
• Üretim prosesinde yapılan bir değişikliğin mamul kalitesini • Üretim prosesinde yapılan değişikliğin kaliteyi yükselttiğine
yükseltip yükseltmediği, karar verebilmek için bu farkın rassal sebeplerden ileri
• makine ayarında yapılan bir değişikliğin varyansı değiştirip gelmeyecek kadar önemli bir fark olması gerekir.
değiştirmediği veya • Bu farkın belirlenebilmesi için bazı istatistik testlerden
• geliştirilen bir öğretim sisteminin eskisine göre bir farklılık faydalanılır.
gösterip göstermediği gibi konularda karar verilmesi gibi.
• İşte bu testlere hipotez testleri adı verilir.
Sıfır hipotezi (H0) ve alternatif hipotez (H1) Sıfır hipotezi ve alternatif hipotez
• İstatistik hipotezlerin testinde bir hipotezle onun karşıtı • Bir problemin çözümüne başlamadan önce
olan diğer bir hipotezden hangisinin örneklemden elde oluşturulan hipoteze göre, ana kütlenin bilinen
edilen sonuçla daha iyi bağdaştığı araştırılmaktadır. değeri ile örnekten elde edilen değeri arasında
Karşılaştırılan iki hipotezden birine ‘‘Sıfır Hipotezi (H0)’’ “önemli bir fark olmadığı’’ kabul edilir, ki buna H0
diğerine ‘‘Alternatif Hipotez (H1 veya Ha)’’ adı verilir. hipotezi denir. Söz konusu iki değer arasında
• Hipotezlerin daima örnekleme yapılmadan önce ‘‘önemli bir farkın olduğunu” ileri süren diğer
oluşturulması gerekir. hipotez ise H1 alternatif hipotez olur.
• Çünkü örnekleme yapıldıktan sonra bu sonuçlara göre • H0 hipotezi daima bir kütlenin parametresinin belli bir
mutlaka reddedilecek veya kabul edilecek hipotezler değere eşitliği şeklinde oluşturulurken, alternatif hipotez
oluşturulabilir. parametrenin bu değerden büyük, bu değerden küçük
• Bu durum bilimsel araştırmadaki objektiflik kriterine ya da bu değerden farklı olduğu şeklinde teşkil edilir.
aykırıdır. Alternatif hipotezin yönüne göre hipotez testi tek taraflı
ya da çift taraflı olarak yapılır.
2
Sıfır hipotezi ve alternatif hipotez Sıfır hipotezi ve alternatif hipotez
• Örnek: bir işletmede geçmiş kayıtlara göre belli bir • Üretim mühendisi mamulün üretim süresinin 25 dakikadan
mamulün üretim süresinin 25 dk olduğu bildiriliyor. daha az sürede yapıldığını düşünüyorsa, bu durumda
Bu departmanda çalışan üretim sorumlusu mamulün hipotezler şöyle oluşturulur.
daha uzun sürede üretildiğini düşünmektedir. Bu H0: µ = 25 dk. ( Mamulün üretim süresi 25 dakikadır.)
düşünceyi test etmek için hipotezler şöyle oluşturulur. H1: µ < 25 dk. ( Mamulün üretim süresi 25 dk’dan azdır.)
H0: µ = 25 dk. ( Mamulün üretim süresi 25 dakikadır.)
Böyle bir durumda yine hipotez testi tek taraflı olarak
H1: µ > 25 dk. ( Mamulün üretim süresi 25 dk’dan yapılacaktır. Test işlemi için dağılımın sol tarafı dikkate
fazladır.) alınacaktır. Çünkü alternatif hipotezin yönü küçüklük
Burada hipotez tek taraflıdır ( alternatif hipotez tek şeklindedir.
yönlüdür.), Test işlemi dağılımın sağ tarafı dikkate
alınarak yapılmalıdır.
H0: Masumdur
3
Hipotez testlerinde yapılan hatalar Hipotez testi ile ilgili bazı kavramlar
• : anlam düzeyi (I. Tip hata riski)
• Yukarıdaki tablo incelendiğinde hipotez testlerinde
• 1- : Güven düzeyi (Doğru hipotezin kabul olasılığı)
yapılan iki hatanın neler olduğu anlaşılmaktadır.
• β: II. Tip hata riski ( yanlış hipotezin kabul olasılığı)
• Ho Hipotezi doğru olduğu halde reddedilirse bir hata • 1- β: Testin gücü ( Yanlış hipotezin reddi olasılığı)
işlenmiş olur ki buna 1. tip hata ya da () hatası adı • Aşağıdaki şekilde yukarıdaki ifadelerin dağılım üzerindeki
verilir. Bu hataya üretici riski de denmektedir. yerleri gösterilmiştir. Şekil hipotezlerin aşağıdaki gibi olması
• = P(H0 red / H0 doğru) durumuna göre dizayn edilmiştir.
• H0: µ = µa
• H1: µ = µb
4
3. Adım: Kritik değerlerin belirlenmesi: 4. Adım: İstatistiksel karşılaştırmanın yapılması:
Standart Normal H0 RED H0 RED
.500 Dağılım Tablosu
- .025
.475 Z .05 .06 .07 /2 = .025
/2 = .025
1.6 .4505 .4515 .4525
/2 = .025
/2 = .025 0
1.7 .4599 .4608 .4616 Zhesap=3
-Ztablo= -1.96 Ztablo= 1.96
-1.96 0 1.96 Z 1.8 .4678 .4686 .4693
5. Adım: Karar verme ve yorumlama:
1.9 .4744 .4750 .4756
Zhesap değeri H0 RED bölgesine düştüğü için H0 hipotezi reddedilir, yani
vidaları boy ortalaması 100 mm’den farklıdır, makinanın ayarı
bozulmuştur.
H1 : 70 X x X 66 70 4
Z 2
sx s 12 / 6 2 𝐗− µ 𝟒𝟗𝟎 − 𝟓𝟎𝟎
𝐙𝐡 = = = −𝟑. 𝟑
𝛔𝐱 𝟑𝟎
n 𝟏𝟎
III. 0.01 için z tablo değeri 2.58 IV. |zhes|<|ztab| H0 red edilemez.
5
2- SASKİ yöneticileri, Sakarya halkının ortalama aylık su tüketimini en az 20 litre
Hipotez H0 : µ = 20 litre
Zh ( 1.5) > Zk ( 1.65) olduğundan H0 hipotezi reddedilemez. H1 : µ > 20 litre
n = 1000
Yorum: %95 güven düzeyinde ilaç ağrıyı en geç 60 dakika içinde geçirmektedir. 𝑋 = 22 litre
µ = 20 litre
s = 8 litre
n > 30 olduğu için normal dağılıma sahiptir. Z değeri tablodan % 99 güven düzeyi için 2.33
bulunur. Bu bilgilerden sonra 2 aşama ile çözüme ulaşılır.
𝐬 𝟖
𝐬𝐱 = = = 𝟎. 𝟐𝟓𝟑
𝒏 𝟏𝟎𝟎𝟎
1.5 1.65 𝑿− µ 𝟐𝟐 − 𝟐𝟎
𝐙𝐡 = = = 𝟕. 𝟗
𝐬𝐱 𝟎. 𝟐𝟓𝟑
2. Aşama: Hesaplanan Zh değeri Zk değeri ile karşılaştırılır.
Zh ( 7.9) > Zk ( 2.33) oldugundan H0 hipotezi reddedilir ve alternatif hipotez kabul edilir.
Yorum: Kişilerin aylık su tüketimi 20 litreden fazladır.
3- Bir çikolata firması 500 gramlık paketler halinde üretim yapmayı planlamaktadır. Üretimin
Değerlendirme Soruları Değerlendirme Soruları
planlandığı gibi gerçekleşip gerçekleşmediğini kontrol etmek için rassal olarak seçilen 100
paketin ortalama ağırlığı 495 gram ve standart sapma da 20 gram olarak bulunmuştur.
Üretimin planlandığı gibi gerçekleşip gerçekleşmediğini α = 0.05 anlam düzeyini (% 95
güven düzeyi) kullanarak karar veriniz.
Çözüm:
H1 : µ ≠ 500 gram
n = 100
𝑋 = 495 gram
µ = 500 gram
s = 20 gram
n > 30 olduğu için normal dağılıma sahiptir. Z değeri tablodan % 95 güven düzeyi için 1.96
bulunur. Bu bilgilerden sonra 2 aşama ile çözüme ulaşılır.
𝐬 𝟐𝟎
𝐬𝐱 = = =𝟐
𝒏 𝟏𝟎𝟎
𝑿− µ 𝟒𝟗𝟓 − 𝟓𝟎𝟎
𝐙𝐡 = = = −𝟐. 𝟓
𝐬𝐱 𝟐
6
ORTALAMALAR ARASI FARKLARLA İki Ortalama Farkı İçin Test İstatistiği
İLGİLİ HİPOTEZ TESTLERİ Ortalamalar arası farklarla ilgili hipotez testlerine ait test
istatistiği
H 0 : 1 2
Çift Kuyruk Testi biliniyor ise:
H1 : 1 2
( X 1 X 2 ) ( 1 2 ) ( X1 X 2 )
H 0 : 1 2 Z
Sol Kuyruk Testi X X 12 22
H1 : 1 2
1 2
n1 n2
7
9-3 Tests on the Mean of a Normal
n s 2 n2 s22 80(15) 2 95(18) 2 Distribution, Variance Unknown
s2 1 1 286.94
n1 n2 80 90
9-3.1 Hypothesis Tests on the Mean
( X1 X 2 ) (135 130)
Zh 1.95 One-Sample t-Test
2 1
s ( )
1 1 1
286.94
n1 n2 80 95
Figure 9-10
Normal probability
plot of the
coefficient of
restitution data
from Example 9-6.
8
9-3 Tests on the Mean of a Normal
Distribution, Variance Unknown
16
Example 9-6
16
9-3 Tests on the Mean of a Normal 9-3 Tests on the Mean of a Normal
Distribution, Variance Unknown Distribution, Variance Unknown
Example 9-6 Example 9-6
9
9-4 Hypothesis Tests on the Variance and 9-4 Hypothesis Tests on the Variance and
Standard Deviation of a Normal Distribution Standard Deviation of a Normal Distribution
9-4.1 Hypothesis Test on the Variance 9-4.1 Hypothesis Test on the Variance
9-4 Hypothesis Tests on the Variance and 9-4 Hypothesis Tests on the Variance and
Standard Deviation of a Normal Distribution Standard Deviation of a Normal Distribution
9-4.1 Hypothesis Test on the Variance 9-4.1 Hypothesis Test on the Variance
10
9-4 Hypothesis Tests on the Variance and 9-4 Hypothesis Tests on the Variance and
Standard Deviation of a Normal Distribution Standard Deviation of a Normal Distribution
Example 9-8 Example 9-8
11
ORANLARLA İLGİLİ HİPOTEZ TESTİ Oranlar arası farklarla ilgili hipotez testlerine ait test
H 0 : P P0
Çift Kuyruk Testi istatistiği
H1 : P P0
( p1 p2 ) ( P1 P2 )
Sol Kuyruk H 0 : P P0 Zh
P1 (1 P1 ) P2 (1 P2 )
Testi H1 : P P0
n1 n2
H 0 : P P0
Sağ Kuyruk Testi Anakütle oranları bilinmediğinde bunun yerine örnek
H1 : P P0 oranları kullanılabilir. Sıfır hipotezinin doğru olabileceği
Örnekten hesaplanan oran p ile gösterilirse oranlarla ilgili test varsayımıyla hareket edildiğinden test istatistiği
istatistiği; formülündeki P1-P2 farkı sıfır kabul edilir. Test istatistiği
aşağıdaki gibidir:
pP pP
Z ( p1 p2 )
p P(1 P) Zh
p1 (1 p1 ) p2 (1 p2 )
n
n1 n2
Örnek
Sıfır hipotezi örneklerin aynı anakütleden alındığını Bir video kaset kiralayıcısı macera filmi kiralamanın yöredeki
belirttiği için p1 ve p2 değerleri birbiriyle homojendir. erkek ve kadınlar itibariyle farklılık gösterip göstermediğini
Aşağıdaki ortak varyans hesaplanır. merak etmektedir. Söz konusu şahıs belli bir zaman dönemi
içersinde dükkanına gelen 60 erkekten 51’nin ve 40
n1 p1 n2 p2
p kadından 20’sinin macera filmi kiraladığını tespit etmiştir. Bu
n1 n2 verilere göre yöredeki erkeklerin kadınlardan daha fazla
macera filmi kiraladığını % 5 önem seviyesinde söyleyebilir
( p1 p2 )
Zh misiniz?
p1 0.85 p2 0.50
1 1
p (1 p )( ) H 0 : P1 P2
n1 n2 60(0.85) 40(0.50)
H1 : P1 P2 Ztab1.645 p 0.71
60 40
0.85 050
Zh 3.78 H0 RED
1 1
69 0.71(1 0.71)( )
60 40
Hipotez testlerinde yapılan hatalar Hipotez testi ile ilgili bazı kavramlar
• : anlam düzeyi (I. Tip hata riski)
• Yukarıdaki tablo incelendiğinde hipotez testlerinde
• 1- : Güven düzeyi (Doğru hipotezin kabul olasılığı)
yapılan iki hatanın neler olduğu anlaşılmaktadır.
• β: II. Tip hata riski ( yanlış hipotezin kabul olasılığı)
• Ho Hipotezi doğru olduğu halde reddedilirse bir hata • 1- β: Testin gücü ( Yanlış hipotezin reddi olasılığı)
işlenmiş olur ki buna 1. tip hata ya da () hatası adı • Aşağıdaki şekilde yukarıdaki ifadelerin dağılım üzerindeki
verilir. Bu hataya üretici riski de denmektedir. yerleri gösterilmiştir. Şekil hipotezlerin aşağıdaki gibi olması
• = P(H0 red / H0 doğru) durumuna göre dizayn edilmiştir.
• H0: µ = µa
• Diğer bir hata ise H0 yanlış olduğu halde kabul
edilmesidir. Buna da 2. tip hata ya da (β) hatası adı • H1: µ = µb
verilir. Bu hataya tüketici riski de denmektedir.
• β= P(H0 kabul/ H0 yanlış)
12
Hipotez testlerinde yapılan hatalar Hipotez testlerinde yapılan
hatalar
• Hipotez testlerinin daha güvenilir olması için
Bir Mahkeme Jürisi Hipotez Testi
hataların asgariye indirilmesi gerekir.
Gerçek Durum Gerçek Durum • Ancak bu o kadar kolay değildir.
Karar Masum Suçlu Karar H0 Doğru H0 Yanlış • Çünkü , I.Tip hatayı azaltmaya çalışırken II.Tip
Masum Doğru HATA H0 red 1-
II. Tip hata büyüyecektir.
Hata ()
edilemez • Yani, belli bir örnek hacmi için bu hatalardan biri
Testin
HATA Doğru
I. Tip Gücü azaltılırken diğeri artırılmış olacak.
Suçlu H0 red Hata () (1 - )
H0: Masumdur
13
Hipotez testlerinde yapılan hatalar AQL, LTPD, Consumer’s Risk (α) &
Producer’s Risk (β)
• AQL is the small % of defects that
Bir Mahkeme Jürisi Hipotez Testi consumers are willing to accept;
order of 1-2%
• LTPD is the upper limit of the
Gerçek Durum Gerçek Durum percentage of defective items
consumers are willing to tolerate
Karar Masum Suçlu Karar H0 Doğru H0 Yanlış
• Consumer’s Risk (α) is the chance
of accepting a lot that contains a
H0 red II. Tip
Masum Doğru HATA 1- greater number of defects than the
edilemez Hata () LTPD limit; Type II error
• Producer’s risk (β) is the chance a
Testin
I. Tip Gücü
lot containing an acceptable quality
Suçlu HATA Doğru H0 red Hata () (1 - ) level will be rejected; Type I error
H0: Masumdur
is the probability that a good lot will be rejected by is the probability a bad lot is accepted by the consumer
the consumer even though the lot really has a fraction when the lot really has a fraction defective p2
defective p1
Lot accepted given that lot
Lot is rejected given that process • That is, P
P has unacceptable quality level
• That is, has an acceptable quality level
14
α - Criticism β - Criticism
• The type I error probability is a measure of risk,
• Because the type II error probability β is a
specifically, the risk of concluding that the null
hypothesis is false when it really is not. function of both the sample size and the extent
• So, the value of α should be chosen to reflect the
to which the null hypothesis H0 is false, it is
consequences (economic, social, etc.) of incorrectly customary to think of the decision to accept H0
rejecting the null hypothesis. as a weak conclusion unless we know that β
• Smaller values of α would reflect more serious is acceptably small.
consequences and larger values of α would be • Therefore, rather than saying we “accept H0,”
consistent with less severe consequences. we prefer the terminology “fail to reject H0.”
• This is often hard to do, so what has evolved in much
• Failing to reject H0 implies that we have not
of scientific and engineering practice is to use the
value α = 0.05 in most situations unless information is found sufficient evidence to reject H0, that is, to
available that this is an inappropriate choice. make a strong statement.
β - Criticism β - Criticism
• Failing to reject H0 does not necessarily mean • If strong evidence is found to the contrary, the
that there is a high probability that H0 is true. defendant is declared to be guilty (we reject the
• It may simply mean that more data are required null hypothesis).
to reach a strong conclusion. • If evidence is insufficient, the defendant is
• This can have important implications for the declared to be not guilty.
formulation of hypotheses. • This is not the same as proving the defendant
• A useful analog exists between hypothesis innocent and so, like failing to reject the null
testing and a jury trial. hypothesis, it is a weak conclusion.
• In a trial, the defendant is assumed innocent • An important concept that we will use is the
(this is like assuming the null hypothesis to be power of a statistical test.
true).
15
9-1 Hypothesis Testing 9-1 Hypothesis Testing
9-1.2 Tests of Statistical Hypotheses 9-1.2 Tests of Statistical Hypotheses
16
9-1 Hypothesis Testing 9-1 Hypothesis Testing
17
’yı Etkileyen Faktörler:
& Ters yönlü ilişki içindedir
• Populasyon parametresinin gerçek değeri
Hipotezdeki parametre değeri ile parametrenin
Her iki hatayı da aynı
anda azaltamazsınız! gerçek değeri arasındaki fark arttıkça da
artar.
• Önem derecesi -
azalırken artar.
• Populasyon standart sapması -
arttıkça artar.
• Örnek hacmi - n
n azaldıkça artar
9-2 Tests on the Mean of a Normal 9-2 Tests on the Mean of a Normal
Distribution, Variance Known Distribution, Variance Known
18
TYPE II ERROR AND CHOICE OF SAMPLE SIZE Finding the Probability of Type II Error β
19
Using Operating Characteristic Curves
TYPE II ERROR AND CHOICE OF SAMPLE SIZE 9-4 Hypothesis Tests on the Variance and
Standard Deviation of a Normal Distribution
Example 9-8
20
9-5 Tests on a Population Proportion
9-5.1 Large-Sample Tests on a Proportion
Many engineering decision problems include hypothesis testing
about p.
TYPE II ERROR AND CHOICE OF SAMPLE SIZE TYPE II ERROR AND CHOICE OF
SAMPLE SIZE
21
Contingency Table Tests
22