University of California, Los Angeles Department of Statistics. Hypothesis testing

Similar documents
Hypothesis testing for µ:

Common Large/Small Sample Tests 1/55

Sample Size Determination (Two or More Samples)

LESSON 20: HYPOTHESIS TESTING

1036: Probability & Statistics

Recall the study where we estimated the difference between mean systolic blood pressure levels of users of oral contraceptives and non-users, x - y.

MOST PEOPLE WOULD RATHER LIVE WITH A PROBLEM THEY CAN'T SOLVE, THAN ACCEPT A SOLUTION THEY CAN'T UNDERSTAND.

Chapter 22: What is a Test of Significance?

Overview. p 2. Chapter 9. Pooled Estimate of. q = 1 p. Notation for Two Proportions. Inferences about Two Proportions. Assumptions

Agreement of CI and HT. Lecture 13 - Tests of Proportions. Example - Waiting Times

A quick activity - Central Limit Theorem and Proportions. Lecture 21: Testing Proportions. Results from the GSS. Statistics and the General Population

Final Examination Solutions 17/6/2010

HYPOTHESIS TESTS FOR ONE POPULATION MEAN WORKSHEET MTH 1210, FALL 2018

BIOS 4110: Introduction to Biostatistics. Breheny. Lab #9

STA Learning Objectives. Population Proportions. Module 10 Comparing Two Proportions. Upon completing this module, you should be able to:

Class 23. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

Data Analysis and Statistical Methods Statistics 651

Chapter 4 Tests of Hypothesis

Introduction to Econometrics (3 rd Updated Edition) Solutions to Odd- Numbered End- of- Chapter Exercises: Chapter 3

This chapter focuses on two experimental designs that are crucial to comparative studies: (1) independent samples and (2) matched pair samples.

Comparing Two Populations. Topic 15 - Two Sample Inference I. Comparing Two Means. Comparing Two Pop Means. Background Reading

Interval Estimation (Confidence Interval = C.I.): An interval estimate of some population parameter is an interval of the form (, ),

Statistics 20: Final Exam Solutions Summer Session 2007

Chapter 5: Hypothesis testing

Chapter 13, Part A Analysis of Variance and Experimental Design

Chapter 13: Tests of Hypothesis Section 13.1 Introduction

Power and Type II Error

Stat 200 -Testing Summary Page 1

Inferential Statistics. Inference Process. Inferential Statistics and Probability a Holistic Approach. Inference Process.

2 1. The r.s., of size n2, from population 2 will be. 2 and 2. 2) The two populations are independent. This implies that all of the n1 n2

April 18, 2017 CONFIDENCE INTERVALS AND HYPOTHESIS TESTING, UNDERGRADUATE MATH 526 STYLE

Mathacle. PSet Stats, Concepts In Statistics Level Number Name: Date:

STATISTICAL INFERENCE

Frequentist Inference

7-1. Chapter 4. Part I. Sampling Distributions and Confidence Intervals

1 Inferential Methods for Correlation and Regression Analysis

MA238 Assignment 4 Solutions (part a)

- E < p. ˆ p q ˆ E = q ˆ = 1 - p ˆ = sample proportion of x failures in a sample size of n. where. x n sample proportion. population proportion

A Confidence Interval for μ

1 Constructing and Interpreting a Confidence Interval

1 Constructing and Interpreting a Confidence Interval

Stat 319 Theory of Statistics (2) Exercises

Chapter 6 Sampling Distributions

Comparing your lab results with the others by one-way ANOVA

Lecture 5. Materials Covered: Chapter 6 Suggested Exercises: 6.7, 6.9, 6.17, 6.20, 6.21, 6.41, 6.49, 6.52, 6.53, 6.62, 6.63.

Section 9.2. Tests About a Population Proportion 12/17/2014. Carrying Out a Significance Test H A N T. Parameters & Hypothesis

This is an introductory course in Analysis of Variance and Design of Experiments.

Because it tests for differences between multiple pairs of means in one test, it is called an omnibus test.

Math 152. Rumbos Fall Solutions to Review Problems for Exam #2. Number of Heads Frequency

If, for instance, we were required to test whether the population mean μ could be equal to a certain value μ

Tests of Hypotheses Based on a Single Sample (Devore Chapter Eight)

Expectation and Variance of a random variable

Chapter 8: Estimating with Confidence

Chapter 22. Comparing Two Proportions. Copyright 2010, 2007, 2004 Pearson Education, Inc.

