Hypothesis testing for µ:

Transcription

1 University of California, Los Angeles Department of Statistics Statistics 13 Elements of a hypothesis test: Hypothesis testing Instructor: Nicolas Christou 1. Null hypothesis, H 0 (always =). 2. Alternative hypothesis, H a (>, <, ). 3. Test statistic. 4. Significance level α. Hypothesis testing for µ: H 0 : µ = µ 0 H a : µ > µ 0, µ < µ 0, µ µ 0 (use only one of these!) When σ is known: Test statistic Z = X µ σ n When σ is unknown: Test statistic t = X µ s n If σ is known: Reject H 0 if Z falls in the rejection region. The rejection region is based on the significance level α we choose. If σ is unknown: Reject H 0 if t falls in the rejection region. The rejection region is based on the significance level α we choose and the degrees of freedom n 1. What is a p value? It is the probability of seeing the test statistic or a more extreme value (extreme is towards the direction of the alternative). If p value < α the H 0 is rejected. This is another way of testing a hypothesis (it should always agree with testing using Z or t). 1

2 Hypothesis testing for p: H 0 : p = p 0 H a : p > p 0, p < p 0, p p 0 (use only one of these 3!) Test statistic: Z = ˆp p 0 p0 (1 p 0 ) n Reject H 0 if Z falls in the rejection region. The rejection region is based on the significance level α we choose. What is a p value? As always, it is the probability of seeing the test statistic or a more extreme value (extreme is towards the direction of the alternative). If p value < α the H 0 is rejected. 2

4 Examples - Hypothesis testing Example 1 A manufacturer of chocolates claims that the mean weight of a certain box of chocolates is 368 grams. The standard deviation of the box s weight is known to be σ = 10 grams. If a sample of 49 boxes has sample mean x = 364 grams, test the hypothesis that the mean weight of the boxes is less than 368 grams. Use α = 0.05 level of significance. Example 2 A large retailer wants to determine whether the mean income of families living whithin 2 miles of a proposed building site exceeds $ What can we conclude at the 0.05 level of significance if the sample mean income of 60 families is x = $24524? Use σ = $763. Example 3 It is claimed that the mean mileage of a certain type of vehicle is 35 miles per gallon of gasoline with population standard deviation σ = 5 miles. What can be concluded using α = 0.01 about the claim if a random sample of 49 such vehicles has sample mean x = 36 miles? Example 4 A manufacturer claims that 20% of the public preferred her product. A sample of 100 persons is taken to check her claim. It is found that 8 of these 100 persons preferred her product. a. Find the p-value of the test (use a two-tailed test). b. Using the 0.05 level of significance test her claim. 4

5 Examples - Hypothesis testing Solutions Example 1 A manufacturer of chocolates claims that the mean weight of a certain box of chocolates is 368 grams. The standard deviation of the box s weight is known to be σ = 10 grams. If a sample of 49 boxes has sample mean x = 364 grams, test the hypothesis that the mean weight of the boxes is less than 368 grams. Use α = 0.05 level of significance. Solution: 1. H 0 : µ = 368 H a : µ < We compute the test statistic z: z = x µ σ = n z = We find the rejection region. Here we use significance level α = 0.05, therefore the rejection region is when z < Conclusion: Since z = 2.8 < we reject H 0. Compute the p value of the test: p value = P ( X < 364) = P (Z < 2.8) = Rule: If p value < α then H 0 is rejected. Again, using the p value we reject H 0. Example 2 A large retailer wants to determine whether the mean income of families living whithin 2 miles of a proposed building site exceeds $ What can we conclude at the 0.05 level of significance if the sample mean income of 60 families is x = $24524? Use σ = $763. Solution: 1. H 0 : µ = H a : µ > We compute the test statistic z: z = x µ σ = n z = We find the rejection region. Here we use significance level α = 0.05, therefore the rejection region is when z > Conclusion: Since z = 1.26 does not fall in the R.R. we do not reject H 0. 5

