Presentation is loading. Please wait.

Presentation is loading. Please wait.

Two-Sample Hypothesis Testing

Similar presentations


Presentation on theme: "Two-Sample Hypothesis Testing"— Presentation transcript:

1 Two-Sample Hypothesis Testing
10 Chapter Two-Sample Tests Comparing Two Means: Independent Samples Comparing Two Means: Paired Samples Comparing Two Proportions Comparing Two Variances McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. All rights reserved.

2 Two-Sample Tests What is a Two-Sample Test Basis of Two-Sample Tests
A Two-sample test compares two sample estimates with each other. A one-sample test compares a sample estimate against a non-sample benchmark. Basis of Two-Sample Tests Two samples that are drawn from the same population may yield different estimates of a parameter due to chance.

3 Two-Sample Tests What is a Two-Sample Test
If the two sample statistics differ by more than the amount attributable to chance, then we conclude that the samples came from populations with different parameter values. Figure 10.1

4 Two-Sample Tests Test Procedure State the hypotheses
Set up the decision rule Insert the sample statistics Make a decision based on the critical values or using p-values If our decision is wrong, we could commit a type I or type II error. Larger samples are needed to reduce type I or type II errors.

5 Comparing Two Means: Independent Samples
Format of Hypotheses The hypotheses for comparing two independent population means m1 and m2 are:

6 Comparing Two Means: Independent Samples
Test Statistic If the population variances s12 and s22 are known, then use the normal distribution. If population variances are unknown and estimated using s12 and s22, then use the Students t distribution. Table 10.1

7 Comparing Two Means: Independent Samples
Test Statistic Excel’s Tools | Data Analysis menu handles all three cases. Figure 10.2

8 Comparing Two Means: Independent Samples
Case 1: Known Variances When the variances are known, use the normal distribution for the test (assuming a normal population). The test statistic is:

9 Comparing Two Means: Independent Samples
Case 2: Unknown Variances, Assumed Equal Since the variances are unknown, they must be estimated and the Student’s t distribution used to test the means. Assuming the population variances are equal, s12 and s22 can be used to estimate a common pooled variance sp2.

10 Comparing Two Means: Independent Samples
Case 2: Unknown Variances, Assumed Equal The test statistic is calc With degrees of freedom n = n1 + n2 - 2

11 Comparing Two Means: Independent Samples
Case 3: Unknown Variances, Assumed Unequal If the unknown variances are assumed to be unequal, they are not pooled together. In this case, the distribution of the random variable x1 – x2 is not certain (Behrens-Fisher problem). Use the Welch-Satterthwaite test which replaces s12 and s22 with s12 and s22 in the known variance z formula, then uses a Student’s t test with adjusted degrees of freedom.

12 Comparing Two Means: Independent Samples
Case 3: Unknown Variances, Assumed Unequal Welch-Satterthwaite test with degrees of freedom A Quick Rule for degrees of freedom is to use min(n1 – 1, n2 – 1).

13 Comparing Two Means: Independent Samples
Steps in Testing Two Means Step 1: State the hypotheses Step 2: Specify the decision rule Choose a (the level of significance) and determine the critical value(s). Step 3: Calculate the Test Statistic

14 Comparing Two Means: Independent Samples
Steps in Testing Two Proportions Step 4: Make the decision Reject H0 if the test statistic falls in the rejection region(s) as defined by the critical value(s). For example, for a two-tailed test for Student’s t and a = .05 Figure 10.4

15 Comparing Two Means: Independent Samples
Which Assumption Is Best? If the sample sizes are equal, the Case 2 and Case 3 test statistics will be identical, although the degrees of freedom may differ. If the variances are similar, the two tests will usually agree. If no information about the population variances is available, then the best choice is Case 3. The fewer assumptions, the better.

16 Comparing Two Means: Independent Samples
Must Sample Sizes Be Equal? Unequal sample sizes are common and the formulas still apply. Large Samples For unknown variances, if both samples are large (n1 > 30 and n2 > 30) and the population isn’t badly skewed, use the following formula with appendix C.