Statistical Hypothesis A statistical hypothesis is an assertion or conjecture concerning one or more populations.

FACULTY OF MATHEMATICAL STUDIES MATHEMATICS FOR PART I ENGINEERING. Lectures

Notes on Hypothesis Testing, Type I and Type II Errors

GG313 GEOLOGICAL DATA ANALYSIS

Hypothesis Testing (2) Barrow, Statistics for Economics, Accounting and Business Studies, 4 th edition Pearson Education Limited 2006

Samples from Normal Populations with Known Variances

Chapter 1 (Definitions)

Successful HE applicants. Information sheet A Number of applicants. Gender Applicants Accepts Applicants Accepts. Age. Domicile

Topic 9: Sampling Distributions of Estimators

Statistics. Chapter 10 Two-Sample Tests. Copyright 2013 Pearson Education, Inc. publishing as Prentice Hall. Chap 10-1

Math 140 Introductory Statistics

Chapter 22. Comparing Two Proportions. Copyright 2010 Pearson Education, Inc.

Class 27. Daniel B. Rowe, Ph.D. Department of Mathematics, Statistics, and Computer Science. Marquette University MATH 1700

(7 One- and Two-Sample Estimation Problem )

Chapter two: Hypothesis testing

A statistical method to determine sample size to estimate characteristic value of soil parameters

Chapter 23: Inferences About Means

MATH/STAT 352: Lecture 15

6 Sample Size Calculations

Econ 325 Notes on Point Estimator and Confidence Interval 1 By Hiro Kasahara

Lecture 5: Parametric Hypothesis Testing: Comparing Means. GENOME 560, Spring 2016 Doug Fowler, GS

Instructor: Judith Canner Spring 2010 CONFIDENCE INTERVALS How do we make inferences about the population parameters?

( θ. sup θ Θ f X (x θ) = L. sup Pr (Λ (X) < c) = α. x : Λ (x) = sup θ H 0. sup θ Θ f X (x θ) = ) < c. NH : θ 1 = θ 2 against AH : θ 1 θ 2

Properties and Hypothesis Testing

z is the upper tail critical value from the normal distribution

Continuous Data that can take on any real number (time/length) based on sample data. Categorical data can only be named or categorised

PSYCHOLOGICAL RESEARCH (PYC 304-C) Lecture 9

Topic 9: Sampling Distributions of Estimators

(6) Fundamental Sampling Distribution and Data Discription

ST 305: Exam 3 ( ) = P(A)P(B A) ( ) = P(A) + P(B) ( ) = 1 P( A) ( ) = P(A) P(B) σ X 2 = σ a+bx. σ ˆp. σ X +Y. σ X Y. σ X. σ Y. σ n.

SOLUTIONS y n. n 1 = 605, y 1 = 351. y1. p y n. n 2 = 195, y 2 = 41. y p H 0 : p 1 = p 2 vs. H 1 : p 1 p 2.

STAC51: Categorical data Analysis

University of California, Los Angeles Department of Statistics. Simple regression analysis

Statistical Inference About Means and Proportions With Two Populations

5. A formulae page and two tables are provided at the end of Part A of the examination PART A

Chapter 20. Comparing Two Proportions. BPS - 5th Ed. Chapter 20 1

Topic 9: Sampling Distributions of Estimators

Statistical inference: example 1. Inferential Statistics

1 Review of Probability & Statistics

Topic 18: Composite Hypotheses

Mathematical Notation Math Introduction to Applied Statistics

MIT : Quantitative Reasoning and Statistical Methods for Planning I

Multiple Comparisons Examples STAT 314

Confidence Intervals รศ.ดร. อน นต ผลเพ ม Assoc.Prof. Anan Phonphoem, Ph.D. Intelligent Wireless Network Group (IWING Lab)

Data Analysis and Statistical Methods Statistics 651

Announcements. Unit 5: Inference for Categorical Data Lecture 1: Inference for a single proportion

Transcription:

Uiversity of Califoria, Los Ageles Departmet of Statistics Statistics 100B Elemets of a hypothesis test: Hypothesis testig Istructor: Nicolas Christou 1. Null hypothesis, H 0 (claim about µ, p, σ 2, µ 1 µ 2, etc. It ca be,, =). 2. Alterative hypothesis, H a (>, <, ). 3. Test statistic. 4. Sigificace level α. Hypothesis testig for µ: H 0 : µ = µ 0 H a : µ > µ 0, µ < µ 0, µ µ 0 (use oly oe of these!) Whe σ is kow: Test statistic Z = X µ σ Whe σ is ukow: Test statistic t = X µ s If σ is kow: Reject H 0 if Z falls i the rejectio regio. The rejectio regio is based o the sigificace level α we choose. If σ is ukow: Reject H 0 if t falls i the rejectio regio. The rejectio regio is based o the sigificace level α we choose ad the degrees of freedom 1. The p value of a test. It is the probability of seeig the test statistic or a more extreme value (extreme is towards the directio of the alterative). If p value < α the H 0 is rejected. This is aother way of testig a hypothesis (it should always agree with testig usig Z or t). 1