6 Example 3 It is claimed that the mean mileage of a certain type of vehicle is 35 miles per gallon of gasoline with population standard deviation σ = 5 miles. What can be concluded using α = 0.01 about the claim if a random sample of 49 such vehicles has sample mean x = 36 miles? Solution: 1. H 0 : µ = 35 H a : µ We compute the test statistic z: z = x µ σ = n z = We find the rejection region. Here we use significance level α = 0.01, but because of a two-sided test we have two rejection regions. They are z < or z > Conclusion: Since z = 1.4 does not fall in any of the two rejection regions we do not reject H 0. When we have a two-sided test the p value is computed as follows: p value = 2P ( X > 36) = 2P (Z > 1.4) = 2( ) = Again, using the p value H 0 is not rejected. Example 4 A manufacturer claims that 20% of the public preferred her product. A sample of 100 persons is taken to check her claim. It is found that 8 of these 100 persons preferred her product. a. Find the p-value of the test (use a two-tailed test). b. Using the 0.05 level of significance test her claim. Solution: We test the following 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) n = Therefore the p value is: (1 0.20) 100 = 3.0. p value = 2P (ˆp < 0.08) = 2P (Z < 3.0) = 2(0.0013) = We reject H 0 because p value= <

7 Hypothesis testing - t distribution Example 1 A tire manufacturer hopes that their newly designed tires will allow a car traveling at 60 mph to come to a complete stop within an average of 125 feet after the brakes are applied. They will adopt the new tires unless there is strong evidence that the tires do not meet this objective. The distances (in feet) for 9 stops on a test track were 129, 128, 130, 132, 135, 123, 125, 128, and 130. These data have x = , s = Test an appropriate hypothesis to conclude whether the company should adopt the new tires. Use α = Example 2 (from Mathematical Statistics and Data Analysis), by J. Rice, 2nd Edition. In a study done at the National Institute of Science and Technology (Steel et al. 1980), asbestos fibers on filters were counted as part of a project to develop measurement standards for asbestos concentration. Asbestos dissolved in water was spread on a filter, and punches of 3-mm diameter were taken from the filter and mounted on a transmission electron microscope. An operator counted the number of fibers in each of 23 grid squares, yielding the following counts: Assume normal distribution. These data have x = 24.91, s = Using α = 0.05 test the following hypothesis: H 0 : µ = 18 H a : µ 18 7

8 Hypothesis testing - t distribution Example 1 A tire manufacturer hopes that their newly designed tires will allow a car traveling at 60 mph to come to a complete stop within an average of 125 feet after the brakes are applied. They will adopt the new tires unless there is strong evidence that the tires do not meet this objective. The distances (in feet) for 9 stops on a test track were 129, 128, 130, 132, 135, 123, 125, 128, and 130. These data have x = , s = Test an appropriate hypothesis to conclude whether the company should adopt the new tires. Use α = Solution: 1. H 0 : µ = 125 H a : µ > We compute the test statistic t: t = x µ s = n t = We find the rejection region. Here we use significance level α = 0.05 with n 1 = 9 1 = 8 degrees of freedom. Therefore the rejection region is when t > Conclusion: Since t = 3.29 falls in any the rejection region we reject H 0. The p value is: p value= P ( X > ) = P (t > 3.29). From the t table we can say that the < p value < 0.01 Again, using the p value H 0 is rejected. Example 2 (from Mathematical Statistics and Data Analysis), by J. Rice, 2nd Edition. In a study done at the National Institute of Science and Technology (Steel et al. 1980), asbestos fibers on filters were counted as part of a project to develop measurement standards for asbestos concentration. Asbestos dissolved in water was spread on a filter, and punches of 3-mm diameter were taken from the filter and mounted on a transmission electron microscope. An operator counted the number of fibers in each of 23 grid squares, yielding the following counts: Assume normal distribution. These data have x = 24.91, s = Using α = 0.05 test the following hypothesis: H 0 : µ = 18 H a : µ 18 Solution: We compute the test statistic t: t = x µ s = n t = We find the rejection region. Here we use significance level α = 0.05 with n 1 = 23 1 = 22 degrees of freedom. Therefore the rejection region is when t < or t > Conclusion: Since t = 6.05 falls in one of the rejection regions 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 can only say that p value is less that

