Download The Pooled two-sample t procedures

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Psychometrics wikipedia , lookup

Foundations of statistics wikipedia , lookup

History of statistics wikipedia , lookup

Degrees of freedom (statistics) wikipedia , lookup

Confidence interval wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Taylor's law wikipedia , lookup

German tank problem wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
9. Inferences Based on Two Samples
Now that we’ve learned to make inferences
about a single population, we’ll learn how to
compare two populations.
For example, we may wish to compare the
mean gas mileages for two models of
automobiles, or the mean reaction times of
men and women to a visual stimulus.
In this chapter we’ll see how to decide
whether differences exist and how to
estimate the differences between population
means and proportions.
9.1 Comparing two population means:
Independent Sampling
One of the most commonly used significance
tests is the comparison of two population means
1 and  2 .
Two-sample Problems
The goal of inference is to compare the
responses in two groups.
Each group is considered to be a sample
from a distinct population.
The responses in each group are
independent of those in the other group.
A two sample problem can arise from a
randomized comparative experiment that
randomly divides the subjects into two groups
and exposes each group to a different treatment.
The two samples may be of different sizes.
Two-Sample z Statistic
Suppose that x1 is the mean of an SRS of size
n1 drawn from N( 1 ,  1 ) population and that x2
is the mean of an SRS of size n2 drawn from
N(  2 ,  2 ) population. Then the two-sample z
statistic
z
 x1  x2   1   2 
 12
n1

 22
n2
has the standard normal N(0,1) sampling
distribution.
Large Sample Confidence Interval for 1   2
 x1  x2   z 2
 12  22
n1

n2
Assumptions: The two samples are randomly
selected in an independent manner from the two
populations. The sample sizes n1 and n2 are
large enough.
Example for C.I. of 1   2
Let’s look at Example 9.1 in our textbook (page
431).
Example for Test of Significance
Let’s look at Examples 9.2 and 9.3 in our
textbook (page 434 and 435).
In the unlikely event that both population
standard deviations are known, the two-sample
z statistic is the basis for inference about
1   2 . Exact z procedures are seldom used
because  1 and  2 are rarely known.
The two-sample t procedures
Suppose that the population standard deviations
 1 and  2 are not known. We estimate them by
the sample standard deviations s1 and s 2 from
our two samples.
The Pooled two-sample t procedures
The pooled two-sample t procedures are used
when we can safely assume that the two
populations have equal variances. The
modifications in the procedure are the use of the
pooled estimator of the common unknown
variance
2
2
(
n

1
)
s

(
n

1
)
s
1
2
2
.
s 2p  1
n1  n2  2
This is called the pooled estimator of  2 .
When both populations have variance  2 , the
addition rule for variances says that x1  x2 has
variance equal to the sum of the individual
variances, which is
2
n1

2
1 1
  2   
n2
 n1 n2 
The standardized difference of means in this
equal-variance case is
z
( x1  x2 )  ( 1   2 )
1 1


n1 n2
This is a special two-sample z statistic for the
case in which the populations have the same  .
Replacing the unknown  by the estimates s p
gives a t statistic. The degrees of freedom are
n1  n2  2 .
The Pooled Two-Sample t Procedures
Suppose that an SRS of size n1 is drawn from a
normal population with unknown mean 1 and
that an independent SRS of size n2 is drawn
from another normal population with unknown
mean  2 . Suppose also that the two populations
have the same standard deviation. A level C
confidence interval 1   2 given by
( x1  x2 )  t * s p
1 1

n1 n2
Here t* is the value for t (n1  n2  2) density
curve with area C between –t* and t*.
To test the hypothesis H 0 : 1   2 ,compute the
pooled two-sample t statistic
t
x1  x2
1 1
sp