Hypothesis Test Whe σ Is Kow: H 0 : µ = µ 0 Hypothesis Test For Populatio Mea µ Alterative Hypothesis H a Reject H 0 If µ < µ 0 Z < Z α µ > µ 0 Z > Z α µ µ 0 Z < Z α/2 or Z > Z α/2 Z = X µ 0 σ/ Hypothesis Test Whe σ Is Not Kow: H 0 : µ = µ 0 Alterative Hypothesis H a Reject H 0 If µ < µ 0 t < t α; 1 µ > µ 0 t > t α; 1 µ µ 0 t < t α/2; 1 or t > t α/2; 1 t = X µ 0 s/ Hypothesis Test For Proportio: H 0 : p = p 0 Alterative Hypothesis H a Reject H 0 If p < p 0 Z < Z α p > p 0 Z > Z α p p 0 Z < Z α/2 or Z > Z α/2 Z = ˆp p 0 p 0 (1 p 0 ) 2

Hypothesis testig - examples Example 1 A maufacturer of chocolates claims that the mea weight of a certai box of chocolates is 368 grams. The stadard deviatio of the box s weight is kow to be σ = 10 grams. If a sample of 49 boxes has sample mea x = 364 grams, test the hypothesis that the mea weight of the boxes is less tha 368 grams. Use α = 0.05 level of sigificace. Solutio: 1. H 0 : µ = 368 H a : µ < 368 2. We compute the test statistic z: z = x µ σ = 364 368 10 49 z = 2.8 3. We fid the rejectio regio. Here we use sigificace level α = 0.05, therefore the rejectio regio is whe z < 1.645. 4. Coclusio: Sice z = 2.8 < 1.645 we reject H 0. Compute the p value of the test: p value = P ( X < 364) = P (Z < 2.8) = 0.0026. Rule: If p value < α the H 0 is rejected. Agai, usig the p value we reject H 0. Example 2 A large retailer wats to determie whether the mea icome of families livig whithi 2 miles of a proposed buildig site exceeds $24400. What ca we coclude at the 0.05 level of sigificace if the sample mea icome of 60 families is x = $24524? Use σ = $763. Solutio: 1. H 0 : µ = 24400 H a : µ > 24400 2. We compute the test statistic z: z = x µ σ = 24524 24400 763 z = 1.26 60 3. We fid the rejectio regio. Here we use sigificace level α = 0.05, therefore the rejectio regio is whe z > 1.645. 4. Coclusio: Sice z = 1.26 does ot fall i the R.R. we do ot reject H 0. 3

Example 3 It is claimed that the mea mileage of a certai type of vehicle is 35 miles per gallo of gasolie with populatio stadard deviatio σ = 5 miles. What ca be cocluded usig α = 0.01 about the claim if a radom sample of 49 such vehicles has sample mea x = 36 miles? Solutio: 1. H 0 : µ = 35 H a : µ 35 2. We compute the test statistic z: z = x µ σ = 36 35 5 49 z = 1.4 3. We fid the rejectio regio. Here we use sigificace level α = 0.01, but because of a two-sided test we have two rejectio regios. They are z < 2.575 or z > 2.575. 4. Coclusio: Sice z = 1.4 does ot fall i ay of the two rejectio regios we do ot reject H 0. Whe we have a two-sided test the p value is computed as follows: p value = 2P ( X > 36) = 2P (Z > 1.4) = 2(1 0.9192) = 0.1616. Agai, usig the p value H 0 is ot rejected. Example 4 A maufacturer claims that 20% of the public preferred her product. A sample of 100 persos is take to check her claim. It is foud that 8 of these 100 persos preferred her product. a. Fid the p-value of the test (use a two-tailed test). b. Usig the 0.05 level of sigificace test her claim. Solutio: We test the followig hypothesis: H 0 : p = 0.20 H a : p 0.20 We compute the test statistic z: Z = ˆp p 0 p 0(1 p 0) = Therefore the p value is: 0.08 0.20 0.20(1 0.20) 100 = 3.0. p value = 2P (ˆp < 0.08) = 2P (Z < 3.0) = 2(0.0013) = 0.0026. We reject H 0 because p value= 0.0026 < 0.05. 4