12 More examples - Hypothesis testing Example 1 An experimenter has prepared a drug dosage level that he claims will induce sleep for at least 80% of those people suffering from insomnia. After examining the dosage, we feel that his claims regarding the efectiveness of the dosage are inflated. In an attempt to disprove his claim, we administer his prescribed dosage to 20 insomniancs, and we observe X, the number having sleep induced by the drug dose. We wish to test the hypothesis H 0 : p = 0.8 against the alternative H a : p < 0.8. Assume the rejection region X 12 is used. a. Find the type I error α. b. Find the type II error β if the true p = 0.6. c. Find the type II error β if the true p = 0.4. Example 2 For a certain candidate s political poll n = 15 voters are sampled. Assume that this sample is taken from an infinite population of voters. We wish to test H 0 : p = 0.5 against the alternative H a : p < 0.5. The test statistic is X, which is the number of voters among the 15 sampled favoring this candidate. a. Calculate the probability of a type I error α if we select the rejection region to be RR = {x 2}. b. Is our test good in protecting us from concluding that this candidate is a winner if, in fact, he will lose? Suppose that he really will win 30% of the vote (p = 0.30). What is the probability of a type II error β that the sample will erroneously lead us to conclude that H 0 is true? 12

14 Power of the test - example: Let X be the breaking strength of a steel bar. if the steel bar is manufactured by a certain process, then X N(50, 6). Suppose that a sample of size n = 16 will be selected. Find the probability of detecting a shift from µ 0 = 50 to µ a = 55 if we can accept a Type I error α =

15 Power curves A power curve is a plot of the power 1 β against values of the parameter under the alternative hypothesis. Suppose that we want to determine whether or not a cereal box packaging process is in control. Let s assume that that the standard deviation of the filling process is known to be σ = 15 grams and that the weight of the box follows the normal distribution. To test this hypothesis a sample of n = 25 boxes of cereal is to be selected. Our goal here is to find the power of the test for different values of µ when we are willing to take a risk of Type I error α = a. Suppose our test is: H 0 : µ 368 H a : µ < 368 The plot of the power of the test 1 β against values of µ < 368 is the following: Power for H 0 : µ 368 vs. H a : µ < 368 Power (1 β) µ a 15

18 Type I and Type II error and finding the sample size - An example A manufacturer of tires claims that the mean lifetime of these tires is at least miles when the production process is working properly. Based upon past experience, the standard deviation of the lifetime of the tires is 3500 miles. The production manager will stop the production if there is evidence that the mean lifetime of the tires is below miles. a. If the production manager wishes to have 80% power of detecting a shift in the lifetime mean of the tires from to miles and if he is willing to take a 5% risk of committing a Type I error, what sample size must be selected? b. If the production manager wishes to have 80% power of detecting a shift in the lifetime mean of the tires from to miles and if he is willing to take a 5% risk of committing a Type I error, what sample size must be selected? 18

19 Other hypothesis tests Test for the difference between two population means: H 0 : µ 1 µ 2 = δ (δ could be 0, and the test is whether µ 1 = µ 2 ). H a : µ 1 µ 2 > δ, or µ 1 µ 2 < δ, or µ 1 µ 2 δ In order to test this hypothesis we select two samples from the two populations. Let the two samples be X 1, X 2,, X n, and Y 1, Y 2,, Y n. The test statistic is based on the difference of the two sample means, X Ȳ, and it depends on whether σ1 2, σ2 2 are known, whether σ2 1 = σ2 2, whether the sample sizes are small or large. Below we summarize all these different cases. a. The two variances, σ1 2, σ2 2 are known, and the two populations are normal. Then regardless of the size of the two samples (could be small or large), the test statistics is: Z = X Ȳ (µ 1 µ 2 ) σ 2 1 n 1 + σ2 2 n 2 If Z falls in the rejection region (based on the significance level α) then H 0 is rejected. b. The two variances are unknown and n 1 30, n 2 30, (large samples). We will estimate the two unknown variances with the sample variances, s 2 1, s2 2. Because the two samples are large we can still use the Z test as an approximation. Z X Ȳ (µ 1 µ 2 ) s 2 1 n 1 + s2 2 n 2 If Z falls in the rejection region (based on the significance level α) then H 0 is rejected. c. The two variances are unknown but equal (σ 2 1 = σ2 2 ) and n 1 30, or n 2 30, (one or both of the samples are small). We will estimate the unknown but common variance with the so called pooled variance s 2 pooled, and the test statistic will be t with n 1 + n 2 2 degrees of freedom. t = X Ȳ (µ 1 µ 2 ) ( ) s 2 1 pooled + 1 n1 n2 where s 2 pooled = (n 1 1)s (n 2 1)s 2 2 n 1 + n 2 2 If t falls in the rejection region (based on the significance level α and df = n 1 + n 2 2) then H 0 is rejected. 19