n1 n2
In terms of a random variable T having the
t( n1  n2  2) distribution, the P-value for a test
of H 0 against
H a :   0 is P(T  t )
H a :   0 is P(T  t )
H a :   0 is 2P(T | t | )
Example Take Group 1 to be the calcium group
and Group 2 to be the placebo group. The
evidence that calcium lowers blood pressure
more than a placebo is assessed by testing
H 0 : 1   2
H a : 1   2
Here are the summary statistics for the decrease
in blood pressure:
x
s
Group Treatment n
1
Calcium 10 5.000 8.743
2
Placebo 11 -0.273 5.901
The calcium group shows a drop in blood
pressure, and the placebo group has a small
increase. The sample standard deviations do not
rule out equal population standard deviations. A
difference this large will often arise by chance in
samples this small. We are willing to assume
equal population standard deviations. The
pooled sample variance is
s 2p
(n1  1) s12  (n2  1) s22

n1  n2  2
(10  1)(8.743) 2  (11  1)(5.901) 2

10  11  2
 54.536 . So that s p  54.536  7.385
The pooled two-sample t statistic is
x1  x2
t
1 1
sp

n1 n2

5.000  (0.273) 5.273

 1.634
1 1
3.227
7.385

10 11
The P-value is P(T  1.634 ) , where T has t(19)
distribution. From Table, we can see that P lies
between 0.05 and 0.10. The experiment found
no evidence that calcium reduces blood
pressure (t=1.634, df=19, 0.05<P<0.10).
Example We estimate that the effect of calcium
supplementation is the difference between the
sample means of the calcium and the placebo
groups, x1  x2  5.273 mm. A 90% confidence
interval for 1   2 uses the critical value
t*=1.729 from the t(19) distribution. The interval
is
( x1  x2 )  t * s p
1 1

n1 n2
= (5.000  (0.273))  (1.729 )(7.385)
1 1

10 11
= 5.273  5.579
We are 90% confident that the difference in
means is in the interval (-0.306, 10.852). The
calcium treatment reduced blood pressure by
about 5.3mm more than a placebo on the
average, but the margin of error for this estimate
is 5.6mm.
Approximate Small-Sample Procedures when
both populations have different variance
2
2
( 1   2 )
Suppose that the population standard
deviations  1 and  2 are not known. We
estimate them by the sample standard
deviations s1 and s 2 from our two samples.
Equal Sample Sizes ( n1
 n2  n )
The confidence interval for 1   2 is given by
( x1  x2 )  t
2
s12  s22
n
To test the hypothesis H 0 : 1   2 , compute the
two-sample t statistic
t
x1  x2
s12  s22
n
where t is based on df v  n1  n2  2  2(n  1) .
Unequal Sample Sizes ( n1
 n2 )
The confidence interval for 1   2 is given by
( x1  x2 )  t
s12 s22

n1 n2
2
To test the hypothesis H 0 : 1   2 , compute the
two-sample t statistic
t
x1  x2
s12 s22

n1 n2
where t is based on degree of freedom
2
s s 
  
n1 n2 

.
v
2
2
 s12   s22 
   
 n1    n2 
n1  1 n2  2
2
1
2
2
Note: The value of v will generally not be an
integer. Round v down to the nearest integer to
use the t table.
The Two-Sample t Significance test
Suppose that an SRS of size n1 is drawn from a
normal population with unknown mean 1 and
that an independent SRS of size n2 is drawn
from another normal population with unknown
mean  2 . To test the hypothesis H 0 : 1   2 ,
compute the two-sample t statistic
t
x1  x2
s12 s22

n1 n2
and use P-values or critical values for the t(k)
distribution, where the degrees of freedom k are
the smaller n1  1 and n2  1.
Example An educator believes that new
directed reading activities in the classroom will
help elementary school pupils improve some
aspects of their reading ability. She arranges for
a third-grade class of 21 students to take part in
these activities for an eight-week period. A
control classroom of 23 third-graders follows
the same curriculum without the activities. At
the end of the eight weeks, all students are
given a Degree of Reading Power (DRP) test,
which measures the aspects of reading ability
that the treatment is designed to improve. The
summary statistics using Excel are
Treatment Group Control Group
Mean
Standard Error
Median
Mode
Standard
Deviation
Sample Variance
Kurtosis
Skewness
Range
Minimum
Maximum
Sum
Count
51.47619048
2.402002188
53
43
41.52173913
3.575758061
42
42
11.00735685
121.1619048
0.803583546
-0.626692173
47
24
71
1081
21
17.14873323
294.0790514
0.614269919
0.309280608
75
10
85
955
23
Because we hope to show that the treatment
(Group 1) is better than the control (Group 2),
the hypotheses are
H 0 : 1   2 vs. H a : 1   2
The two-sample t statistic is
t
x1  x2
s12
n1