Hypothesis testig - t distributio Example 1 A tire maufacturer hopes that their ewly desiged tires will allow a car travelig at 60 mph to come to a complete stop withi a average of 125 feet after the brakes are applied. They will adopt the ew tires uless there is strog evidece that the tires do ot meet this objective. The distaces (i feet) for 9 stops o a test track were 129, 128, 130, 132, 135, 123, 125, 128, ad 130. These data have x = 128.89, s = 3.55. Test a appropriate hypothesis to coclude whether the compay should adopt the ew tires. Use α = 0.05. Solutio: 1. H 0 : µ = 125 H a : µ > 125 2. We compute the test statistic t: t = x µ s = 128.89 125 t = 3.29. 3.55 9 3. We fid the rejectio regio. Here we use sigificace level α = 0.05 with 1 = 9 1 = 8 degrees of freedom. Therefore the rejectio regio is whe t > 1.860. 4. Coclusio: Sice t = 3.29 falls i ay the rejectio regio we reject H 0. The p value is: p value= P ( X > 128.89) = P (t > 3.29). From the t table we ca say that the 0.005 < p value < 0.01 Agai, usig the p value H 0 is rejected. Example 2 (from Mathematical Statistics ad Data Aalysis), by J. Rice, 2d Editio. I a study doe at the Natioal Istitute of Sciece ad Techology (Steel et al. 1980), asbestos fibers o filters were couted as part of a project to develop measuremet stadards for asbestos cocetratio. Asbestos dissolved i water was spread o a filter, ad puches of 3-mm diameter were take from the filter ad mouted o a trasmissio electro microscope. A operator couted the umber of fibers i each of 23 grid squares, yieldig the followig couts: 31 29 19 18 31 28 34 27 34 30 16 18 26 27 27 18 24 22 28 24 21 17 24 Assume ormal distributio. These data have x = 24.91, s = 5.48. Usig α = 0.05 test the followig hypothesis: H 0 : µ = 18 H a : µ 18 Solutio: We compute the test statistic t: t = x µ s = 24.91 18 t = 6.05 5.48 23 We fid the rejectio regio. Here we use sigificace level α = 0.05 with 1 = 23 1 = 22 degrees of freedom. Therefore the rejectio regio is whe t < 2.074 or t > 2.074. Coclusio: Sice t = 6.05 falls i oe of the rejectio regios we reject H 0. Compute the p value of the test: This is a two-sided test therefore the p value is p value= 2P ( X > 24.91) = 2P (t > 6.05). From the t table we ca oly say that p value is less that 0.01. 5

More examples - Hypothesis testig Example 1 A experimeter has prepared a drug dosage level that he claims will iduce sleep for at least 80% of those people sufferig from isomia. After examiig the dosage, we feel that his claims regardig the efectiveess of the dosage are iflated. I a attempt to disprove his claim, we admiister his prescribed dosage to 20 isomiacs, ad we observe X, the umber havig sleep iduced by the drug dose. We wish to test the hypothesis H 0 : p = 0.8 agaist the alterative H a : p < 0.8. Assume the rejectio regio X 12 is used. a. Fid the type I error α. b. Fid the type II error β if the true p = 0.6. c. Fid the type II error β if the true p = 0.4. Example 2 For a certai cadidate s political poll = 15 voters are sampled. Assume that this sample is take from a ifiite populatio of voters. We wish to test H 0 : p = 0.5 agaist the alterative H a : p < 0.5. The test statistic is X, which is the umber of voters amog the 15 sampled favorig this cadidate. a. Calculate the probability of a type I error α if we select the rejectio regio to be RR = {x 2}. b. Is our test good i protectig us from cocludig that this cadidate is a wier if, i fact, he will lose? Suppose that he really will wi 30% of the vote (p = 0.30). What is the probability of a type II error β that the sample will erroeously lead us to coclude that H 0 is true? 6