17 Comparing Two Means: Independent Samples
Caution: Three Issues Are the populations skewed? Are there outliers? Check using histograms and dot plots of each sample. t tests are OK if moderately skewed, especially if samples are large. Outliers are more serious.

18 Comparing Two Means: Independent Samples
Caution: Three Issues Are the sample sizes large (n > 30)? If samples are small, the mean is not a reliable indicator of central tendency and the test may lack power. Is the difference important as well as significant? A small difference in means or proportions could be significant if the sample size is large.

19 Comparing Two Means: Paired Samples
Paired Data Data occurs in matched pairs when the same item is observed twice but under different circumstances. For example, blood pressure is taken before and after a treatment is given. Paired data are typically displayed in columns:

20 Comparing Two Means: Paired Samples
Paired t Test Paired data typically come from a before/after experiment. In the paired t test, the difference between x1 and x2 is measured as d = x1 – x2 The mean d and standard deviation sd of the sample of n differences are calculated with the usual formulas for a mean and standard deviation.

21 Comparing Two Means: Paired Samples
Paired t Test The calculations for the mean and standard deviation are: Since the population variance of d is unknown, use the Student’s t with n-1 degrees of freedom. calc

22 Comparing Two Means: Paired Samples
Steps in Testing Paired Data Step 1: State the hypotheses, for example H0: md = 0 H1: md ≠ 0 Step 2: Specify the decision rule. Choose a (the level of significance) and determine the critical values from Appendix D.

23 Comparing Two Means: Paired Samples
Steps in Testing Two Proportions Step 3: Calculate the test statistic t Step 4: Make the decision Reject H0 if the test statistic falls in the rejection region(s) as defined by the critical values.

24 Comparing Two Means: Paired Samples
Excel’s Paired Difference Test Excel gives you the option of choosing either a one-tailed or two-tailed test and also gives the p-value.

25 Comparing Two Means: Paired Samples
Analogy to Confidence Interval A two-tailed test for a zero difference is equivalent to asking whether the confidence interval for the true mean difference md includes zero.

26 Comparing Two Proportions
Testing for Zero Difference: p1 = p2 To compare two population proportions, p1, p2, use the following hypotheses

27 Comparing Two Proportions
Testing for Zero Difference: p1 = p2 The sample proportion p1 is a point estimate of p1: The sample proportion p2 is a point estimate of p2:

28 Comparing Two Proportions
Pooled Proportion If H0 is true, there is no difference between p1 and p2, so the samples are pooled (averaged) into one “big” sample to estimate the common population proportion. p = x1 + x2 n1 + n2 = number of successes in combined samples combined sample size

29 Comparing Two Proportions
Test Statistic If the samples are large, p1 – p2 may be assumed normally distributed. The test statistic is the difference of the sample proportions divided by the standard error of the difference. The standard error is calculated by using the pooled proportion. The test statistic for the hypothesis p1 = p2 is: calc

30 Comparing Two Proportions
Test Statistic The test statistic for the hypothesis p1 = p2 may also be written as: calc

31 Comparing Two Proportions
Steps in Testing Two Proportions Step 1: State the hypotheses Step 2: Specify the decision rule Choose a (the level of significance) and determine the critical value(s). Step 3: Calculate the Test Statistic Assuming that p1 = p2, use a pooled estimate of the common proportion.

32 Comparing Two Proportions
Steps in Testing Two Proportions Step 4: Make the decision Reject H0 if the test statistic falls in the rejection region(s) as defined by the critical value(s). For example, for a two-tailed test and a = .05

33 Comparing Two Proportions
Using the p-Value The p-value is the level of significance that allows us to reject H0. The p-value indicates the probability that a sample result would occur by chance if H0 were true. The p-value can be obtained from Appendix C-2 or Excel using =NORMDIST(z). A smaller p-value indicates a more significant difference.

