Presentation on theme: "Chapter 9 Introduction to Hypothesis Testing"— Presentation transcript:
1 Chapter 9 Introduction to Hypothesis Testing Business Statistics:A Decision-Making Approach8th EditionChapter 9 Introduction to Hypothesis Testing
2 Chapter Goals After completing this chapter, you should be able to: Formulate null and alternative hypotheses involving a single population mean or proportionKnow what Type I and Type II errors areFormulate a decision rule for testing a hypothesisKnow how to use the test statistic, critical value, and p-value approaches to test the null hypothesisCompute the probability of a Type II error
3 What is Hypothesis Testing? A statistical hypothesis is an assumption about a population parameter (assumption may or may not be true).The best way to determine whether a statistical hypothesis is true would be to examine the entire population.Often impractical. So, examine a random sampleIf sample data are not consistent with the statistical hypothesis, the hypothesis is rejected.We never 100% “prove” anything because of sampling error
4 Types of Hypotheses Null hypothesis. Alternative hypothesis. Denoted by H0Alternative hypothesis.Denoted by H1 or Ha
5 The Null Hypothesis, H0 States the assumption to be tested Example: The average number of TV sets in U.S. Homes is at least three ( )Is always about a population parameter, not about a sample statistic (even though sample is used)
6 The Null Hypothesis, H0(continued)Begin with the assumption that the null hypothesis is trueSimilar to the notion of “innocent until proven guilty”Always contains “=” , “≤” or “” signMay or may not be rejectedBased on the statistical evidence gathered
7 The Alternative Hypothesis, HA Is the opposite of the null hypothesise.g.: The average number of TV sets in U.S. homes is less than 3 ( HA: µ < 3 )Contains “≠”, “<” or “>” signNever contains the “=” , “≤” or “” signMay or may not be accepted
8 Formulating Hypotheses Example 1: The average annual income of buyers of Ford F150 pickup trucks is claimed to be $65,000 per year. An industry analyst would like to test this claim.What is the appropriate test?H0: µ = 65,000 (income is as claimed)HA: µ ≠ 65,000 (income is different than claimed)The analyst will believe the claim unless sufficient evidence is found to discredit it.
9 Formulating Hypotheses Example 2: Ford Motor Company has worked to reduce road noise inside the cab of the redesigned F150 pickup truck. It would like to report in its advertising that the truck is quieter. The average of the prior design was 68 decibels at 60 mph.What is the appropriate test?H0: µ ≤ 67 (the truck is quieter: must be less than 68)HA: µ > 68 (the truck is not quieter)
10 Research HypothesisMore appropriate approach: standard and universal for new product or service testH0: µ ≥ 68 (the truck is not quieter)HA: µ < 68 (the truck is quieter) wants to supportResearch Hypothesis: new product is superior than the originalIf the null hypothesis is rejected, Ford has sufficient evidence to support that the truck is now quieter.
11 Steps for Formulating Hypothesis Tests State the hypotheses.The hypotheses must be mutually exclusive.That is, if one is true, the other must be false. Formulate an analysis plan.The analysis plan describes how to use sample data to evaluate the null hypothesis.The evaluation often focuses around a single test statistic.
12 Steps for Formulating Hypothesis Tests Analyze sample data.Find the value of the test statistic (mean score, proportion, t-score, z-score, etc.) described in the analysis plan and interpret result.Apply the decision rule described in the analysis plan.If the value of the test statistic is unlikely, based on the null hypothesis, reject the null hypothesis.
13 Errors in Making Decisions 3 outcomes for a hypothesis testNo error (no need to discuss)Type I error (Khan academy: type I error)Type II error
14 Errors in Making Decisions (continued)Type I ErrorRejecting a true null hypothesisConsidered as a serious errorThe probability of Type I Error is Called level of significance of the testSet by researcher in advance
15 Errors in Making Decisions (continued)Type II ErrorFailing to reject (i.e., accept) a false null hypothesisThe probability of Type II Error is ββ is a calculated value, the formula is discussed later in the chapter
16 Outcomes and Probabilities Possible Hypothesis Test OutcomesState of NatureDecisionH0 TrueH0 FalseDo NotNo error( )Type II Error( β )RejectKey:Outcome(Probability)aHRejectType I Error( )No Error( 1 - β )Ha
17 Type I & II Error Relationship Type I and Type II errors cannot happen atthe same time (mutually exclusive)Type I error can only occur if H0 is trueType II error can only occur if H0 is falseIf Type I error probability ( ) , thenType II error probability ( β )
18 Level of Significance, The maximum allowable probability of committing a Type I error (is selected by researcher at the beginning).Defines rejection region (Cutoff) of the sampling distributionIs designated by , (level of significance)Typical values are 0.01, 0.05, or 0.10Based on COST!Want small probability of Type I error high costProvides the critical value(s) of the testThe value corresponding to a significance level
19 Hypothesis Tests for the Mean σ Knownσ UnknownAssume first that the population standard deviation σ is known
20 Level of Significance and the Rejection Region *comparison operator of each test*Lower tail testUpper tail testTwo tailed testExample:Example:Example:H0: μ ≥ 3 HA: μ < 3H0: μ ≤ 3 HA: μ > 3H0: μ = 3 HA: μ ≠ 3aaaa/2/2-zαzα-zα/2zα/2Do not reject H0Do not reject H0Do not reject H0Reject H0Reject H0Reject H0Reject H0
21 Critical Value for Lower Tail Test H0: μ ≥ 3HA: μ < 3The cutoff value, or ,is called a critical value-zαxαabased on aReject H0Do not reject H0-zαxαµ=3
22 Critical Value for Upper Tail Test H0: μ ≤ 3HA: μ > 3The cutoff value, or ,is called a critical valuezαxαaDo not reject H0Reject H0zαµ=3xα
23 Critical Values for Two Tailed Tests H0: μ = 3 HA: μ ¹ 3There are two cutoff values (critical values):or± zα/2/2/2xα/2LowerUpperReject H0Do not reject H0Reject H0xα/2-zα/2zα/2µ=3xα/2xα/2LowerUpper
24 Two Equivalent Approaches to Hypothesis Testing z-units (Not as universal as using p-value):For given , find the critical z value(s):-zα , zα ,or ±zα/2Convert the sample mean x to a z test statistic:Reject H0 if z is in the rejection region,otherwise do not reject H0
25 Two Equivalent Approaches to Hypothesis Testing x units (Not Recommended and Not Necessary):Given , calculate the critical value(s)xα , or xα/2(L) and xα/2(U)The sample mean is the test statistic. Reject H0 if x is in the rejection region, otherwise do not reject H0
26 Detail Process of Hypothesis Testing Specify population parameter of interestFormulate the null and alternative hypothesesSpecify the desired significance level, αDefine the rejection regionTake a random sample and determine whether or not the sample result is in the rejection regionReach a decision and draw a conclusionExample next slide
27 Hypothesis Testing Example Test the claim that the true mean # of TV sets in US homes is at least 3. (Assume σ = 0.8)1. Specify the population value of interestTesting mean number of TVs in US homes2. Formulate the appropriate null and alternative hypothesesH0: μ HA: μ < 3 (This is a lower (left) tail test)3. Specify the desired level of significanceSuppose that = 0.05 is chosen for this test: probability is given, need to find z value
28 Formula Table We have X Z p We want X=μ+zσ Norminv(p,μ,σ) Normsinv(p as )Normdist(x,μ,σ,1)Normsdist(z)
29 Hypothesis Testing Example (continued)4. Determine the rejection region = .05Reject H0Do not reject H0Normsinv(.05) = 1.645-zα=This is a one-tailed test with = 0.05Since σ is known, the cutoff value is a z value:Reject H0 if z < z = ; otherwise do not reject H0
30 Hypothesis Testing Example 5. Obtain sample evidence and compute the test statisticSuppose a sample is taken with the following results: n = 100, x = ( = 0.8 is assumed known)Then the test statistic is:
31 Hypothesis Testing Example (continued)6. Reach a decision and interpret the result = .05zReject H0Do not reject H0-1.645-2.0Since z = -2.0 < , we reject the null hypothesis that the mean number of TVs in US homes is at least 3. There is sufficient evidence that the mean is less than 3.
32 Hypothesis Testing Example (continued)An alternate way (not recommend) of constructing rejection region:Now expressed in x, not z units = .05xReject H0Do not reject H02.868432.84Since x = 2.84 < , we reject the null hypothesisNot enough statistical evidence to conclude that the number of TVs is at least 3
33 Using p-Valuep-value: The p-value is the probability that your null hypothesis is actually correct. Simple and easy to apply: always reject null hypothesis if p-value < .Best and Universal approach: because p-values are usually computed by statistical SW packages (i.e., Excel, Minitab)
34 p-Value Approach to Testing (continued)Convert Sample Statistic ( ) to Test Statistic (a z value, if σ is known)Determine the p-value from a table or computerCompare the p-value with If p-value < , reject H0If p-value , do not reject H0x
35 p-Value Approach to Testing (continued)More than just a simple “reject”Can now determine how strongly we “reject” or “accept”The further the p-value is from a, the stronger the decisionJust compare “absolute value” whether it is one-tail or two-tail test.
36 p-value ExampleExample: Based on previous example, how likely is it to see a sample mean of 2.84 (or something further below the mean) if the true mean is = 3.0?Normsinv(.05) = 1.645 = 0.05p-value =0.0228Normsdist(-2) =Reject H0Do not reject H0z-1.645-2.0: z value from previous example
37 p-value Example Compare the p-value with (continued)Compare the p-value with If p-value < , reject H0If p-value , do not reject H0 = 0.05Here: p-value = = 0.05Since < 0.05, we reject the null hypothesisp-value =0.0228Reject H0-1.645-2.0
38 Example: Upper Tail z Test for Mean ( Known) A phone industry manager thinks that customer monthly cell phone bill have increased, and now average over $52 per month. The company wishes to test this claim. (Assume = 10 is known)Form hypothesis (upper-tail) test:H0: μ ≤ the average is not over $52 per monthHA: μ > the average is greater than $52 per month(i.e., sufficient evidence exists to support themanager’s claim)
39 Example: Find Rejection Region (continued)Suppose = 0.10 is chosen for this testFind the rejection region:Reject H0 = 0.10Do not reject H0Reject H0zα=1.28Normsinv(0.1) = 1.28Reject H0 if z > 1.28
40 Example: Test Statistic (continued)Obtain sample evidence and compute the test statisticSuppose a sample is taken with the following results: n = 64, x = (=10 was assumed known)Then the test statistic is:
41 Example: Decision Reach a decision and interpret the result: = 0.10 (continued)Reach a decision and interpret the result:Reject H0 = 0.10Do not reject H0Reject H01.28z = 0.88Do not reject H0 since z = 0.88 ≤ 1.28i.e.: there is not sufficient evidence that themean bill is over $52
42 p -Value Solution Calculate the p-value and compare to (continued)Calculate the p-value and compare to p-value =Reject H0 = 0.10Do not reject H0Reject H01.28z = 0.881-NORMSDIST(0.88) =Do not reject H0 since p-value = > = 0.10
43 Using t valueWhen Pop. Dist. Type is unknown and sample size is smaller, convert sample statistic ( ) to a t – statistic.xHypothesisTests for Known UnknownThe test statistic is:
44 When to apply t-statistic When σ is unknown, convert sample statistic (x) to a t – statistic. This is what the textbook said….based on assumption that the population is approximately normal.In reality, we do not know whether the population is almost or even half normal or not. Sol, forget about what the textbook says.Thus, if n is less than 30, apply t – statistic.Of course, if n is greater than equal to 30, apply z – statistic.
45 Hypothesis Tests for μ, σ Unknown Specify the population value of interestFormulate the appropriate null and alternative hypothesesSpecify the desired level of significanceDetermine the rejection region (critical values are from the t-distribution with n-1 d.f.)Obtain sample evidence and compute the test statisticReach a decision and interpret the result
46 Example: Two-Tail Test The average cost of a hotel room in New York is said to be $168 per night. A random sample of 25 hotels resulted in x = $ and s = $ Test at the = level(Assume the population distribution is normal)H0: μ = HA: μ ¹ 168
47 Example Solution: Two-Tail Test H0: μ = HA: μ ¹ 168a/2=0.025a/2=0.025a = 0.05n = 25Critical Values:t24 = ± is unknown, souse a t statisticReject H0Do not reject H0Reject H0-tα/2tα/22.06391.46Do not reject H0: not sufficient evidence that true mean cost is different than $168
48 TINVNORMSINV(p) gives the z-value that puts probability (area) p to the left of that value of z.TINV(p,DF) gives the t-value that puts one-half the probability (area) to the right with DF degrees of freedom.The reason for this is that TINV is used mainly to give the t-value used in confidence intervals.Remember in confidence intervals we use zα/2 or tα/2. So to get tα/2, you put in α and TINV automatically splits it when giving the appropriate t-value.
49 TDIST NORMSDIST(z) gives the probability (area) to the left of z. TDIST gives the area to the right of t; and on top of that it only works for positive values of tif you do want the area to the left of t?1 – (area to the right of t).The general form TDIST(t, degrees of freedom, 1 or 2).The last argument (1 or 2)1 for one-tail test or 2 for two-tail test.This is because that, in general, TDIST is used to get the p-values for t-tests.
50 Using Excel….Download and review following Word files from the class websiteImplication of TDIST and TINVUsing TDIST and TINV for HypothesisDownload Finding Critical Value and P-Value Excel file….Last slide for today’s lectureReview example from page 349 to 365
53 Hypothesis Tests for Proportions Involves categorical valuesTwo possible outcomes“Success” (possesses a certain characteristic)“Failure” (does not possesses that characteristic)Fraction or proportion of population in the “success” category is denoted by π
54 Proportions The sample proportion of successes is denoted by p : When both nπ and n(1- π) are at least 5, p is approximately normally distributed with mean and standard deviation
55 Hypothesis Tests for Proportions The sampling distribution of p is normal, so the test statistic is a z value:HypothesisTests for πnπ 5andn(1-π) 5nπ < 5orn(1-π) < 5Not discussed in this chapter
56 Example: z Test for Proportion A marketing company claims that it receives 8% responses from its mailing. To test this claim, a random sample of 500 were surveyed with 25 responses. Test at the = 0.05 significance level.Check:n π = (500)(0.08) = 40n(1-π) = (500)(0.92) = 460Both > 5, so assume normal
57 Z Test for Proportion: Solution Test Statistic:H0: π = HA: π ¹ 0.08a = 0.05n = 500, p = 0.05Decision:Critical Values: ± 1.96Reject H0 at = 0.05RejectRejectConclusion:0.0250.025There is sufficient evidence to reject the company’s claim of 8% response rate.z-1.961.96-2.47
58 p -Value Solution Calculate the p-value and compare to (For a two tailed test the p-value is always two tailed)Do not reject H0Reject H0Reject H0p-value = .0136:/2 = 0.025/2 = 0.0250.00680.0068-1.961.96z = -2.47z = 2.47Reject H0 since p-value = < = 0.05
59 Type II Error Suppose we fail to reject H0: μ 52 Type II error is the probability offailing to reject a false H0Suppose we fail to reject H0: μ 52when in fact the true mean is μ = 505052RejectH0: μ 52Do not rejectH0 : μ 52
60 Type II Error(continued)Suppose we do not reject H0: 52 when in fact the true mean is = 50This is the range of x where H0 is not rejectedThis is the true distribution of x if = 505052RejectH0: 52Do not rejectH0 : 52
61 Type II Error(continued)Suppose we do not reject H0: μ 52 when in fact the true mean is μ = 50Here, β = P( x cutoff ) if μ = 50β5052RejectH0: μ 52Do not rejectH0 : μ 52
62 Steps for Calculating b Specify the population parameter of interestFormulate the hypothesesSpecify the significance levelDetermine the critical valueDetermine the critical value for an upper or lower tail testSpecify the “true” population mean value of interestCompute z-value based on stipulated population meanUse standard normal table to find b
63 Calculating β Suppose n = 64 , σ = 6 , and = 0.05 (for H0 : μ 52)So β = P( x ) if μ = 505050.76652RejectH0: μ 52Do not rejectH0 : μ 52
64 Calculating β Suppose n = 64 , σ = 6 , and = 0.05 (continued) Probability of type II error:β =5052RejectH0: μ 52Do not rejectH0 : μ 52
65 Power Of Hypothesis Testing Would like b to be as small as possibleIf the null hypothesis is FALSE, we want to reject iti.e., we want the hypothesis test to have a high probability of rejecting a false null hypothesisReferred to as the power of the testPower = 1 - b
66 Chapter Summary Addressed hypothesis testing methodology Performed z Test for the mean (σ known)Discussed p–value approach to hypothesis testingPerformed one-tail and two-tail tests
67 Chapter Summary Performed t test for the mean (σ unknown) (continued)Performed t test for the mean (σ unknown)Performed z test for the proportionDiscussed Type II error and computed its probability