Compariso betwee cofidece itervals ad a two-tailed hypothesis test Two dice are rolled ad the sum X of the two umbers that occured is recorded. The probability distributio of X is as follows: X 2 3 4 5 6 7 8 9 10 11 12 P (X) 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36 This distributio has mea µ = 7 ad stadard deviatio σ = 2.42. We take 100 samples of size = 50 each from this distributio ad compute for each sample the sample mea x. Preted ow that we oly kow that σ = 2.42, ad that µ is ukow. We are goig to use these 100 sample meas to costruct 100 95% cofidece itervals for the true populatio mea µ, ad to test usig level of sigificace α = 0.05 100 times the hypothesis: H 0 : µ = 7 H a : µ 7 The results are as follows: Sample x 95% C.I. for µ Is µ = 7 icluded? z = x µ 0 σ/ Reject H 0? 1 6.9 6.23 µ 7.57 YES -0.29 NO 2 6.3 5.63 µ 6.97 NO -2.05 YES 3 6.58 5.91 µ 7.25 YES -1.23 NO 4 6.54 5.87 µ 7.21 YES -1.34 NO 5 6.7 6.03 µ 7.37 YES -0.88 NO 6 6.58 5.91 µ 7.25 YES -1.23 NO 7 7.2 6.53 µ 7.87 YES 0.58 NO 8 7.62 6.95 µ 8.29 YES 1.81 NO 9 6.94 6.27 µ 7.61 YES -0.18 NO 10 7.36 6.69 µ 8.03 YES 1.05 NO 11 7.06 6.39 µ 7.73 YES 0.18 NO 12 7.08 6.41 µ 7.75 YES 0.23 NO 13 7.42 6.75 µ 8.09 YES 1.23 NO 14 7.42 6.75 µ 8.09 YES 1.23 NO 15 6.8 6.13 µ 7.47 YES -0.58 NO 16 6.94 6.27 µ 7.61 YES -0.18 NO 17 7.2 6.53 µ 7.87 YES 0.58 NO 18 6.7 6.03 µ 7.37 YES -0.88 NO 19 7.1 6.43 µ 7.77 YES 0.29 NO 20 7.04 6.37 µ 7.71 YES 0.12 NO 21 6.98 6.31 µ 7.65 YES -0.06 NO 22 7.18 6.51 µ 7.85 YES 0.53 NO 23 6.8 6.13 µ 7.47 YES -0.58 NO 24 6.94 6.27 µ 7.61 YES -0.18 NO 25 8.1 7.43 µ 8.77 NO 3.21 YES 26 7 6.33 µ 7.67 YES 0.00 NO 27 7.06 6.39 µ 7.73 YES 0.18 NO 28 6.82 6.15 µ 7.49 YES -0.53 NO 29 6.96 6.29 µ 7.63 YES -0.12 NO 30 7.46 6.79 µ 8.13 YES 1.34 NO 31 7.04 6.37 µ 7.71 YES 0.12 NO 32 7.06 6.39 µ 7.73 YES 0.18 NO 33 7.06 6.39 µ 7.73 YES 0.18 NO 34 6.8 6.13 µ 7.47 YES -0.58 NO 35 7.12 6.45 µ 7.79 YES 0.35 NO 36 7.18 6.51 µ 7.85 YES 0.53 NO 37 7.08 6.41 µ 7.75 YES 0.23 NO 38 7.24 6.57 µ 7.91 YES 0.70 NO 39 6.82 6.15 µ 7.49 YES -0.53 NO 40 7.26 6.59 µ 7.93 YES 0.76 NO 41 7.34 6.67 µ 8.01 YES 0.99 NO 42 6.62 5.95 µ 7.29 YES -1.11 NO 43 7.1 6.43 µ 7.77 YES 0.29 NO 44 6.98 6.31 µ 7.65 YES -0.06 NO 45 6.98 6.31 µ 7.65 YES -0.06 NO 46 7.06 6.39 µ 7.73 YES 0.18 NO 47 7.14 6.47 µ 7.81 YES 0.41 NO 48 7.5 6.83 µ 8.17 YES 1.46 NO 49 7.08 6.41 µ 7.75 YES 0.23 NO 50 7.32 6.65 µ 7.99 YES 0.94 NO 7

