Transcript Document

381
Hypothesis Testing
(Testing with Two Samples-I)
QSCI 381 – Lecture 30
(Larson and Farber, Sect 8.1)
Two Samples Tests - Overview
381


So far we have compared the results of
a sample from a population with a fixed
value.
We will develop methods to test claims
about differences between the values
for parameters of two populations, not
about the values for the parameters
themselves.
381
Null and Alternative Hypotheses

Let 1 and 2 be the values of a
parameter for two populations. The
possible null and alternative hypotheses
are:
 H 0 : 1  2

 H a : 1  2
 H 0 : 1  2

 H a : 1  2
 H 0 : 1  2

 H a : 1  2
These two null hypotheses are different – why?
381
Conditions for Comparing Two Means
1.
2.
3.
The samples must be taken randomly
from each population.
The sample from each population
must be independent.
The sample size must be at least 30
(or each population must be normal
with a known standard deviation).
Comparing Two Means-I
381

Given these conditions, the sampling
distribution for the difference between the
two sample means, i.e. x1  x2 is normal
with mean and standard error:
 x  x   x   x  1  2
1
2
1

2
 x x    
1
2
2
x1
2
x2

 12
The variance of the sampling distribution is
the sum of variances of the individual
sampling distributions.
n1

 22
n2
Comparing Two Means-II
381

A
can be used to test
the difference between two population means
1 and 2 when a large sample (n  30) is
selected randomly from each population and
the samples are independent. The test statistic
is x1  x2 and the standardized test statistic is:
z
( x1  x2 )  ( 1  2 )
 x x
1
2
Comparing Two Means-III
381

Notes:


If the sample size is “large”, 1 and 2 can
be replaced by s1 and s2.
If the sample size is “not large” this test
cannot be used unless the populations are
normal and the standard deviations are
known.
Example-I
381

You are evaluating two labs that process biological
samples. The following data have been collected
from the two labs. Test the hypothesis (=0.05) that
the two labs differ in the time to process a sample.
n
Average time
to process
Standard
deviation
Lab1
45
Lab2
90
17.6
18.5
2.5
1.2
Example-I
381
1.
2.
3.
4.
H0: 1= 2; Ha: 1 2.
=0.05
This is a two-sided test at the 5%
level. The rejection region is |z|>1.96.
The standardized test statistic is:
z
( x1  x2 )  ( 1  2 )
 x x
1
5.
2

17.6  18.5  0
2
2
 2.29
2.5 1.2

45
90
We reject the null hypothesis at the
5% level.
Example-II
381

Two classes of students use different study materials. A control
group uses a standard approach, and a second group (random
allocation of students to groups) uses a new study approach.
The following are data collected from the two groups. Test the
hypothesis that using the new materials improves the mean
score by more than 10 points. Assume =0.05.
Group 1
Group 2
n
35
35
Mean Score
47
58
S.D. of score
3.4
3.7
Example-II
381
1.
2.
3.
4.
H0: 2 - 110; Ha: 2 - 1>10.
=0.05
This is a right-sided test at the 5%
level. The rejection region is z>1.64.
The standardized test statistic is:
z
( x1  x2 )  ( 1  2 )
 x x
1
5.
2

58  47  10
2
2
 1.17
3.4 3.7

35
35
We fail to reject the null hypothesis at
the 5% level.
Confidence Intervals
381

A c-confidence interval for 1-2 can be
constructed as follows (note that n130 and
n230):
( x1  x2 )  zc
 12
n1

 22
n2
 1  2  ( x1  x2 )  zc
 12
n1

 22
n2
Confidence Intervals
(Example)
381

Construct a 95% confidence interval for
1-2 for example 2.
x1  x2  11;  x1  x2  0.847
11 1.96*0.847  1  2  11  1.96*0.847
9.34  1  2  12.66
Can anyone see a relationship between confidence
intervals and hypothesis tests?