1 of 77

Chapter 9 Hypothesis Testing with One Sample

OPENSTAX STATISTICS

1

2 of 77

Objectives

  • By the end of this chapter, the student should be able to:
  • State the null and alternative hypothesis for a statement
  • Identify type 1 and type 2 errors
  • Choose the appropriate probability distribution needed for a hypothesis test
  • Complete a hypothesis test, using critical value or p-value approach

2

3 of 77

Section 9.1

NULL AND ALTERNATIVE HYPOTHESES

3

4 of 77

Null and Alternative Hypotheses

  • H0The null hypothesis: It is a statement of no difference between the variables–they are not related.
    • This can often be considered the status quo and as a result if you cannot accept the null it requires some action.
  • HaThe alternative hypothesis: It is a claim about the population that is contradictory to H0 and what we conclude when we cannot accept H0.
    • This is usually what the researcher is trying to prove.

4

5 of 77

After Determining Which Hypothesis the Data Supports…

  •  

5

6 of 77

Standard Null and Alternative Hypotheses

6

 

7 of 77

Example of Hypothesis Statements

  •  

7

8 of 77

More Examples of Hypothesis Statements

  • We want to test whether the mean GPA of students in American colleges is different from 2.0 (out of 4.0). The null and alternative hypotheses are:�H0μ = 2.0�Haμ ≠ 2.0

  • We want to test if college students take less than five years to graduate from college, on the average. The null and alternative hypotheses are:�H0μ ≥ 5�Haμ < 5

8

9 of 77

Section 9.2

OUTCOMES AND TYPE I AND TYPE 2 ERRORS

9

10 of 77

Four Possible Outcomes

10

11 of 77

Example

  •  

11

12 of 77

 

  • α = probability of a Type I error 
  • P(Type I error) = probability of rejecting the null hypothesis when the null hypothesis is true: rejecting a good null.
  • β = probability of a Type II error
  • P(Type II error) = probability of not rejecting the null hypothesis when the null hypothesis is false.
  • (1 − β) is called the Power of the Test.
  • Note: alpha and beta should be as small as possible since they are the probability of errors.

12

13 of 77

 

  • We can only set the alpha error, not the beta error.
  • We will not reject a null hypothesis unless there is a 90, 95, or even 99% chance that the null is false.
  • The same logic applies to test of hypotheses for all statistical parameters (mean, standard deviation, proportion, etc.).

13

14 of 77

Rock Climbing Example Cont.

Suppose the null hypothesis, H0, is: Navah's rock-climbing equipment is safe.

α = probability that Navah thinks her rock-climbing equipment may not be safe when, in fact, it really is safe. 

β = probability that Navah thinks her rock-climbing equipment may be safe when, in fact, it is not safe.

14

15 of 77

Example

  •  

15

16 of 77

Example - Answers

  • Suppose the null hypothesis, H0, is: The victim of an automobile accident is alive when they arrive at the emergency room of a hospital.
  • Type I error: The emergency crew thinks that the victim is dead when, in fact, the victim is alive. Type II error: The emergency crew does not know if the victim is alive when, in fact, the victim is dead.
  • α = probability that the emergency crew thinks the victim is dead when, in fact, the victim is really alive = P(Type I error). β = probability that the emergency crew does not know if the victim is alive when, in fact, the victim is dead = P(Type II error).
  • The error with the greater consequence is the Type I error. (If the emergency crew thinks the victim is dead, they will not treat them.)

16

17 of 77

Example

17

A company called Genetic Labs claims to be able to increase the likelihood that a pregnancy will result in a male being born. Statisticians want to test the claim. Suppose that the null hypothesis, H0, is: Genetic Labs has no effect on sex outcome. Describe the Type I and Type II errors. Which has the greater consequence?

18 of 77

Example - Answers

  • Type I error: This results when a true null hypothesis is rejected. In the context of this scenario, we would state that we believe that Genetic Labs influences the sex outcome, when in fact it has no effect. The probability of this error occurring is denoted by the Greek letter alpha, α.
  • Type II error: This results when we fail to reject a false null hypothesis. In context, we would state that Genetic Labs does not influence the sex outcome of a pregnancy when, in fact, it does. The probability of this error occurring is denoted by the Greek letter beta, β.
  • The error of greater consequence would be the Type I error since people would use the Genetic Labs product in hopes of increasing the chances of having a male.

18

19 of 77

Section 9.3

PROBABILITY DISTRIBUTION NEEDED FOR HYPOTHESIS TESTING

19

20 of 77

Appropriate Probability Distributions

20

21 of 77

Assumptions

21

Type of hypothesis test

Assumptions

