14
Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s most important jobs: Draw inferences about population based samples taken from the population. Usually we are interested in population parameters like mean or proportion of success. We approach these inferences in one of two ways: 1. CONFIDENCE INTERVALS (Ch 6) – use the sample to get “close enough” value to the actual parameter 2. HYPOTHESIS TESTING (Ch 7) – making decisions about the value of a population parameter WHAT DOES A HYPOTHESIS TEST LOOK LIKE? *POWERPOINT* Null and Alternate Hypotheses The statement/claim that is under investigation. Usually represents a statement of “no effect,” “no difference,” or “things haven’t changed.” Example: a) The average height of a professional male basketball player was 6.5 feet 10 years ago. Null Hypothesis: b) A television network claims that the time devoted to commercials in a 60-minute program is 12 minutes. Null Hypothesis: c) Mrs. Leahy says that her deck of 52 playing cards contains 26 red cards. Null Hypothesis:

Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

  • Upload
    others

  • View
    32

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Probability and Statistics – Mrs. Leahy

Unit 7: Hypothesis Testing

7.1: Introduction to Hypothesis Tests One of a statistician’s most important jobs: Draw inferences about population based samples taken from the population. Usually we are interested in population parameters like mean or proportion of success. We approach these inferences in one of two ways: 1. CONFIDENCE INTERVALS (Ch 6) – use the sample to get “close enough” value to the actual parameter 2. HYPOTHESIS TESTING (Ch 7) – making decisions about the value of a population parameter WHAT DOES A HYPOTHESIS TEST LOOK LIKE? *POWERPOINT*

Null and Alternate Hypotheses The statement/claim that is under investigation. Usually represents a statement of “no effect,” “no difference,” or “things haven’t changed.”

Example: a) The average height of a professional male basketball player was 6.5 feet 10 years ago. Null Hypothesis: b) A television network claims that the time devoted to commercials in a 60-minute program is 12 minutes. Null Hypothesis: c) Mrs. Leahy says that her deck of 52 playing cards contains 26 red cards. Null Hypothesis:

Page 2: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

This is the statement you will use if the evidence is so strong that you have to reject the null hypothesis.

A statistical test is made to assess the strength of the evidence against the null hypothesis. “You believe that µ is _____ than the value that is stated in H0 “ Example: a) The average height of a professional male basketball b) player was 6.5 feet 10 years ago. You believe that the average height of basketball players today is taller than it was 10 years ago. Null Hypothesis: Alternate Hypothesis: c) A car manufacturer advertises that its new subcompact models get 47 miles per gallon. Let µ be the mean of the mileage distribution for these cars. You assume that the manufacturer will not underrate the car, but you suspect that the mileage might be overrated. What should we use for H0 ? What should be use for H1? d) A company manufactures ball bearings for precision machines. The average diameter of a certain type of ball bearing should be 6.0mm. To check that the average diameter is correct, the company formulates a statistical test. What should be use for H0? What should be used for H1?

Page 3: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Types of Errors A hypothesis test always starts by assuming a given claim (Null Hypothesis) is true. At the end of the test there are only two outcomes: Reject the Null Hypothesis Fail to reject the Null Hypothesis Since your decision is based on a sample there is a possibility that you could be wrong.

The level of significance α is the probability of rejecting H0 (the null hypothesis) when it is true.

Criminal Trials in the United States What must a member of the jury assume about the defendant at the beginning of

the trial? This is the null hypothesis.

It is the prosecuting attorney’s job to present evidence to the jury. IF

there is enough evidence (“beyond a reasonable doubt”), then the jury

will convict the defendant of the crime. If the defendant is convicted,

the jury is rejecting the null hypothesis (above) and saying that the

defendant is _________. This is the alternative hypothesis.

When the jury convicts someone of a crime, their verdict is GUILTY.

Is this “Reject H0” OR “Fail to Reject H0”?

If the jury does not convict someone of a crime, their verdict is NOT GUILTY.

Is this “Reject H0” OR “Fail to Reject H0”?

How does the verdict of “not guilty” differ from “innocent”?

Sometimes the jury makes a correct decision and sometime the jury makes a mistake.

Describe a Type I error in the U.S. criminal justice system.

Describe a Type II error in the U.S. criminal justice system.

Which is more dangerous?

H0: _______________________

HA: _______________________

Page 4: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

The Level of Significance and the P-value of a test

The Probability of Making a Type 1 error is called: α = the level of significance