34 Comparing Two Proportions
Checking Normality Check the normality assumption with np > 10 and n(1-p) > 10. Each of the two samples must be checked separately using each sample proportion in place of p. If either sample proportion is not normal, their difference cannot safely be assumed normal. The sample size rule of thumb is equivalent to requiring that each sample contains at least 10 “successes” and at least 10 “failures.”

35 Comparing Two Proportions
Small Samples If sample sizes do not justify the normality assumption, treat each sample as a binomial experiment. If the samples are small, the test is likely to have low power. Must Sample Sizes Be Equal? Unequal sample sizes are common and the formulas still apply.

36 Comparing Two Proportions
Using Software for Calculations MegaStat gives the option of entering sample proportions or the fractions. MINITAB gives the option of non-pooled proportions. Figure 10.15

37 Comparing Two Proportions
Analogy to Confidence Intervals The confidence interval for p1 – p2 without pooling the samples is: If the confidence interval does not include 0, then we reject the null hypothesis.

38 Comparing Two Proportions
Testing for Non-Zero Differences (Optional) Testing for equality is a special case of testing for a specified difference D0 between two proportions. If the hypothesized difference D0 is non-zero, the test statistic is: calc

39 Comparing Two Variances
Format of Hypotheses To test whether two population means are equal, we may also need to test whether two population variances are equal. The hypotheses may be stated as

40 Comparing Two Variances
Format of Hypotheses An equivalent way to state these hypotheses would be to use ratios since the variance can never be less than zero and it would not make sense to take the difference between two variances.

41 Comparing Two Variances
The F Test The test statistic is the ratio of the sample variances: If the variances are equal, this ratio should be near unity: F  1

42 Comparing Two Variances
The F Test If the test statistic is far below 1 or above 1, we would reject the hypothesis of equal population variances. The numerator s12 has degrees of freedom n1 = n1 – 1 and the denominator s22 has degrees of freedom n2 = n2 – 1. The F distribution is skewed with the mean > 1 and its mode < 1.

43 Comparing Two Variances
The F Test Critical values for the F test are denoted FL (left tail) and FR (right tail). A right-tail critical value FR may be found from Appendix F using n1 and n2 degrees of freedom. FR = Fn1,n2 A left-tail critical value FR may be found by reversing the numerator and denominator degrees of freedom, finding the critical value from Appendix F and taking its reciprocal: FL = 1/Fn2,n1

44 Comparing Two Variances
Steps in Testing Two Variances Step 1: State the hypotheses, for example H0: s12 = s22 H1: s12 ≠ s22 Step 2: Specify the decision rule Degrees of freedom are: Numerator: n1 = n1 – 1 Denominator: n2 = n2 – 1 Choose a and find the left-tail and right-tail critical values from Appendix F.

45 Comparing Two Variances
Steps in Testing Two Variances Step 3: Calculate the test statistic Step 4: Make the decision Reject H0 if the test statistic falls in the rejection regions as defined by the critical values.

46 Comparing Two Variances
Comparison of Variances: One Tailed Test Step 1: State the hypotheses, for example H0: s12 = s22 H1: s12 < s22 Step 2: State the decision rule Degrees of freedom are: Numerator: n1 = n1 – 1 Denominator: n2 = n2 – 1 Choose a and find the left-tail critical value from Appendix F.

47 Comparing Two Variances
Comparison of Variances: One Tailed Test Step 3: Calculate the Test Statistic F Step 4: Make the decision Reject H0 if the test statistic falls in the left-tail rejection region as defined by the critical value.

48 Comparing Two Variances
Excel’s F Test Excel allows you to test the equality of variances and gives you a p-value. Figure 10.26

49 Comparing Two Variances
Assumptions of the F Test The F test assumes that the populations being sampled are normal. It is sensitive to non-normality of the sampled populations. MINITAB reports both the F test and an alternative Levene’s test and p-values.

50 Applied Statistics in Business & Economics
End of Chapter 10 10-50


Download ppt "Two-Sample Hypothesis Testing"

Similar presentations


Ads by Google