Mean, population standard deviation known

Simple random sample

Normally distributed population or large sample size

Mean, population standard deviation unknown

Simple random sample

Approximately normally distributed population

Sample standard deviation used to approximate population standard deviation

Proportion

22 of 77

Section 9.4

RARE EVENTS, THE SAMPLE, DECISION, AND CONCLUSION

22

23 of 77

Rare Events

  • The occurrence of rare events can cause you to doubt any prior hypothesis.
  • Suppose you make an assumption about a property of the population (this assumption is the null hypothesis). Then you gather sample data randomly. If the sample has properties that would be very unlikely to occur if the assumption is true, then you would conclude that your assumption about the population is probably incorrect.
  • Hypothesis testing allows us to determine whether our data is a rare event or if we had made a wrong prior conjecture about data.

23

24 of 77

Example of a Rare Event

The probability of winning the lottery is very low. Suppose Arianna played the lottery just once and won a lot of money. Because Ari assumed the probability of winning the lottery is low, Arianna hopes that her assumption is incorrect and hopes that it is indeed easy to win the lottery.

Ari winning the lottery is a rare event.

24

25 of 77

There are several ways that you can conduct a hypothesis test.

YOU CAN USE CRITICAL VALUES OR P-VALUES. WE WILL DISCUSS BOTH METHODS.

26 of 77

Testing the Null Hypothesis

  • Use the sample data to calculate the actual probability of getting the test result, called the p-value.
  • The p-value is the probability that, if the null hypothesis is true, the results from another randomly selected sample will be as extreme or more extreme as the results obtained from the given sample.
  • A large p-value calculated from the data indicates that we should not reject the null hypothesis.
  • The smaller the p-value, the more unlikely the outcome, and the stronger the evidence is against the null hypothesis. We would reject the null hypothesis if the evidence is strongly against it.

26

27 of 77

P-Value Approach

  • This decision rule can be developed by calculating the probability that a sample mean could be found that would give a test statistic larger than the test statistic found from the current sample data assuming that the null hypothesis is true.
  • The p-value approach compares the desired significance level, α, to the p-value which is the probability of drawing a sample mean further from the hypothesized value than the actual sample mean.
    • A large p-value calculated from the data indicates that we should not reject the null hypothesis.
    • The smaller the p-value, the more unlikely the outcome, and the stronger the evidence is against the null hypothesis. We would reject the null hypothesis if the evidence is strongly against it.

28 of 77

Values the Hypothesis Test with the P-value Approach

 

29 of 77

P-Value Decision and Conclusion

  •  

29

30 of 77

Visualizing the Hypothesis Test with Critical Values

 

31 of 77

Test Statistics

  • Going back to the standardizing formula we can derive the test statistic for testing hypotheses concerning means.

  • The standardizing formula cannot be solved as it is because we do not have μ, the population mean. However, if we substitute in the hypothesized value of the mean, μ0 in the formula as above, we can compute a Z value. This is the test statistic for a test of hypothesis for a mean.

32 of 77

Visualizing the Hypothesis Test with Critical Values

  • Here is a case where we do not reject the null hypothesis.
  • Here the sample mean is within the two critical values.
  • That is, within the probability of (1-α) and we cannot reject the null hypothesis.

33 of 77

Making a Decision Using Critical Values

This gives us the decision rule for testing a hypothesis for a two-tailed test:

34 of 77

Usually the book uses P-value

WE WILL DISCUSS A FEW EXAMPLES OF P-VALUE VERSUS CRITICAL VALUE, YOU CAN USE EITHER METHOD. YOU JUST NEED TO GET THE RIGHT FINAL CONCLUSION!

34

35 of 77

Example

  •  

35

36 of 77

Example, Cont.

  • Suppose the null hypothesis is true (the mean height of the loaves is no more than 15 cm). Then is the mean height (17 cm) calculated from the sample unexpectedly large? The hypothesis test works by asking the question how unlikely the sample mean would be if the null hypothesis were true. The graph shows how far out the sample mean is on the normal curve. The p-value is the probability that, if we were to take other samples, any other sample mean would fall at least as far out as 17 cm.
  • The p-value, then, is the probability that a sample mean is the same or greater than 17 cm. when the population mean is, in fact, 15 cm. We can calculate this probability using the normal distribution for means.

36

37 of 77

Example, Cont.

37

38 of 77

