Presentation on theme: "Introduction to Hypothesis Testing"— Presentation transcript:
1 Introduction to Hypothesis Testing Chapter 11Introduction to Hypothesis Testing
2 11.1 IntroductionThe purpose of hypothesis testing is to determine whether there is enough statistical evidence in favor of a certain belief about a parameter.ExamplesIs there statistical evidence in a random sample of potential customers, that support the hypothesis that more than 10% of the potential customers will purchase a new products?Is a new drug effective in curing a certain disease? A sample of patients is randomly selected. Half of them are given the drug while the other half are given a placebo. The improvement in the patients conditions is then measured and compared.
3 11.2 Concepts of Hypothesis Testing The critical concepts of hypothesis testing.Example:An operation manager needs to determine if the mean demand during lead time is greater than 350.If so, changes in the ordering policy are needed.There are two hypotheses about a population mean:H0: The null hypothesis m = 350H1: The alternative hypothesis m > 350This is what you want to prove
4 11.2 Concepts of Hypothesis Testing Assume the null hypothesis is true (m= 350).m = 350Sample from the demand population, and build a statistic related to the parameter hypothesized (the sample mean).Pose the question: How probable is it to obtain a sample mean at least as extreme as the one observed from the sample, if H0 is correct?
5 11.2 Concepts of Hypothesis Testing Assume the null hypothesis is true (m= 350).m = 350Since the is much larger than 350, the mean m is likely to be greater than 350. Reject the null hypothesis.In this case the mean m is not likely to be greater than 350. Do not reject the null hypothesis.
6 Types of ErrorsTwo types of errors may occur when deciding whether to reject H0 based on the statistic value.Type I error: Reject H0 when it is true.Type II error: Do not reject H0 when it is false.Example continuedType I error: Reject H0 (m = 350) in favor of H1 (m > 350) when the real value of m is 350.Type II error: Believe that H0 is correct (m = 350) when the real value of m is greater than 350.
7 Controlling the probability of conducting a type I error Recall:H0: m = 350 and H1: m > 350.H0 is rejected if is sufficiently largeThus, a type I error is made if when m = 350.By properly selecting the critical value we can limit the probability of conducting a type I error to an acceptable level.Critical valuem = 350
8 11.3 Testing the Population Mean When the Population Standard Deviation is Known Example 11.1A new billing system for a department store will be cost- effective only if the mean monthly account is more than $170.A sample of 400 accounts has a mean of $178.If accounts are approximately normally distributed with s = $65, can we conclude that the new system will be cost effective?
9 Testing the Population Mean (s is Known) Example 11.1 – SolutionThe population of interest is the credit accounts at the store.We want to know whether the mean account for all customers is greater than $170.H1 : m > 170The null hypothesis must specify a single value of the parameter m,H0 : m = 170
10 Approaches to TestingThere are two approaches to test whether the sample mean supports the alternative hypothesis (H1)The rejection region method is mandatory for manual testing (but can be used when testing is supported by a statistical software)The p-value method which is mostly used when a statistical software is available.
11 The Rejection Region Method The rejection region is a range of values such that if the test statistic falls into that range, the null hypothesis is rejected in favor of the alternative hypothesis.
12 The Rejection Region Method – for a Right - Tail Test Example 11.1 – solution continuedRecall: H0: m = H1: m > therefore,It seems reasonable to reject the null hypothesis and believe that m > 170 if the sample mean is sufficiently large.Reject H0 hereCritical value of thesample mean
13 The Rejection Region Method for a Right - Tail Test Example 11.1 – solution continuedDefine a critical value for that is just large enough to reject the null hypothesis.Reject the null hypothesis if
14 Determining the Critical Value for the Rejection Region Allow the probability of committing a Type I error be a (also called the significance level).Find the value of the sample mean that is just large enough so that the actual probability of committing a Type I error does not exceed a. Watch…
15 Determining the Critical Value – for a Right – Tail Test Example 11.1 – solution continuedaP(commit a Type I error) = P(reject H0 given that H0 is true)= P( given that H0 is true)… is allowed to be a.we have:
16 Determining the Critical Value – for a Right – Tail Test Example 11.1 – solution continueda= 0.05
17 Determining the Critical value for a Right - Tail Test ConclusionSince the sample mean (178) is greater than the critical value of , there is sufficient evidence to infer that the mean monthly balance is greater than $170 at the 5% significance level.
18 The standardized test statistic Instead of using the statistic , we can use the standardized value z.Then, the rejection region becomesOne tail test
19 The standardized test statistic Example continuedWe redo this example using the standardized test statistic.Recall: H0: m = 170H1: m > 170Test statistic:Rejection region: z > z.05 =
20 The standardized test statistic Example continuedConclusionSince Z = > 1.645, reject the null hypothesis in favor of the alternative hypothesis.
21 P-value MethodThe p-value provides information about the amount of statistical evidence that supports the alternative hypothesis.The p-value of a test is the probability of observing a test statistic at least as extreme as the one computed,given that the null hypothesis is true.Let us demonstrate the concept on Example 11.1
22 P-value MethodThe probability of observing a test statistic at least as extreme as 178,given that m = 170 is…The p-value
23 Interpreting the p-value Because the probability that the sample mean will assume a value of more than 178 when m = 170 is so small (.0069), there are reasons to believe that m > 170.Note how the eventis rare under H0when but...…it becomes moreprobable under H1,when
24 Interpreting the p-value We can conclude that the smaller the p-valuethe more statistical evidence exists to support the alternative hypothesis.
25 Interpreting the p-value Describing the p-valueIf the p-value is less than 1%, there is overwhelming evidence that supports the alternative hypothesis.If the p-value is between 1% and 5%, there is a strong evidence that supports the alternative hypothesis.If the p-value is between 5% and 10% there is a weak evidence that supports the alternative hypothesis.If the p-value exceeds 10%, there is no evidence that supports the alternative hypothesis.
26 The p-value and the Rejection Region Methods The p-value can be used when making decisions based on rejection region methods as follows:Define the hypotheses to test, and the required significance level a.Perform the sampling procedure, calculate the test statistic and the p-value associated with it.Compare the p-value to a. Reject the null hypothesis only if p-value <a; otherwise, do not reject the null hypothesis.a= 0.05The p-value
27 Conclusions of a Test of Hypothesis If we reject the null hypothesis, we conclude that there is enough evidence to infer that the alternative hypothesis is true.If we do not reject the null hypothesis, we conclude that there is not enough statistical evidence to infer that the alternative hypothesis is true.The alternative hypothesisis the more importantone. It represents whatwe are investigating.
28 A Left - Tail Test The SSA Envelop Example. The chief financial officer in FedEx believes that including a stamped self-addressed (SSA) envelop in the monthly invoice sent to customers will decrease the amount of time it take for customers to pay their monthly bills.Currently, customers return their payments in 24 days on the average, with a standard deviation of 6 days.
29 A Left - Tail Test The SSA envelop example – continued It was calculated that an improvement of two days on the average will cover the costs of the envelops (checks can be deposited earlier).A random sample of 220 customers was selected and SSA envelops were included with their invoice packs.The times customers’ payments were received were recorded (SSA.xls)Can the CFO conclude that the plan will be profitable at 10% significance level?
30 A Left - Tail Test The SSA envelop example – Solution The parameter tested is the population mean payment period (m).The hypotheses are: H0: m = 22 H1: m < 22 (The CFO wants to know whether the plan will be profitable)
31 A Left - Tail Test The SSA envelop example – Solution continued The rejection region: It makes sense to believe that m < 22 if the sample mean is sufficiently smaller than 22.Reject the null hypothesis if
32 Define the rejection region Left-tail testA Left -Tail TestThe SSA envelop example – Solution continuedThe standardized one tail left hand test is:Define the rejection regionSince -.91 > –1.28 do not reject the null hypothesis.The p value = P(Z<-.91) = Since > .10, do not reject the null hypothesis
33 A Two - Tail Test Example 11.2 AT&T has been challenged by competitors who argued that their rates resulted in lower bills.A statistics practitioner determines that the mean and standard deviation of monthly long-distance bills for all AT&T residential customers are $17.09 and $3.87 respectively.
34 A Two - Tail Test Example 11.2 - continued A random sample of 100 customers is selected and customers’ bills recalculated using a leading competitor’s rates (see Xm11-02).Assuming the standard deviation is the same (3.87), can we infer that there is a difference between AT&T’s bills and the competitor’s bills (on the average)?
35 A Two - Tail Test Solution Is the mean different from 17.09? H0: m = 17.09Define the rejection region
36 A Two – Tail Test Solution - continued a/2 = 0.025 a/2 = 0.025 17.09 We want this erroneous rejection of H0 to be a rare event, say 5% chance.If H0 is true (m =17.09), can still fall far above or far below 17.09, in which case we erroneously reject H0 in favor of H1
37 A Two – Tail Test Solution - continued From the sample we have: 17.55a/2 = 0.02517.09a/2 = 0.025-za/2 = -1.96za/2 = 1.96Rejection region
38 A Two – Tail TestTwo-tail testThere is insufficient evidence to infer that there is a difference between the bills of AT&T and the competitor.Also, by the p value approach:The p-value = P(Z< -1.19)+P(Z >1.19)= 2(.1173) = > .05a/2 = 0.025a/2 = 0.025-1.191.19-za/2 = -1.96za/2 = 1.96
39 11.4 Calculating the Probability of a Type II Error To properly interpret the results of a test of hypothesis, we need tospecify an appropriate significance level or judge the p-value of a test;understand the relationship between Type I and Type II errors.How do we compute a type II error?
40 Calculation of the Probability of a Type II Error To calculate Type II error we need to…express the rejection region directly, in terms of the parameter hypothesized (not standardized).specify the alternative value under H1.Let us revisit Example 11.1
41 Calculation of the Probability of a Type II Error Express the rejection region directly, not in standardized termsLet us revisit Example 11.1The rejection region was with a = .05.Let the alternative value be m = 180 (rather than just m>170)H0: m = 170H1: m = 180a=.05m= 170m=180Specify the alternative value under H1.Do not reject H0
42 Calculation of the Probability of a Type II Error A Type II error occurs when a false H0 is not rejected.A false H0…H0: m = 170…is not rejectedH1: m = 180a=.05m= 170m=180
43 Calculation of the Probability of a Type II Error H0: m = 170H1: m = 180m=180m= 170
44 Effects on b of changing a Decreasing the significance level a, increases the value of b, and vice versa.a2 >b2 <a1b1m= 170m=180
45 Judging the TestA hypothesis test is effectively defined by the significance level a and by the sample size n.If the probability of a Type II error b is judged to be too large, we can reduce it byincreasing a, and/orincreasing the sample size.
46 Judging the Test Increasing the sample size reduces b By increasing the sample size the standard deviation of the sampling distribution of the mean decreases. Thus, decreases.
47 Judging the Test Increasing the sample size reduces b Note what happens when n increases:a does not change,but b becomes smallerm=180m= 170
48 Judging the Test Increasing the sample size reduces b In Example 11.1, suppose n increases from 400 to 1000.a remains 5%, but the probability of a Type II drops dramatically.
49 Judging the Test Power of a test The power of a test is defined as 1 - b.It represents the probability of rejecting the null hypothesis when it is false.