The idea: Set α to a small number (usually α = .01 or α = .05) This makes the probability of INCORRECTLY rejecting the null hypothesis very small.

The “P-value” of a test is the probability of obtaining a sample statistic with a

value as extreme or more extreme than the one determined from the sample data. If the probability of getting the sample statistic is highly unusual you need to reject the null hypothesis… The level of significance is the line you draw to explain what “highly unusual means.” Example: The P-value of your sample test statistic is 0.0135. Should you reject or fail to reject the null hypothesis if your level of significance is: a) α = 0.05 b) α = 0.01

Page 5: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

7.2: Hypothesis Testing for the Mean (when σ is known) Example: The P-value for your test statistic is P = 0.1035 What should you do if your α = 0.05 ?

Hypothesis Tests of µ, Given x is normal and σ is known LEFT TAILED TEST: RIGHT TAILED TEST: TWO-TAILED TEST:

Page 6: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example: Rosie is an aging sheep dog in Montana who gets regular check-ups from her owner, the local veterinarian. Le x be a random variable that represents Rosie’s resting heart rate (in beats per minute). From past experience, the vet knows that x has a normal distribution with σ = 12. The vet check a veterinary manual and found that for dogs of this breed µ = 115 beats per minute. Over the past six weeks, Rosie’s heart rate measured: 93, 109, 110, 89, 112, 117 The sample mean is �̅�=105.0 The vet is concerned that Rosie’s heart rate may be slowing. Do the data indicate that that is the case? Use a 5% level of significance. Step 1: Establish the null and alternate hypotheses Step 2: What type of test will this be? What is α ? Step 3: Find the value of the test statistic and the “P value” of the test. Step 4: Interpretation

Page 7: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example: The Environmental Protection Agency has been studying Miller Creek regarding ammonia nitrogen concentration. For many years, the concentration has been 2.3 mg/l. However, a new golf course and housing developments are raising concern that the concentration may have changed because of lawn fertilizer. Any change (either an increase or a decrease) in the ammonia nitrogen concetration can affect plant and animal life in and around the creek (Reference: EPA Report 832-R-93-005). Let x be a random variable representing ammonia nitrogen concentration (in mg/l). Based on recent studies of Miller Creek, we may assume that x has a normal distribution with σ = 0.30 . Recently a random sample of eight water tests had a mean of �̅� = 2.51 mg/l. Use a 1% level of significance. a) State the null and alternate hypotheses. b) What is α? What type of test will you use? c) Find the test statistic and the P-value. d) Based on parts a,b,&c, will you reject or fail to reject the null hypothesis? Are the data statistically significant at level α ? e) State your conclusion in the context of the application.

The evidence is _______________________ at the ______ level to reject the claim that sufficient/insufficient α

_____________. It seems that ____________________________________________. H0 H1 is true or not true?

P-value ≤ α reject data statistically significant at level α P-value >a fail to reject

Page 8: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example: A study says the mean time to recoup the cost of bariatric surgery is 3 years. You randomly select 25 bariatric surgery patients and find that the mean time to recoup the cost of their surgeries is 3.3 years. Assume the population standard deviation is σ = 0.5 years and that the population is normally distributed. Is there enough evidence to prove that the time to recoup the cost of surgery is actually more than 3 years? Use a level of significance of α = .01 a) State the null and alternate hypotheses. b) What is α? What type of test will you use? c) Find the test statistic and the P-value. d) Based on parts a,b,&c, will you reject or fail to reject the null hypothesis? Are the data statistically significant at level α ? e) State your conclusion in the context of the application.

The evidence is _______________________ at the ______ level to reject the claim that sufficient/insufficient α

_____________. It seems that ____________________________________________. H0 H1 is true or not true ?

P-value ≤ α reject data statistically significant at level α P-value >a fail to reject

Page 9: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

7.3– Hypothesis Testing the Mean µ when σ is unknown Recall from chapter 6: When σ was known, we used a critical value zc for our confidence interval. When σ was unknown, we used a critical value tc for our confidence interval. Similarly for chapter 7: When σ known Test statistic When σ unknown Test statistic

𝑧 =�̅�−𝜇𝜎

√𝑛⁄ 𝑡 =

�̅�−𝜇𝑠

√𝑛⁄