Sample x 95%C.I.forµ Is µ = 7 icluded? z = x µ 0 σ/ Reject H 0? 51 6.54 5.87 µ 7.21 YES -1.34 NO 52 7.14 6.47 µ 7.81 YES 0.41 NO 53 6.64 5.97 µ 7.31 YES -1.05 NO 54 7.46 6.79 µ 8.13 YES 1.34 NO 55 7.34 6.67 µ 8.01 YES 0.99 NO 56 7.28 6.61 µ 7.95 YES 0.82 NO 57 6.56 5.89 µ 7.23 YES -1.29 NO 58 7.72 7.05 µ 8.39 NO 2.10 YES 59 6.66 5.99 µ 7.33 YES -0.99 NO 60 6.8 6.13 µ 7.47 YES -0.58 NO 61 7.08 6.41 µ 7.75 YES 0.23 NO 62 6.58 5.91 µ 7.25 YES -1.23 NO 63 7.3 6.63 µ 7.97 YES 0.88 NO 64 7.1 6.43 µ 7.77 YES 0.29 NO 65 6.68 6.01 µ 7.35 YES -0.94 NO 66 6.98 6.31 µ 7.65 YES -0.06 NO 67 6.94 6.27 µ 7.61 YES -0.18 NO 68 6.78 6.11 µ 7.45 YES -0.64 NO 69 7.2 6.53 µ 7.87 YES 0.58 NO 70 6.9 6.23 µ 7.57 YES -0.29 NO 71 6.42 5.75 µ 7.09 YES -1.69 NO 72 6.48 5.81 µ 7.15 YES -1.52 NO 73 7.12 6.45 µ 7.79 YES 0.35 NO 74 6.9 6.23 µ 7.57 YES -0.29 NO 75 7.24 6.57 µ 7.91 YES 0.70 NO 76 6.6 5.93 µ 7.27 YES -1.17 NO 77 7.28 6.61 µ 7.95 YES 0.82 NO 78 7.18 6.51 µ 7.85 YES 0.53 NO 79 6.76 6.09 µ 7.43 YES -0.70 NO 80 7.06 6.39 µ 7.73 YES 0.18 NO 81 7 6.33 µ 7.67 YES 0.00 NO 82 7.08 6.41 µ 7.75 YES 0.23 NO 83 7.18 6.51 µ 7.85 YES 0.53 NO 84 7.26 6.59 µ 7.93 YES 0.76 NO 85 6.88 6.21 µ 7.55 YES -0.35 NO 86 6.28 5.61 µ 6.95 NO -2.10 YES 87 7.06 6.39 µ 7.73 YES 0.18 NO 88 6.66 5.99 µ 7.33 YES -0.99 NO 89 7.18 6.51 µ 7.85 YES 0.53 NO 90 6.86 6.19 µ 7.53 YES -0.41 NO 91 6.96 6.29 µ 7.63 YES -0.12 NO 92 7.26 6.59 µ 7.93 YES 0.76 NO 93 6.68 6.01 µ 7.35 YES -0.94 NO 94 6.76 6.09 µ 7.43 YES -0.70 NO 95 7.3 6.63 µ 7.97 YES 0.88 NO 96 7.04 6.37 µ 7.71 YES 0.12 NO 97 7.34 6.67 µ 8.01 YES 0.99 NO 98 6.72 6.05 µ 7.39 YES -0.82 NO 99 6.64 5.97 µ 7.31 YES -1.05 NO 100 7.3 6.63 µ 7.97 YES 0.88 NO 8

Hypothesis Testig - Type I ad Type II error ACTUAL SITUATION H 0 IS TRUE H 0 IS NOT TRUE DO NOT REJECT Correct Decisio Type II error STATISTICAL H 0 1 α β DECISION REJECT Type I Error Correct Decisio H 0 α 1 β (Power) 9

Type II error (β) ad the power of the test (1 β) Example: A maufacturer of tires claims that the mea lifetime of these tires is 25000 miles. A radom sample of 100 tires will be selected, ad assume that the populatio stadard deviatio is 3500 miles. Calculate the probability of a Type II error (β) ad the power of the test (1 β) if the true populatio mea is 23500 miles usig: a. α = 0.05 b. α = 0.01 Solutio: a. α = 0.05. We are testig the hypothesis H 0 : µ = 25000 H a : µ < 25000 We fid first the values of X for which H0 is rejected. H 0 is rejected whe Z < 1.645. Or x µ σ < 1.645 X 25000 < 1.645 3500 100 Therefore X < 25000 1.645 3500 100 X < 24424.25 If the sample of size = 100 gives a value of X less tha 24424.25 the H0 s rejected. How do we compute the Type II error β? β = P (falsely acceptig H 0 ) = P ( X > 24424.25, whe µ = 23500) ( ) 24424.25 23500 = P Z > = P (Z > 2.64) = 1 0.9959 β = 0.0041. 3500 100 Therefore, the power of the test is 1 β = 0.9959. b. α = 0.01 We reject H 0 if Z < 2.325 or x µ s < 1.645 or X < 24186.25. β = P (falsely acceptig H 0 ) = P ( X > 24186.25, whe µ = 23500) ( ) 24186.25 23500 = P Z > = P (Z > 1.96) = 1 0.9750 β = 0.025. 3500 100 Therefore, the power of the test is 1 β = 0.9750. 10

