Hypothesis Testing SUNU WIBIRAMA Basic Probability and Statistics Department of Electrical Engineering and Information Technology Faculty of Engineering, Universitas Gadjah Mada
CONTENTS • • • •
8.1 Introduc-on 8.2 Formula-ng Hypotheses 8.3 Types of errors for a Hypothesis Test 8.4 Rejec-on Regions
8.1 Introduc-on • In this chapter we will study another method of inference-‐making: hypothesis tes-ng. • Making a decision about a parameter value • Consis>ng of two kinds: – Correla>onal hypothesis tes>ng – Compara>ve hypothesis tes>ng Problem Popula>on Sample Conclusion
Hypothesis
8.2 Formula-ng Hypothesis 1. State the rela>onship between two or more variables 2. Declara>on sentence 3. Constructed systema>cally 4. The truth should be tested empirically 5. Use sta-s-cal tes-ng to derive decision (z-‐distribu>on, t-‐distribu>on, chi-‐square, F, etc)
Important Steps! 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal method / tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Important Steps (1) 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal method / tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Null hypothesis (H0 ) • H0 states that:
– Two or more variables are not related each other – No difference between two or more variable Examples: There is no rela>onship between rain fall and electricity connec>on Monthly income is not related with preference of buying gadget There is no difference of GPA between ac>vists and non ac>vists
Alterna-ve hypothesis (Ha or H1 ) • Ha states that:
– Two or more variables are closely related – there is difference between the 1st variable and the 2nd variable Examples: Rain fall and electricity connec>on are closely related Monthly income and preference of buying gadget are closely related There is significance difference of GPA between ac>vists and non ac>vists
Important Steps (2) 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal method / tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Significant Level • Define the limit of confidence level for your H0 • Noted by alpha (α) symbol • α = 1% , α = 5%, α = 10% , etc……
Important Steps (3) 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Sta-s-cal Tes-ng • Big Sample (n ≥ 30) Statistiksampling distribution ! Parameterpopulation Z= ! sampling distribution
• Small Sample (n < 30) Statistiksampling distribution ! Parameterpopulation t= ! sampling distribution
Implementa-on (see previous lectures) • Tes>ng with only one mean:
! !x = n
x!µ Zh = !x
• Comparing means of two sampling distribu>on x1 ! x2 Zh = 2 2 !1 ! 2 + n n 1
2
Standard deviation of sampling distribution or Standard Error
One-‐tail tests • Right Tail
H0 : μ = μ 0 Ha : μ > μ 0
• Leb Tail
H0 : μ = μ 0 Ha : μ < μ 0
Reject H0 : Zh ≥ Zα
th ≥ tα,n-1 Accept H0 : Zh < Zα th < tα,n-1 Reject H0 : Zh ≤ -Zα
th ≤ -tα,n-1 Accept H0 : Zh > -Zα th > -tα,n-1
Two Tail Tests H0 : μ = μ 0 Ha : μ ≠ μ 0
Reject H0 : Zh ≥ Z0.5α Zh ≤ -Z0.5α
th ≥ t0.5α,n-1 th ≤ -t0.5α,n-1 Accept H0 : -Z0.5α < Zh < Z0.5α -t0.5α < Zh < t0.5α
Important Steps (4) 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal method / tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Decision Making Conclusion
Hypothesis
Accept H0
Reject H0
H0 true
Correct Decision Probability 1-‐α
Error Type I Probability α
H0 false
Error Type II Probability β
Correct Decision Probability 1-‐β
Probability of error type I occurred significant level Example: α = 5% à probability that we make error type I : 5%
(95% our decision tend to be correct)
Important Steps (5) 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal method / tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Final Decision • Should be stated clearly • Answering the problem Examples: It was true that no rela>onship between rain fall and electricity connec>on Monthly income is proven not related with preference of buying gadget
LET SEE THE EXAMPLE
Contoh 1 Surat kabar “X” menyatakan bahwa mahasiswa JTETI UGM rata-‐ rata sebulan mengeluarkan pengeluaran sebulan Rp.400.000,-‐. Seorang dosen mensinyalir bahwa pengeluaran rata-‐rata mahasiswa JTETI UGM tersebut terlalu besar.Untuk itu ia mengambil sampel 25 mahasiswa untuk mengujinya. a. Dari hasil sampel, ternyata diperoleh rata-‐rata Rp. 390.000,-‐ dengan standard deviasi Rp.25.000,-‐. Jika pengujian menggunakan taraf signifikansi 5%, benarkah pernyataan surat kabar X tersebut? b. Jika dosen tersebut mengambil sampel sebanyak 100
Important Steps! 1. Define Null Hypothesis (H0) and Alterna>ve Hypothesis (Ha) 2. Define significant level (α) 3. Define sta>s>cal method / tes>ng criteria (using Z-‐Distribu>on, t-‐Distribu>on, Chi-‐Square, F, etc.) 4. Decision making: Accept or reject hypothesis 5. Declare the final conclusion
Contoh 2 • Sebuah perusahaan listrik mendapat keluhan konsumen yang meragukan besarnya tegangan listrik perumahan tepat 220 V. Guna menanggapi keluhan tersebut, perusahaan tersebut melakukan peneli>an terhadap 100 rumah. Ternyata tegangan rata-‐rata sebesar 215 V dengan penyimpangan standard sebesar 5 V. Dengan menggunakan taraf nyata 10%, apakah keraguan konsumen terhadap isi besaran tegangan itu benar?