s22
n2

51.48  41.52
2
11.01 17.15

21
23
2
 2.31
The P-value for the one-sided test is
P(T  2.31) . The degree of freedom k is equal
to the smaller of n1  1  21  1  20 and
n2  1  23  1  22 . Comparing 2.31 with
entries in Table for 20 degrees of freedom, we
see that P lies between 0.02 and 0.01. The
data strongly suggest that directed reading
activity improves the DRP score (t=2.31, df=20,
0.01<P<0.02).
Example We will find a 95% confidence interval
for the mean improvement in the entire
population of third-graders. The interval is
s12 s22
( x1  x2 )  t *

n1 n2
11.012 17.15 2
 (51.48  41.52)  t *

21
23
 9.96  4.31  t *
From Example, we have the t(20) distribution.
Table D gives t*  t0.025, 20  2.086 . With this
approximation we have
9.96  4.31  t*  9.96  4.31  2.086
 9.96  8.99  (1.0 , 18.9)
We can see that zero is outside of the interval
(1.0, 18.9). We can say that “ 1   2 is not
equal to zero”.
9.2 Comparing two population means: Paired
Difference Experiments
Matched Pairs t procedures
One application of the one-sample t procedure is
to the analysis of data from matched pairs
studies. We compute the differences between
the two values of a matched pair (often before
and after measurements on the same unit) to
produce a single sample value. The sample
mean and standard deviation of these
differences are computed.
Paired Difference Confidence Interval for
 D  1  2
Large Sample
D
xD  z 2
nD
 xD  z 2
sD
nD
Assumption: The sample differences are
randomly selected from the population of
differences.
Small Sample
sD
nD
xD  t 2
where t
2
is based on
(nD  1) degrees of
freedom.
Assumptions:
1. The relative frequency distribution of the
population of differences is normal.
2. The sample differences are randomly
selected from the population of differences.
Paired Difference Test of Hypothesis for
 D  1  2
One-Tailed Test
H 0 :  D  D0
H a :  D  D0 or
H 0 :  D  D0
H a :  D  D0
Two-Tailed Test
H 0 :  D  D0
H a :  D  D0
Large Sample
Test statistics
z
xD  D0
D
nD

xD  D0
sD
nD
Assumption: The sample differences are
randomly selected from the population of
differences.
Small Sample
Test statistics
xD  D0
t
sD
nD
where t
2
is based on
(nD  1) degrees of
freedom.
Assumptions:
1.The relative frequency distribution of the
population of differences is normal.
2.The sample differences are randomly
selected from the population of differences.
Example To analyze these data, we first
substract the pretest score from the posttest
score to obtain the improvement for each
student. These 20 differences form a single
sample. They appear in the “Gain” columns in
Table 7.1. The first teacher, for example,
improved from 32 to 34, so the gain is 34-32=2.
To assess whether the institute significantly
improved the teachers’ comprehension of
spoken French, we test
H 0 : D  0
H a : D  0
Here  is the mean improvement that would be
achieved if the entire population of French
teachers attended a summer institute. The null
hypothesis says that no improvement occurs,
and H a says that posttest scores are higher on
the average. The 20 differences have
xD  2.5 and sD  2.893
The one-sample t statistic is
t
xD  D0
2.5  0

 3.86