Example, Cont.

  • p-value of approximately zero tells us that it is highly unlikely that a loaf of bread rises no more than 15 cm, on average. That is, almost 0% of all loaves of bread would be at least as high as 17 cm. purely by CHANCE had the population mean height really been 15 cm. Because the outcome of 17 cm. is so unlikely (meaning it is happening NOT by chance alone), we conclude that the evidence is strongly against the null hypothesis (the mean height is at most 15 cm.). There is sufficient evidence that the true mean height for the population of the baker's loaves of bread is greater than 15 cm.
  • Refer to the Excel workbook for how to calculate this situation with Excel.

38

39 of 77

Section 9.5

ADDITIONAL INFORMATION AND FULL HYPOTHESIS TEST EXAMPLES

39

40 of 77

General Notes

  •  

40

41 of 77

The Basic Setup

  •  

42 of 77

Example

  • Hoμ = 5, Haμ < 5
  • Test of a single population mean. Ha tells you the test is left-tailed. The picture of the p-value is as follows:

42

43 of 77

Example

H0p = 50  Hap ≠ 50

  • This is a test of a single population mean. Ha tells you the test is two-tailed. The picture of the p-value is as follows. In this case, we need to multiply the p-value by 2 to represent the area in the end of both tails.

43

44 of 77

Example – With P-values

Jeffrey, as an eight-year old, established a mean time of 16.43 seconds for swimming the 25-yard freestyle, with a standard deviation of 0.8 seconds. His dad, Frank, thought that Jeffrey could swim the 25-yard freestyle faster using goggles. Frank bought Jeffrey a new pair of expensive goggles and timed Jeffrey for 15 25-yard freestyle swims. For the 15 swims, Jeffrey's mean time was 16 seconds. Frank thought that the goggles helped Jeffrey to swim faster than the 16.43 seconds. Conduct a hypothesis test using a preset α = 0.05. Assume that the swim times for the 25-yard freestyle are normal.

See the Excel workbook.

44

45 of 77

Example - Answers

  •  

45

46 of 77

Example - Answers

  •  

46

47 of 77

Example - Answers

  •  

47

48 of 77

Example – With Critical Values

  • Jeffrey, as an eight-year old, established a mean time of 16.43 seconds for swimming the 25-yard freestyle, with a standard deviation of 0.8 seconds. His dad, Frank, thought that Jeffrey could swim the 25-yard freestyle faster using goggles. Frank bought Jeffrey a new pair of expensive goggles and timed Jeffrey for 15 25-yard freestyle swims. For the 15 swims, Jeffrey's mean time was 16 seconds. Frank thought that the goggles helped Jeffrey to swim faster than the 16.43 seconds. Conduct a hypothesis test using a preset α = 0.05. Assume that the swim times for the 25-yard freestyle are normal.

48

49 of 77

Example - Answers

  •  

49

50 of 77

Example - Answers

  •  

50

51 of 77

Example – Note on Language

  • Jeffrey, as an eight-year old, established a mean time of 16.43 seconds for swimming the 25-yard freestyle, with a standard deviation of 0.8 seconds. His dad, Frank, thought that Jeffrey could swim the 25-yard freestyle faster using goggles. Frank bought Jeffrey a new pair of expensive goggles and timed Jeffrey for 15 25-yard freestyle swims. For the 15 swims, Jeffrey's mean time was 16 seconds. Frank thought that the goggles helped Jeffrey to swim faster than the 16.43 seconds. Conduct a hypothesis test using a preset α = 0.05. Assume that the swim times for the 25-yard freestyle are normal.

Note: the phrase “established” is what means we can assume that we are dealing with the normal distribution instead of Student’s T. Note in the next example how the language differs.

51

52 of 77

Note on Excel Formulas

  • Discussion:
  • What is the difference between norm.dist vs norm.s.dist? Why can you use either formula?

52

53 of 77

Note on Excel Formulas

  • Discussion:
  • What is the difference between norm.dist vs norm.s.dist? Why can you use either formula?
  • Answer: Note the formula setups
  • Norm.dist(data, mean, std deviation, true) vs
  • Norm.S.Dist(test statistic, true)
  • Norm.Dist forces you to input all the data so that it can calculate its own test statistic

53

54 of 77

Example

  • Jasmine has just begun her new job on the sales force of a very competitive company. In a sample of 16 sales calls it was found that she closed the contract for an average value of 108 dollars with a standard deviation of 12 dollars. Test at 5% significance that the population mean is at least 100 dollars against the alternative that it is less than 100 dollars. Company policy requires that new members of the sales force must exceed an average of $100 per contract during the trial employment period. Can we conclude that Jasmine has met this requirement at the significance level of 95%? Use the critical value method for this one.
  • See the Excel spreadsheet for all the work for this.

55 of 77