Sample size determiatio Type I ad Type II errors are give A maufacturer of tires claims that the mea lifetime of these tires is at least 25000 miles whe the productio process is workig properly. Based upo past experiece, the stadard deviatio of the lifetime of the tires is 3500 miles. The productio maager will stop the productio if there is evidece that the mea lifetime of the tires is below 25000 miles. a. If the productio maager wishes to have 80% power of detectig a shift i the lifetime mea of the tires from 25000 to 24000 miles ad if he is willig to take a 5% risk of committig a Type I error, what sample size must be selected? b. If the productio maager wishes to have 80% power of detectig a shift i the lifetime mea of the tires from 25000 to 23000 miles ad if he is willig to take a 5% risk of committig a Type I error, what sample size must be selected? 11

Power of a test whe H a : µ < µ 0 Suppose that we wat to determie whether or ot a cereal box packagig process is i cotrol. The process is i cotrol if the mea weight of a box is at least 368 grams. Therefore we would be iterested i testig whether the mea weight is less tha 368 grams. The two hypotheses are formulated as below: H 0 : µ 368 H a : µ < 368 Let s assume that that the stadard deviatio of the fillig process is kow to be σ = 15 grams ad that the weight of the box follows the ormal distributio. To test this hypothesis a sample of = 25 boxes of cereal is to be selected. Our goal here is to fid the power of the test for differet true values of µ whe we are willig to take a risk of Type I error α = 0.05. I other words we wat to compute the power of the test whe there is a shift from µ = 368 grams to µ a, whe µ a < 368. The table below gives the power of the test for differet values of µ a. µ a Power (1 β) 352 0.9999 353 0.9996 354 0.9987 355 0.9964 356 0.9906 357 0.9783 358 0.9545 359 0.9115 360 0.8461 361 0.7549 362 0.6368 363 0.5080 364 0.3783 365 0.2578 366 0.1635 367 0.0951 368 0.0500 This is how the power was computed for this example: 1 β =P(reject H 0 whe H 0 is ot true). I our example we will reject H 0 (coclude that µ < µ 0 where µ 0 is the value of µ uder the ull hypothesis) if z < z α x µ0 σ < z α x < µ 0 z α σ. For these values of x we reject H 0. Now the power is the probability of fidig a value of x i the above rage whe the true mea is µ a. σ This is 1 β = P ( x < µ 0 z α µ = µ a ) = P (z < µ 0 z α σ µ a σ ). 12

Power of a test whe H a : µ > µ 0 Suppose that we wat to determie whether or ot a cereal box packagig process is i cotrol. The process is i cotrol if the mea weight of a box is at most 368 grams. Therefore we would be iterested i testig whether the mea weight is more tha 368 grams. The two hypotheses are formulated as below: H 0 : µ 368 H a : µ > 368 Let s assume that that the stadard deviatio of the fillig process is kow to be σ = 15 grams ad that the weight of the box follows the ormal distributio. To test this hypothesis a sample of = 25 boxes of cereal is to be selected. Our goal here is to fid the power of the test for differet true values of µ whe we are willig to take a risk of Type I error α = 0.05. I other words we wat to compute the power of the test whe there is a shift from µ = 368 grams to µ a, whe µ a > 368. The table below gives the power of the test for differet values of µ a. µ a Power (1 β) 368 0.0500 369 0.0951 370 0.1635 371 0.2578 372 0.3783 373 0.5080 374 0.6368 375 0.7549 376 0.8461 377 0.9115 378 0.9545 379 0.9783 380 0.9906 381 0.9964 382 0.9987 383 0.9996 384 0.9999 The power of the test (1 β) here is computed as follows: 1 β =P(reject H 0 whe H 0 is ot true). I our example we will reject H 0 (coclude that µ > µ 0 where µ 0 is the value of µ uder the ull hypothesis) if z > z α x µ0 σ < z α x > µ 0 + z α σ. For these values of x we reject H 0. Now the power is the probability of fidig a value of x i the above rage whe the true mea is µ a. σ This is 1 β = P ( x > µ 0 + z α µ = µ a ) = P (z > µ 0+z α σ µ a σ ). 13