21 The paired t test In many experiments the same variable is measured under two different conditions. For example, in clinical trials the participants may be evaluated at baseline and then evaluated again at the end of the treatment. For example, the blood pressure is measured for several patients before and after administration of certain drug. The difference between the value at baseline and the value at the end is computed for each participant as follows: Value at baseline Value at the end Difference Subject 1 x 1b x 1a d 1 = x 1b x 1a Subject 2 x 2b x 2a d 2 = x 2b x 2a Subject 3 x 3b x 3a d 3 = x 3b x 3a Subject n x nb x na d n = x nb x na We then compute the sample mean and sample standard deviation of the differences. ni=1 d ni=n i d =, s 2 (d i d = d) 2 n n 1 The hypothesis we want to test is: H 0 : µ d = d 0 H a : µ d < d 0 or µ d > d 0 or µ d d 0 If we choose d 0 = 0 we are testing whether the before and after treatment are the same. Test statistic: t = d d 0 s d n Assumption: The differences are treated as a random sample from a normal distribution.. We reject H 0 if the t value falls in the rejection region which is based on the significance level α and n 1 degrees of freedom.. 21

22 Example: From Mathematical Statistics and Data Analysis, John Rice, Third Edition, Duxbury (2007). To study the effect of cigarette smoking on platelet aggregation researchers drew blood samples from 11 individuals before and after they smoked a cigarette and measured the percentage of blood platelet aggregation. Platelets are involved in the formation of blood clots, and it is known that smokers suffer more from disorders involving blood clots than do nonsmokers. This study can be found in Levine, P. H. (1973). An acute effect of cigarette smoking on platelet function, Circulation, 48, (see attached article). Before After Difference Test the null hypothesis that the means before and after are the same. Use α =

HYPOTHESIS TESTING: POWER OF THE TEST The first 6 steps of the 9-step test of hypothesis are called "the test". These steps are not dependent on the observed data values. When planning a research project,

Lecture 10 Hypothesis Testing A hypothesis is a conjecture about the distribution of some random variables. For example, a claim about the value of a parameter of the statistical model. There are two types

1 Final Review 2 Review 2.1 CI 1-propZint Scenario 1 A TV manufacturer claims in its warranty brochure that in the past not more than 10 percent of its TV sets needed any repair during the first two years

Chapter 9, Part A Hypothesis Tests Slide 1 Learning objectives 1. Understand how to develop Null and Alternative Hypotheses 2. Understand Type I and Type II Errors 3. Able to do hypothesis test about population

Probability February 14, 2013 Debdeep Pati Hypothesis testing Power of a test 1. Assuming standard deviation is known. Calculate power based on one-sample z test. A new drug is proposed for people with

Hypothesis test In statistics, a hypothesis is a claim or statement about a property of a population. A hypothesis test (or test of significance) is a standard procedure for testing a claim about a property

3.4 Statistical inference for 2 populations based on two samples Tests for a difference between two population means The first sample will be denoted as X 1, X 2,..., X m. The second sample will be denoted

Statistics 641 - EXAM II - 1999 through 2003 December 1, 1999 I. (40 points ) Place the letter of the best answer in the blank to the left of each question. (1) In testing H 0 : µ 5 vs H 1 : µ > 5, the

Introduction to Hypothesis Testing Point estimation and confidence intervals are useful statistical inference procedures. Another type of inference is used frequently used concerns tests of hypotheses.

Unit 31 A Hypothesis Test about Correlation and Slope in a Simple Linear Regression Objectives: To perform a hypothesis test concerning the slope of a least squares line To recognize that testing for a