Example - Answers

  • Jasmine has just begun her new job on the sales force of a very competitive company. In a sample of 16 sales calls it was found that she closed the contract for an average value of 108 dollars with a standard deviation of 12 dollars. Test at 5% significance that the population mean is at least 100 dollars against the alternative that it is less than 100 dollars. Company policy requires that new members of the sales force must exceed an average of $100 per contract during the trial employment period. Can we conclude that Jasmine has met this requirement at the significance level of 95%?
  • First note: we only have data regarding Jasmine, and she is new. This is not much data, it is less than 30 data points, we have no reason to think it is established. This means we will use Student’s T.

56 of 77

Example – Answers

  •  

56

57 of 77

Example – Answers

  •  

58 of 77

Example – Answers

59 of 77

Example

  • A college football coach records the mean weight that the players can bench press as 275 pounds, with a standard deviation of 55 pounds. Three of the players thought that the mean weight was more than that amount. They asked 30 of their teammates for their estimated maximum lift on the bench press exercise. The data ranged from 205 pounds to 385 pounds. The actual different weights were (frequencies are in parentheses) 205(3); 215(3); 225(1); 241(2); 252(2); 265(2); 275(2); 313(2); 316(5); 338(2); 341(1); 345(2); 368(2); 385(1).
  • Conduct a hypothesis test using a 2.5% level of significance to determine if the bench press mean is more than 275 pounds. Use P-values.

59

60 of 77

Example - Answers

  •  

60

61 of 77

Example - Answers

  •  

61

62 of 77

Example

  •  

63 of 77

Example - Answers

  •  

64 of 77

Example - Answers

  • Test Statistic: -3.074
  • Critical value using t.inv(0.01/2, 34): -2.72
  • P-value: 0.004 (remember to multiply the p-value by 2 since this is a two-tailed test)
  • For the critical value method, we have that -3.074 < -2.72.
  • For P-value, we have that 0.004 < 0.01.
  • In either case, we will reject the null hypothesis. At a 99% level of significance we cannot accept the hypothesis that the sample mean came from a distribution with a mean of 8 ounces” Or less formally, and getting to the point, “At a 99% level of significance we conclude that the machine is under filling the bottles and is in need of repair”.

65 of 77

Example

  • Statistics students believe that the mean score on the first statistics test is 65. A statistics instructor thinks the mean score is higher than 65. He samples ten statistics students and obtains the scores 65; 65; 70; 67; 66; 63; 63; 68; 72; 71. He performs a hypothesis test using a 5% level of significance. The data are assumed to be from a normal distribution. Use p-values.

65

66 of 77

Example - Answers

  •  

66

67 of 77

Example - Answers

  •  

67

68 of 77

Hypothesis Test for Proportions

  •  

69 of 77

Test Statistic with Proportions

  • The test statistic is:

70 of 77

Forms of the Hypothesis Tests

  • This is the test statistic for testing hypothesized values of p, where the null and alternative hypotheses take one of the following forms:

  • The decision rule stated above applies here also: if the calculated value of Zc shows that the sample proportion is "too many" standard deviations from the hypothesized proportion, the null hypothesis cannot be accepted. The decision as to what is "too many" is pre-determined by the analyst depending on the level of significance required in the test.

71 of 77

Example

Joon believes that 50% of first-time brides in the United States are younger than their grooms. She performs a hypothesis test to determine if the percentage is the same or different from 50%. Joon samples 100 first-time brides and 53 reply that they are younger than their grooms. For the hypothesis test, she uses a 1% level of significance. Compare the p-value versus critical value approach.

71

72 of 77

Example - Answers

  •  

72

73 of 77

Example - Answers

  •  

73

74 of 77

Example with Critical Value Approach

  •  

74

75 of 77

Example with Critical Value Approach

  • Compare the test statistic and the critical value.
    • The test statistic is within the critical values.
  • State the conclusion, both in formal statistical terms and in the context of the problem.
    • Since the test statistic is within the critical values, we fail to reject the null. That is, there is not enough evidence to reject the hypothesis that 50% of first-time loan borrowers take out a loan smaller than other borrowers.

75

76 of 77

Example

  • Statistical data indicates that in a certain country there are approximately 268,608,618 residents aged 12 and older. For a certain period of time, statistical data also indicates that the percentage of residents with blood type AB negative (AB-) is 207,754 individuals. This translates into a percentage of 0.078% with this rather rare blood type. In a certain province of the country, there were 11 people with blood type AB- out of the population of 37,937. Conduct an appropriate hypothesis test to determine if there is a statistically significant difference between the percentage of residents in the entire country with blood type AB- versus the percentage in the local province. Use a significance level of 0.01.

76

77 of 77

Example - Answers

  •  

77