You are on page 1of 42

Applied Statistics in

Business & Economics,


vu.vo@ueh.edu.vn
Chapter 10
Two-Sample Hypothesis Tests

Chapter Contents

10.1 Two-Sample Tests


10.2 Comparing Two Means: Independent Samples
10.3 Confidence Interval for the Difference of Two Means, 1 - 2
10.4 Comparing Two Means: Paired Samples
10.5 Comparing Two Proportions
10.6 Confidence Interval for the Difference of Two Proportions,
1 - 2
10.7 Comparing Two Variances

10-2
Chapter 10
Two-Sample Hypothesis Tests

Chapter Learning Objectives (LOs)

LO1: Recognize and perform a test for two means with known 1 and 2.
LO2: Recognize and perform a test for two means with unknown 1 and 2.
LO3: Recognize paired data and be able to perform a paired t test.
LO4: Explain the assumptions underlying the two-sample test of means.
LO5: Perform a test to compare two proportions using z.
LO6: Check whether normality may be assumed for two proportions.

10-3
Chapter 10
Two-Sample Hypothesis Tests

Chapter Learning Objectives (LOs)

LO7: Use Excel to find p-values for two-sample tests using z or t.


LO8: Carry out a test of two variances using the F distribution.
LO9: Construct a confidence interval for 1 2 or 1 2 (optional).

10-4
Chapter 10
10.1 Two-Sample Tests

What is a Two-Sample Test


A Two-sample test compares two sample estimates with each
other.
A one-sample test compares a sample estimate to a non-sample
benchmark.

Basis of Two-Sample Tests

The logic of two-sample tests is based on the fact that two


samples drawn from the same population may yield different
estimates of a parameter due to chance.

10-5
Chapter 10
10.1 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.

10-6
Chapter 10
10.1 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

10-7
Chapter 10
LO1 10.2 Comparing Two Means: Independent Samples

LO1: Recognize and perform a test for two means with known
1 and 2.

Format of Hypotheses

The hypotheses for comparing two independent population


means 1 and 2 are:

10-8
Chapter 10
LO4 10.2 Comparing Two Means: Independent Samples

LO4: Explain the assumptions underlying the two-sample test of means.

Case 1: Known Variances


When the variances are known, use the normal distribution for the
test (assuming a normal population).
The test statistic is:

10-9
Chapter 10
LO2 10.2 Comparing Two Means: Independent Samples

LO2: Recognize and perform a test for two means with unknown
1 and 2.
Case 2: Unknown Variances, Assumed Equal

Since the variances are unknown, they must be estimated


and the Students 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-10
Chapter 10
LO2 10.2 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 12 and 22 with


s12 and s22 in the known variance z formula, then use a Students t
test with adjusted degrees of freedom.

10-11
Chapter 10
LO2 10.2 Comparing Two Means: Independent Samples

Case 3: Unknown Variances, Assumed Unequal

Welch-Satterthwaite test

A Quick Rule for degrees of freedom is to use min(n1 1, n2 1).

10-12
Chapter 10
10.2 Comparing Two Means: Independent Samples

Summary for the Test Statistic


If the population variances 12 and 22 are known, then use the
normal distribution.
If population variances are unknown and estimated using s12 and
s22, then use the Students t distribution.

10-13
Chapter 10
10.2 Comparing Two Means: Independent Samples

Steps in Testing Two Means

Step 1: State the hypotheses


Step 2: Specify the decision rule
Choose (the level of significance) and determine the critical
value(s).
Step 3: Calculate the Test Statistic
Step 4: Make the decision Reject H0 if the test statistic falls in the
rejection region(s) as defined by the critical value(s).
Step 5: Take action based on the decision.

10-14
Chapter 10
10.2 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.

Must Sample Sizes Be Equal?


Unequal sample sizes are common and the formulas still apply.

10-15
Chapter 10
10.2 Comparing Two Means: Independent Samples

Large Samples

For unknown variances, if both samples are large (n1 30 and


n2 30) and the population isnt badly skewed, use the following
formula with appendix C.

Caution: Three Issues


1. Are the populations skewed? Are there outliers?

Check using histograms and/or dot plots of each sample.


t tests are OK if moderately skewed, especially if samples are
large. Outliers are more serious.
10-16
Chapter 10
10.2 Comparing Two Means: Independent Samples

Caution: Three Issues


2. 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.
3. Is the difference important as well as significant?
A small difference in means or proportions could be significant if
the sample size is large.

10-17
Chapter 10
LO9 10.3 Confidence Interval for the Difference of Two
Means 1 - 2

LO9: Construct a confidence interval for 1 2 or 1 - 2 (optional)

10-18
Chapter 10
LO9 10.3 Confidence Interval for the Difference of Two
Means 1 - 2

LO9: Construct a confidence interval for 1 2 or 1 - 2 (optional)