Chapter 7 Part 2 Hypothesis testing Power November 6, 2008 All of the normal curves in this handout are sampling distributions Goal: To understand the process of hypothesis testing and the relationship

Hypothesis Testing or How to Decide to Decide Edpsy 580 Carolyn J. Anderson Department of Educational Psychology University of Illinois at Urbana-Champaign Hypothesis Testing or How to Decide to Decide

STATISTICS/GRACEY EXAM 3 PRACTICE/CH. 8-9 MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Find the P-value for the indicated hypothesis test. 1) A

Simple Linear Regression Inference 1 Inference requirements The Normality assumption of the stochastic term e is needed for inference even if it is not a OLS requirement. Therefore we have: Interpretation

LAB 4 INSTRUCTIONS CONFIDENCE INTERVALS AND HYPOTHESIS TESTING In this lab you will explore the concept of a confidence interval and hypothesis testing through a simulation problem in engineering setting.

Sections 4.5-4.7: Two-Sample Problems Paired t-test (Section 4.6) Examples of Paired Differences studies: Similar subjects are paired off and one of two treatments is given to each subject in the pair.

Math 62 Statistics Sample Exam Questions 1. (10) Explain the difference between the distribution of a population and the sampling distribution of a statistic, such as the mean, of a sample randomly selected

Difference of Means and Problems Dr. Tom Ilvento FREC 408 Accounting Firm Study An accounting firm specializes in auditing the financial records of large firm It is interested in evaluating its fee structure,particularly

7 Hypothesis testing - one sample tests 7.1 Introduction Definition 7.1 A hypothesis is a statement about a population parameter. Example A hypothesis might be that the mean age of students taking MAS113X

Experimental Design Power and Sample Size Determination Bret Hanlon and Bret Larget Department of Statistics University of Wisconsin Madison November 3 8, 2011 To this point in the semester, we have largely

9. Basic Principles of Hypothesis Testing Basic Idea Through an Example: On the very first day of class I gave the example of tossing a coin times, and what you might conclude about the fairness of the

Hypothesis Testing Introduction Hypothesis: A conjecture about the distribution of some random variables. A hypothesis can be simple or composite. A simple hypothesis completely specifies the distribution.

Chapter 7 Hypothesis Testing with One Sample 7.1 Introduction to Hypothesis Testing Hypothesis Tests A hypothesis test is a process that uses sample statistics to test a claim about the value of a population

HYPOTHESIS TESTING (ONE SAMPLE) - CHAPTER 7 1 PREVIOUSLY used confidence intervals to answer questions such as... You know that 0.25% of women have red/green color blindness. You conduct a study of men

Chapter 7 Notes - Inference for Single Samples You know already for a large sample, you can invoke the CLT so: X N(µ, ). Also for a large sample, you can replace an unknown σ by s. You know how to do a

How to Conduct a Hypothesis Test The idea of hypothesis testing is relatively straightforward. In various studies we observe certain events. We must ask, is the event due to chance alone, or is there some

Module 5 Hypotheses Tests: Comparing Two Groups Objective: In medical research, we often compare the outcomes between two groups of patients, namely exposed and unexposed groups. At the completion of this

HYPOTHESIS TEST CLASS NOTES Hypothesis Test: Procedure that allows us to ask a question about an unknown population parameter Uses sample data to draw a conclusion about the unknown population parameter.

Math 251, Review Questions for Test 3 Rough Answers 1. (Review of some terminology from Section 7.1) In a state with 459,341 voters, a poll of 2300 voters finds that 45 percent support the Republican candidate,

Practice for chapter 9 and 10 Disclaimer: the actual exam does not mirror this. This is meant for practicing questions only. The actual exam in not multiple choice. Find the number of successes x suggested