sD nD 2.893 20
The P-value is found from the t(19) distribution
(n-1=20-1=19). Table shows that 3.86 lies
between the upper 0.001 and 0.0005 critical
values of the t(19) distribution. The P-value lies
between 0.0005 and 0.001.
“The improvement in score was significant
(t=3.86, df=19, p=0.00053).”
Example A 90% confidence interval for the
mean improvement in the entire population
requires the critical value t 2  1.729 from
Table. The confidence interval is
xD  t
2
sD
2.893
 2.5  1.729
nD
20
 2.5  1.12  (1.38, 3.62)
The estimated average improvement is 2.5
points, with margin of error 1.12 for 90%
confidence. Though statistically significant, the
effect of the institute was rather small.
9.3 Comparing two population proportions:
Independent Sampling
Suppose a presidential candidate wants to
compare the preference of registered voters in
the northeastern United States (NE) to those in
the southeastern United States (SE). Such a
comparison would help determine where to
concentrate campaign efforts.
Properties of the Sampling Distribution of
( pˆ1  pˆ 2 )
1. The mean of the sampling distribution of
( pˆ1  pˆ 2 ) is ( p1  p2 ) that is,
E( p
ˆ1  pˆ 2 ) = ( p1  p2 )
which means that ( p
ˆ1  pˆ 2 ) is an unbiased
estimator of ( p1  p2 ) .
2. The standard deviation of the sampling
distribution of ( p
ˆ1  pˆ 2 ) is
p1 (1  p1 ) p1 (1  p1 )
 ( pˆ1  pˆ 2 ) 

n1
n2
3. If the sample sizes n1 and n2 are large, the
sampling distribution of ( p
ˆ1  pˆ 2 ) is
approximately normal.
Large-Sample Confidence Interval for
( pˆ1  pˆ 2 )  z 2
 ( pˆ1  pˆ 2 )  z 2
( p1  p2 )
p1 (1  p1 ) p1 (1  p1 )

n1
n2
pˆ1 (1  pˆ1 ) pˆ1 (1  pˆ1 )

n1
n2
Assumption: The two samples are independent
random samples. Both samples should be large
enough that the normal distribution provides an
adequate approximation to the sampling
distribution of p̂1 and p̂2 .
Large-Sample Test of Hypothesis about
( p1  p2 )
One-Tailed Test
H 0 : ( p1  p2 )  0
H a : ( p1  p2 )  0 or
H 0 : ( p1  p2 )  0
H a : ( p1  p2 )  0
Two-Tailed Test
H 0 : ( p1  p2 )  0
H a : ( p1  p2 )  0
Large Sample
Test statistics
z
( pˆ 1  pˆ 2 )
 ( pˆ  pˆ
1
Note:
2)
 ( pˆ  pˆ ) 
1
2

p1 (1  p1 ) p1 (1  p1 )

n1
n2
1 1
pˆ (1  pˆ )  
 n1 n2 
x1  x2
where p
ˆ
n1  n2
Assumption: Same as for large-sample
confidence interval for ( p1  p2 ) .
Let’s look at Example 9.6 in our textbook (page
471).
9.4 Determining The Sample Size
Determination of Sample Size for Estimating
(1  2 )
To estimate ( 1  2 ) to within a given bound
B with probability (1   ) , use the following
formula to solve for equal sample sizes that will
achieve the desired reliability:
n1  n2 
( z 2 ) 2 ( 12   22 )
B2
You will need to substitute estimates for the
2
2
values of  1 and  2 before solving for the
sample size. These estimates might be sample
2
2
variances s1 and s2 from prior sampling, or
from an educated guess based on the rangethat is, s  R 4.
Let’s look at Example 9.8 in our textbook (page
479).
Determination of Sample Size for Estimating
( p1  p2 )
To estimate ( p1  p2 ) to within a given bound
B with probability (1   ) , use the following
formula to solve for equal sample sizes that will
achieve the desired reliability:
n1  n2 
( z 2 ) 2 ( p1q1  p2 q2 )
B2
You will need to substitute estimates for the
values of p1 and p2 before solving for the
sample size. These estimates might be based
on prior samples, obtained from educated
guesses or, most conservatively, specified as
p1  p2  0.5.
Let’s look at Example 9.9 in our textbook (page
480).