10-19
Chapter 10
LO9 10.3 Confidence Interval for the Difference of Two
Means 1 - 2

LO9: Construct a confidence interval for 1 2 or 1 - 2 (optional)

10-20
Chapter 10
LO3 10.4 Comparing Two Means: Paired Samples

LO3: Recognize paired data and be able to perform a paired t test.

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.

10-21
Chapter 10
LO3 10.4 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 and standard deviation for the differences d are given
below.

The test statistic is just for a one-sample t-test.

10-22
Chapter 10
LO3 10.4 Comparing Two Means: Paired Samples

Steps in Testing Paired Data


Step 1: State the hypotheses, for example
H0: d = 0
H1: d 0
Step 2: Specify the decision rule.
Choose (the level of
significance) and
determine the critical
values from Appendix D.
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

10-23
Chapter 10
LO3 10.4 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 d
includes zero.

10-24
Chapter 10
LO5 10.5 Comparing Two Proportions
LO5: Perform a test to compare two proportions using z.

Testing for Zero Difference: 1 = 2

To compare two population proportions, 1, 2, use the following


hypotheses

10-25
Chapter 10
LO5 10.5 Comparing Two Proportions
Testing for Zero Difference: 1 = 2

Sample Proportions

The sample proportion p1 is a point estimate of 1 and


p2 is a point estimate of 2:

10-26
Chapter 10
LO5 10.5 Comparing Two Proportions
Testing for Zero Difference: 1 = 2

Pooled Proportion
If H0 is true, there is no difference between
1 and 2, so the samples are pooled (or averaged) in order to
estimate the common population proportion.

10-27
Chapter 10
LO5 10.5 Comparing Two Proportions
Testing for Zero Difference: 1 = 2

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 1 = 2 is:

10-28
Chapter 10
LO5 10.5 Comparing Two Proportions
Testing for Zero Difference: 1 = 2

Steps in Testing Two Proportions

Step 1: State the hypotheses


Step 2: Specify the decision rule
Choose (the level of significance) and determine the critical
value(s).
Step 3: Calculate the Test Statistic. Assuming that 1 = 2, use a
pooled estimate of the common proportion.
Step 4: Make the decision Reject H0 if the test statistic falls in the
rejection region(s) as defined by the critical value(s).

10-29
Chapter 10
LO6 10.5 Comparing Two Proportions
LO6: Check whether normality may be assumed for two proportions.

Testing for Zero Difference: 1 = 2

Checking for Normality


We have assumed a normal distribution for the statistic p1 p2.
This assumption can be checked.
For a test of two proportions, the criterion for normality is n 10
and n(1 ) 10 for each sample, using each sample proportion in
place of .
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.
10-30
Chapter 10
10.5 Comparing Two Proportions

Testing for Non-Zero Difference

10-31
Chapter 10
10.6 Confidence Interval for the Difference of Two
Proportions 1 - 2

If the confidence interval does not include 0, then we reject the


null hypothesis.

10-32
Chapter 10
LO8 10.7 Comparing Two Variances
LO8: Carry out a test of two variances using the F distribution
Format of Hypotheses
To test whether two population means are equal, we may also
need to test whether two population variances are equal.

10-33
Chapter 10
LO8 10.7 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

10-34
Chapter 10
LO8 10.7 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 df1 = n1 1 and the
denominator s22 has degrees of freedom df2 = n2 1.
The F distribution is
skewed with the mean > 1
and its mode < 1.

10-35
Chapter 10
LO8 10.7 Comparing Two Variances
The F Test: Critical Values

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
df1 and df2 degrees of freedom.
FR = Fdf1, df2
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/Fdf2, df1

10-36
Chapter 10
LO8 10.7 Comparing Two Variances
Steps in Testing Two Variances

Step 1: State the hypotheses, for example


H 0 : 12 = 2 2
H 1 : 12 2 2
Step 2: Specify the decision rule
Degrees of freedom are:
Numerator: df1 = n1 1
Denominator: df2 = n2 1
Choose a and find the left-tail and right-tail critical values from
Appendix F.

10-37
Chapter 10
LO8 10.7 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.

10-38
Chapter 10
LO8 10.7 Comparing Two Variances

Comparison of Variances: One Tailed Test

Step 1: State the hypotheses, for example


H 0 : 1 2 = 22
H 1 : 1 2 < 22
Step 2: State the decision rule
Degrees of freedom are:
Numerator: df1 = n1 1
Denominator: df2 = n2 1
Choose a and find the left-tail critical value from Appendix F.

10-39
Chapter 10
LO8 10.7 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.

10-40
Chapter 10
LO8 10.7 Comparing Two Variances
EXCELs F Test

10-41
Chapter 10
LO8 10.7 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 Levenes test
and p-values.

10-42

You might also like