THERE ARE TWO WAYS TO DO HYPOTHESIS TESTING WITH STATCRUNCH: WITH SUMMARY DATA (AS IN EXAMPLE 7.17, PAGE 236, IN ROSNER); WITH THE ORIGINAL DATA (AS IN EXAMPLE 8.5, PAGE 301 IN ROSNER THAT USES DATA FROM

Unit 26 Estimation with Confidence Intervals Objectives: To see how confidence intervals are used to estimate a population proportion, a population mean, a difference in population proportions, or a difference

The Normal distribution The normal probability distribution is the most common model for relative frequencies of a quantitative variable. Bell-shaped and described by the function f(y) = 1 2σ π e{ 1 2σ

Probability & Statistics BITS Pilani K K Birla Goa Campus Dr. Jajati Keshari Sahoo Department of Mathematics TEST OF HYPOTHESIS There are many problems in which, rather then estimating the value of a parameter,

Hypothesis Testing --- One Mean A hypothesis is simply a statement that something is true. Typically, there are two hypotheses in a hypothesis test: the null, and the alternative. Null Hypothesis The hypothesis

Hypothesis Testing for a Proportion Example: We are interested in the probability of developing asthma over a given one-year period for children 0 to 4 years of age whose mothers smoke in the home In the

Introduction to Hypothesis Testing OPRE 6301 Motivation... The purpose of hypothesis testing is to determine whether there is enough statistical evidence in favor of a certain belief, or hypothesis, about

HYPOTHESIS TESTING AND TYPE I AND TYPE II ERROR Hypothesis is a conjecture (an inferring) about one or more population parameters. Null Hypothesis (H 0 ) is a statement of no difference or no relationship

Two-sample hypothesis testing, I 9.07 3/09/2004 But first, from last time More on the tradeoff between Type I and Type II errors The null and the alternative: Sampling distribution of the mean, m, given

Population and sample Sampling and Hypothesis Testing Allin Cottrell Population : an entire set of objects or units of observation of one sort or another. Sample : subset of a population. Parameter versus

Chapter 8 Hypothesis Testing Hypothesis In statistics, a hypothesis is a claim or statement about a property of a population. A hypothesis test (or test of significance) is a standard procedure for testing

Practice for Chapter 9 and 10 The acutal exam differs. SHORT ANSWER. Write the word or phrase that best completes each statement or answers the question. Find the number of successes x suggested by the

Sample Multiple Choice Questions for the material since Midterm 2. Sample questions from Midterms and 2 are also representative of questions that may appear on the final exam.. A randomly selected sample

Chapter 10 Hypothesis Testing: Two Means, Paired Data, Two Proportions 10.1 Hypothesis Testing: Two Population Means and Two Population Proportions 1 10.1.1 Student Learning Objectives By the end of this

Summary of Formulas and Concepts Descriptive Statistics (Ch. 1-4) Definitions Population: The complete set of numerical information on a particular quantity in which an investigator is interested. We assume

MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. 1) Assume that the change in daily closing prices for stocks on the New York Stock Exchange is a random

Intro to Significance Tests Name Hr For the following pairs, indicate whether they are legitimate hypotheses and why. 1. 2. 3. 4. For each situation, state the null and alternate hypothesis. (Define your

STATISTICS 151 SECTION 1 FINAL EXAM MAY 2 2009 This is an open book exam. Course text, personal notes and calculator are permitted. You have 3 hours to complete the test. Personal computers and cellphones

Name: Date: 1. Determine whether each of the following statements is true or false. A) The margin of error for a 95% confidence interval for the mean increases as the sample size increases. B) The margin

Introduction to Hypothesis Testing 1 Hypothesis Testing A hypothesis test is a statistical procedure that uses sample data to evaluate a hypothesis about a population Hypothesis is stated in terms of the

STT315 Practice Ch 5-7 MULTIPLE CHOICE. Choose the one alternative that best completes the statement or answers the question. Solve the problem. 1) The length of time a traffic signal stays green (nicknamed

125: Chi-Square Goodness of Fit Tests CD12-1 125: CHI-SQUARE GOODNESS OF FIT TESTS In this section, the χ 2 distribution is used for testing the goodness of fit of a set of data to a specific probability

Unit 21 Student s t Distribution in Hypotheses Testing Objectives: To understand the difference between the standard normal distribution and the Student's t distributions To understand the difference between

Final Exam Practice Problem Answers The following data set consists of data gathered from 77 popular breakfast cereals. The variables in the data set are as follows: Brand: The brand name of the cereal

Estimation of σ 2, the variance of ɛ The variance of the errors σ 2 indicates how much observations deviate from the fitted surface. If σ 2 is small, parameters β 0, β 1,..., β k will be reliably estimated