Power curves: The graph of the power agaist µ a for the two examples above is show below. H 0 : µ 368 H a : µ < 368 Power for H 0 : µ 368 vs. H a : µ < 368 Power (1 β) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 352 354 356 358 360 362 364 366 368 µ a H 0 : µ 368 H a : µ > 368 Power for H 0 : µ 368 vs. H a : µ > 368 Power (1 β) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 368 370 372 374 376 378 380 382 384 µ a 14

If we combie the two cases above we will get the graph of the power for a two-sided test. H 0 : µ = 368 H a : µ 368 Power for H 0 : µ = 368 vs. H a : µ 368 Power (1 β) 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 352 356 360 364 368 372 376 380 384 µ a 15

Other hypothesis tests Test for the differece betwee two populatio meas: H 0 : µ 1 µ 2 = δ (δ could be 0, ad the test is whether µ 1 = µ 2 ). H a : µ 1 µ 2 > δ, or µ 1 µ 2 < δ, or µ 1 µ 2 δ I order to test this hypothesis we select two samples from the two populatios. Let the two samples be X 1, X 2,, X, ad Y 1, Y 2,, Y. The test statistic is based o the differece of the two sample meas, X Ȳ, ad it depeds o whether σ 2 1, σ 2 2 are kow, whether σ 2 1 = σ 2 2, whether the sample sizes are small or large. Below we summarize all these differet cases. a. The two variaces, σ 2 1, σ 2 2 are kow, ad the two populatios are ormal. The regardless of the size of the two samples (could be small or large), the test statistics is: Z = X Ȳ (µ 1 µ 2 ) σ 2 1 1 + σ2 2 2 If Z falls i the rejectio regio (based o the sigificace level α) the H 0 is rejected. b. The two variaces are ukow ad 1 30, 2 30, (large samples). We will estimate the two ukow variaces with the sample variaces, s 2 1, s 2 2. Because the two samples are large we ca still use the Z test as a approximatio. Z X Ȳ (µ 1 µ 2 ) s 2 1 1 + s2 2 2 If Z falls i the rejectio regio (based o the sigificace level α) the H 0 is rejected. c. The two variaces are ukow but equal (σ 2 1 = σ 2 2) ad 1 30, or 2 30, (oe or both of the samples are small). We will estimate the ukow but commo variace with the so called pooled variace s 2 pooled, ad the test statistic will be t with 1+ 2 2 degrees of freedom. where t = X Ȳ (µ 1 µ 2 ) ( s 2 1 pooled + ) 1 1 2 s 2 pooled = ( 1 1)s 2 1 + ( 2 1)s 2 2 1 + 2 2 If t falls i the rejectio regio (based o the sigificace level α ad df = 1 + 2 2) the H 0 is rejected. 16

Test for the differece betwee two populatio proportios: H 0 : p 1 p 2 = 0 (we test whether the two populatio proportios are equal). H a : p 1 p 2 > 0, or p 1 p 2 < 0, or p 1 p 2 0 We select two samples of size 1, 2 ad the umber of successes X 1, X 2 are couted i each sample. The test statistic will be based o the the differece betwee the two sample proportio, ˆp 1 ˆp 2, where ˆp 1 = X 1 1 ad ˆp 2 = X 2 2. The test statistics is: where, Z = ˆp 1 ˆp 2 (p 1 p 2 ) ˆp(1 ˆp) ( ) 1 1 + 1 2 ˆp = X 1 + X 2 1 + 2. Uder H 0 the two populatio proportios are equal ad therefore the variace of ˆp 1 ˆp 2 is: ( X1 var (ˆp 1 ˆp 2 ) = var X ) 2 = var 1 2 ( ) X1 1 + var Because p 1 = p 2 = p (uder H 0 ), the variace of ˆp 1 ˆp 2 is: ( ) X2 2 = p 1(1 p 1 ) 1 + p 2(1 p 2 ) 2 ( 1 var (ˆp 1 ˆp 2 ) = p(1 p) + 1 ), p is ukow ad it is estimated by ˆp. 1 2 If Z falls i the rejectio regio (based o the sigificace level α) the H 0 is rejected. Example: Suppose the icotie cotet of two kids of cigarettes have stadard deviatios σ 1 = 1.2 ad σ 2 = 1.4 milligrams. Fifty cigarettes of the first kid had a sample mea cotet x 1 = 26.1 milligrams, while 40 cigarettes of the secod kid had a sample mea cotet of x 2 = 23.8 milligrams. Use α = 0.05 to test the followig hypothesis: H 0 : µ 1 µ 2 = 2 H a : µ 1 µ 2 2 17