How to Use the Student’s t-distribution to estimate P-values. 1. Identify d.f. = n-1 to determine which row to look at 2. Identify where your t-value would be in that row 3. Look up to determine the range of P-values for a one or two tailed test. Example: Test statistic: t = 1.119 Sample size: n = 6 Right tailed test P-value: between _____ and ______ Example: Test statistic: t = 1.832 Sample size: n = 4 Two tailed test P value: Between _____ and ______ Example: A test statistic has a P-value between 0.025 and 0.050. Given α = 0.05 should you reject or fail to reject the null hypothesis? Example: A test statistic has a P-value between 0.050 and 0.100. Given α = 0.05 should you reject or fail to reject the null hypothesis?

Page 10: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example: A drug is used to treat leukemia. A random sample of 7 patients using this drug was taken and the remission times in weeks were recorded. Let x be a random variable representing the remission time for all patients using the drug. Assume the distribution is mound shaped and symmetrical. A previously used drug treatment had a mean remission time of µ =12.5 weeks. The sample mean �̅� =17.1 weeks with a sample standard deviation of s = 10.0. Do the data indicate that the mean remission time using the drug is different from 12.5 weeks? Use α =0.01 a) State the null and alternate hypotheses. b) What is α? What type of test will you use? c) Find the test statistic and the P-value. d) Based on parts a,b,&c, will you reject or fail to reject the null hypothesis? e) State your conclusion in the context of the application.

The evidence is _______________________ at the ______ level to reject the claim that sufficient/insufficient α

_____________. It seems that ____________________________________________. H0 H1 is true or not true ?

Page 11: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example : Archaeologists become excited when they find an anomaly in discovered artifacts. The anomaly may or may not indicate a new trading region or a new method of craftsmanship. Suppose that the lengths of arrowheads at a certain archaeological site have a mean length of µ = 2.6 cm. A random sample of 30 arrowheads in an adjacent cliff dwelling had a sample mean of �̅� = 2.92 𝑐𝑚 and a sample standard deviation of s = 0.85. Do these data indicate that the mean length of arrowheads in the adjacent cliff dwelling is longer than 2.6 cm? Use a 1% level of significance. a) State the null and alternate hypotheses. b) What is α? What type of test will you use? c) Find the test statistic and the P-value. d) Based on parts a,b,&c, will you reject or fail to reject the null hypothesis? e) State your conclusion in the context of the application.

The evidence is _______________________ at the ______ level to reject the claim that sufficient/insufficient α

_____________. It seems that ____________________________________________. H0 H1 is true or not true ?

Page 12: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example: A mean arsenic level of 𝜇 = 8.0 parts per billion (ppb) is considered safe for agricultural use. A well in Texas is used to water cotton crops. This well is tested on a regular basis for arsenic. A random sample of 37 tests gave a sample mean of �̅� = 7.2 ppb arsenic, with s = 1.9 ppb. Does this information indicate that the mean level of arsenic in this well is less than 8 ppb? Use α = 0.05 . Example: a) State the null and alternate hypotheses. b) What is α? What type of test will you use? c) Find the test statistic and the P-value. d) Based on parts a,b,&c, will you reject or fail to reject the null hypothesis? e) State your conclusion in the context of the application.

The evidence is _______________________ at the ______ level to reject the claim that sufficient/insufficient α

_____________. It seems that ____________________________________________. H0 H1 is true or not true ?

Page 13: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

7.4 – Hypothesis Testing a Proportion “p” Recall that for we can approximate certain binomial probability distributions using the normal distribution. Example:

Null and Alternate Hypotheses for Tests of Proportions

Note: if you calculate the denominator separately, be sure to use at least 4 decimals.

Page 14: Unit 7: Hypothesis Testing - avon-schools.org · Probability and Statistics – Mrs. Leahy Unit 7: Hypothesis Testing 7.1: Introduction to Hypothesis Tests One of a statistician’s

Example: A team of eye surgeons has developed a new technique for a risky eye operation to restore the sight of people blinded by a certain disease. Under the old method, it is know that only 30% of the patients who undergo this operation recover their sight. Suppose the surgeons in various hospitals have performed a total of 225 operations using the new method and that 88 have been successful. Can we justify the new method is better than the old method? Use a 1% level of significance.

Example: A botanist has produced a new variety of hybrid wheat that is better able to withstand drought than other varieties. The botanist knows that for the parent plants, the proportion of seeds germinating is 80%. To test this claim, 400 seeds from the hybrid plant are tested, and it is found that 312 germinate. Use a 5% level of significance to test the claim that the proportion germinating for the hybrid is 80%.