"hen the
actual mean is
j=j
# and not
j
$
5or a large sample one si"e" test say "ith alternati%e hypothesis
H
a
: jj
$
the acceptance region for the null hypothesis is determined once "e specify
o
and is
gi%en by the condition that
z
o
X j
$
c/ .n
9ote that the statistic on the right is approximately standard normal only "hen the null
hypothesis holds !he acceptance or re6ection region is determined by acting as if the
null hypothesis does hold )f the actual population mean is
j=j
# then "e can re0"rite
the abo%e acceptance region as
z
o
X j
$
c/ .n
=
X j
#
c/ .n
+
j
#
j
$
c/ .n
or z
o
+
j
$
j
#
c/ .n
Z=
X j
#
c/ . n
Z)=P
(
z
=z
o
+
j
$
j
#
c/ .n
Z=
X j
#
c/ .n
)
f
accepting
H
$
: j=j
$ "hen in fact
j=j
# or in other "ords the probability of satisfying
the abo%e acceptance region condition is 6ust
=P( z
Z)=P
(
z
=z
o
+
j
$
j
#
c/ .n
Z=
X j
#
c/ .n
)
"here the first e7uality is 6ust the definition of the +0critical %alue
z
and the second is
6ust the definition of the type )) error probability
of accepting
H
$
: j=j
$ "hen
j=j
# !hus for the type )) error probability to be less than or :EE; #$ page &
e7ual to
z
o
+
j
$
j
#
c/ .n
or
c( z
+z
o
)
j
$
j
#
.n so that n
(
c( z
+z
o
)
j
$
j
#
)
2
.
as stated in problem ?&( @imilar reasoning leads to the same result "hen the
alternati%e hypothesis is
H
a
: j>j
$
so that the acceptance region (for accepting the null hypothesis) is
X j
$
c/ .n
z
o
5or a large sample t#o si"e" test (as in problem ?&5) the acceptance region for
accepting the null hypothesis is
z
o/2
X j
$
c/ . n
z
o/2
Again the abo%e statistic is only standard normal "hen the null hypothesis is true. but
"hen
j=j
# "e re0"rite this as
z
o/2
X j
$
c/ .n
=
X j
#
c/ . n
+
j
#
j
$
c/ .n
z
o/2
or z
o/ 2
+
j
$
j
#
c/ .n
Z=
X j
#
c/ .n
z
o/ 2
+
j
$
j
#
c/ .n
means
P
(
z
o/2
+
j
$
j
#
c/ .n
Z=
X j
#
c/ .n
z
o/ 2
+
j
$
j
#
c/ .n
)
or in other "ords the sample si+e n must be large enough so that the abo%e bound holds
9o" for small
o
say
o#$
as is customary in statistical tests. the difference
bet"een the left and right hand sides of the abo%e ine7uality for the standard normal
%ariable Z is
2 z
o/ 2
2 z
$5
=2(#A(5)>&
is larger than & ("hich for a standard normal is & standard de%iations) :hen the actual
%alue of the population mean
j
#
j
$ is smaller than the null hypothesis %alue
j
$
for large enough n the left most %alue
z
o/2
+
j
$
j
#
c/ .n
"ill get large and the ine7uality
for the probability "ill hold pro%ided
z
z
o/ 2
+
j
$
j
#
c/ .n
or
c( z
+z
o/ 2
)
j
$
j
#
.n so that n
(
c( z
+z
o/ 2
)
j
$
j
#
)
2
as stated in problem ?&5 5or small
"ill get small as n gets large )n this case it is the left hand
bound
z
o/ 2
+
j
$
j
#
c/ .n
"e can ignore since it is & standard :EE; #$ page (
de%iations to the left of a large negati%e %alue
z
"hen
x=#$+
$+2++(+5+1+#+&
1
=#$+(=#(
and "ith sample %ariance
s
2
=
#
?
( (
2
+2
2
+5
2
+$
2
+#
2
+(
2
+&
2
+#
2
)=
?2
?
or standard de%iation
s=&2$?
:e test
H
$
: j=#$5
against
H
a
: j>#$5
Dsing the
t0critical %alue for a t random %ariable "ith parameter n F # , ? degrees of freedom
t =
xj
$
s/ .n
=
#(#$5
&2$?/ .1
=&$1?>t
$#
=21
exceeds the critical %alue so "e re6ect the null hypothesis at significance le%el $# :e
conclude that the e%idence fa%ors
H
a
: j>#$5
, P( accept
H
$
: j=j
$ "hen really
j=j
# )
, P(z
o/2
X j
$
c/ .n
=
X j
#
c/ .n
+
j
#
j
$
c/ .n
z
o/ 2
) :EE; #$ page A
, P(z
o/2
+
j
$
j
#
c/ .n
Z=
X j
#
c/ .n
z
o/ 2
+
j
$
j
#
c/ .n
)
)f
j
#
>j
$ . n is sufficiently large and
"ill be negati%e and "e "ill be able to ignore the left hand ine7uality
since this %alue is more than & standard de%iations to the left of the negati%e %alue
(approximately
z
) on the right
EXAMPLE  Broblem ?5& of the text refers to the example on page 25A : @uppose that
the length of certain machine parts may be loo*ed upon as a random %ariable ha%ing
normal distribution "ith a mean of 2$$$ cm and a standard de%iation of $5$ cm :e
"ant to test the null hypothesis
H
$
: j=2$$$ ( =j
$
)
against the t"o0sided
alternati%e
H
a
: j2$$$
at significance le%el
o=$5
for a sample of si+e n , &$ Ealculate the type )) error probability
"hen :
a)
j=2$2$ ( =j
#
)
=y the abo%e discussion this is
=P(z
o/ 2
+
j
$
j
#
c/ .n
=#A+
22$2$
$5$/.&$
=#A
2
5
.&$Z#A
2
5
.&$=2&$)
P( Z2&$)=($1A
or about (#8
:e can safely ignore the left hand portion of the ine7uality since it is 2(#A) or almost (
standard de%iations to the left of the right hand %alue
2&$
so dropping it "ill not
change the probability to ( decimal places accuracy
b)
j=2$&$ ( =j
#
)
!he same reasoning no" gi%es
=P(#A
&
5
.&$Z#A
&
5
.&$=#&2A&) P( Z#&2A&) = $?A1
or about 18
c)
j=2$($ ( =j
#
)
=P(#A
(
5
.&$Z#A
(
5
.&$=2(2#?) P( Z2(2#?) = $$?1
or ?18
(a fraction of a percent)
Tests comparing the means (rom t#o poplations
)f "e consider t"o independent small samples from (approximately) normal populations
"ith population means
j
#
and j
2 or t"o large samples of si+es
n
#
&$
and
n
2
&$
so that the central limit theorem (assuming only finite %ariances) applies. then the t"o
sample means
X
# and
X
2 are each approximately normal (exactly normal "hen the
populations are exactly normal). and their difference
X
#
X
2 being a linear
combination of normals is also (approximately) normal 3ence under the assumption of
the null hypothesis
H
$
:j
#
j
2
=6
:EE; #$ page ?
the standardi+ed (approximately) normal %ariable
Z=
X
#
X
2
6
.
c
#
2
n
#
+
c
2
2
n
2
may be used to test the null hypothesis "ith the usual critical (re6ection) regions for one
sided or t"o sided tests :hen
n
#
&$
and
n
2
&$
it is usually safe to replace the
population %ariances by the sample %ariances so that "e may use instead
Z=
X
#
X
2
6
.
S
#
2
n
#
+
S
2
2
n
2
"hen n
#
&$ and n
2
&$
.mith.atterth#aite ttest 5or small samples from t"o independent normal
populations "ith possibly different %ariances. the same statistic gi%en abo%e then has a
t0distribution !hat is
t =
X
#
X
2
6
.
S
#
2
n
#
+
S
2
2
n
2
"here in the @mith0@atterth"aite test the number of degrees of freedom
+
is estimated
by the formula ( see 3: problem ??$ a) in the text )
+=
(
s
#
2
n
#
+
s
2
2
n
2
)
2
(s
#
2
/ n
#
)
2
n
#
#
+
( s
2
2
/ n
2
)
2
n
2
#
9ote that the number of degrees of freedom is a random %ariable in this test
T#osample ttest + 5or small samples from a normal population ha%ing approximately
e7ual %ariances c
2
(usually safe to assume if the same %ariances differ in ratio by less
than a factor of () . it is customary to pool the sample %ariances thus utili+ing the sum
of s7uared de%iations from the means for each of the t"o samples Dsing the
poole" sample variance S
p
2
to estimate c
2
common to both populations. the
random %ariable
t =
X
#
X
2
6
S
p
.
#
n
#
+
#
n
2
"here S
p
2
=
( n
#
#)S
#
2
+(n
2
#) S
2
2
n
#
+n
2
2
=
( X
i
X
#
)
2
+( X
i
X
2
)
2
n
#
+n
2
2
has a t0distribution "ith
+=n
#
+n
2
2
degrees of freedom !he usual re6ection regions for one and t"o sided t0tests then apply
9ote : aside from the different formulas for the number of degrees of freedom. the
abo%e @mith0@atterth"aite t turns into this t random %ariable "hen "e replace both
sample %ariances by the pooled %ariance S
p
2
:EE; #$ page 1
)n the case of une7ual %ariances it may be possible to transform both of the data samples
so that under some function of the old data. the t"o (transformed) data samples "ill
ha%e approximately e7ual %ariances so that the abo%e pooled %ariance t"o0sample t0test
method then applies (!he transformation must be applied to both sets of data)
EXAMPLE / Broblem ?A( (similar to 3: problem ?A5) T#o sample Z test e0ample
(large sample) 9ote : the ans#er in the 'ack o( the 'ook to HW /1& is incorrect 2
An in%estigation of 2 *inds of photocopying e7uipment sho"ed that?# failures of the #
st
*ind of e7uipment too* on a%erage 1&2 minutes to repair "ith a standard de%iation of
#& minutes "hile ?5 failures of the 2
nd
*ind of e7uipment too* on a%erage $1
minutes to repair "ith standard de%iation 2#( minutes
a) !est the null hypothesis
H
$
: j
#
j
2
=$ against H
a
: j
#
j
2
$
at significance le%el
o=$5
@ince "e are dealing "ith large sample si+es "e may use
Z=
X
#
X
2
6
.
S
#
2
n
#
+
S
2
2
n
2
=
1&2$1
.
(#&)
2
?#
+
( 2#()
2
?5
=
?A
.##&52(?#&A
=2255A&2? "ith 6=$ here
@ince
z
o/ 2
=z
$25
=#A
and the obser%ed %alue falls outside the inter%al from 0#A to
#A "e re6ect the null hypothesis and conclude there is a difference in mean repair times
for the t"o *inds of e7uipment
b) 5ind the type )) error probability
"hen
6=j
#
j
2
=#2
!his is the probability of accepting
H
$
: j
#
j
2
=$
"hen
6=j
#
j
2
=#2
or
,
P
(
#A
X
#
X
2
.
S
#
2
n
#
+
S
2
2
n
2
=Z
#2
.
S
#
2
n
#
+
S
2
2
n
2
#A
)
, P(#A+
#2
.##&52(?#&A
Z#A+
#2
.##&52(?#&A
)
P (#A+
#2
.##&52(?#&A
=#A$#525&&Z )
or
, $5(?
:e ignored the %alue on the right of the ine7uality "hich is 2(#A) , &2 standard
de%iations to the right of the %alue #A$#5 on the left. so more than 55 standard
de%iations to the right of $ since the probability that Z is greater than 55 is negligible
EXAMPLE 3 Broblem ?A1 (li*e 3: ?A) t#o sample )onesi"e"* ttest e0ample
As part of an industrial training program. some trainees are instructed by Method A.
"hich is straight computer0based instruction. and some are instructed by Method =.
"hich also in%ol%es the personal attention of an instructor )f random samples of si+e #$
are ta*en from large groups of trainees instructed by each of these t"o methods. and the
scores "hich they obtained in an appropriate achie%ement test are I :EE; #$ page 
Method A : ?#. ?5. A5. A. ?&. AA. A1. ?#. ?(. A1
Method =: ?2. ??. 1(. ?1. A. ?$. ??. ?&. A5. ?5
use the $5 le%el of significance to test the claim that method = is more effecti%e
Assume that the populations sampled can be approximated closely "ith normal
distributions ha%ing the same %ariance
3ere "e test the null hypothesis
H
$
: j
#
j
2
=$
that there is no difference in the means
against the alternati%e hypothesis is
H
a
: j
#
j
2
$
that method = is more effecti%e
>irect calculation gi%es the sample means and %ariances :
x
#
=?$+
#+55#+&(2+#+(2
#$
= ?$
x
2
=?5+
&+2++&A5+22#$+$
#$
= ?(
s
#
2
=
#

(#
2
+5
2
+5
2
+#
2
+&
2
+(
2
+2
2
+#
2
+(
2
+2
2
) =
#$2

s
2
2
=
#

(2
2
+&
2
+#$
2
+(
2
+5
2
+(
2
+&
2
+#
2
+
2
+#
2
) =
2A2

@ince "e ha%e small samples from (approximately) normally distributed populations. "e
use the t"o sample t0test "ith pooled %ariance
S
p
2
=
( n
#
#) S
#
2
+( n
2
#) S
2
2
n
#
+n
2
2
=
 s
#
2
+ s
2
2
#1
=
#$2+2A2
#1
=
&A(
#1
=
#12

t =
X
#
X
2
S
p
.
#
n
#
+
#
n
2
=
?$?(
.
#12
(5
=
#2
.
#12
5
=#111$
:ith
+=n
#
+n
2
2
, #1 degrees of freedom. the t0critical %alue for this one0sided test at
le%el $5 is #?&( !hat is "e "ill re6ect the null hypothesis since the test statistic
t t
$5
=#?&(
is less than minus this %alue :e conclude at significance le%el $5 that the alternati%e
hypothesis (the claim "e are trying to establish) holds. namely that method = is more
effecti%e (as e%idenced by a large negati%e t0%alue)
EXAMPLE 4 Broblem ??$ b) (li*e 3: ??$ a) .mith.atterth#aite ttest e0ample +
!o compare t"o *inds of bumper guards. A of each *ind "ere mounted on a certain *ind
of compact car !hen each car "as run into a concrete "all at 5 miles per hour. and the
follo"ing are the costs of repairs (in dollars) :
=umper guard # : #$?. #(1. #2&. #A5. #$2. ##
=umper guard 2 : #&(. ##5. ##2. #5#. #&&. #2
Dse the $# le%el of significance to test "hether the difference bet"een the t"o sample
means is significant : :e first compute the sample means and %ariances
x
#
=#25+
#1+2&2+($2&A
A
= #2?+#/ &
x
2
=#&$+
(#5#1+2#+&#
A
= #2
:EE; #$ page #$
s
#
2
=
#
5
((2$+#/ &)
2
+(2##/ &)
2
+( (+#/ &)
2
+(&1#/ &)
2
+( 25+#/ &)
2
+(1+#/ &)
2
)
,
#
5
(2$
2
+2#
2
+(
2
+&1
2
+25
2
+1
2
+2( 2$/ &2#/ &+(/ &&1/ &+25/ &+1/&)+A/)
, 5102J#5
s
2
2
=
#
5
(5
2
+#(
2
+#?
2
+22
2
+(
2
+$
2
)=2$2
Dsing the null hypothesis %alue of
H
$
: j
#
j
2
=6
, $ difference bet"een the means
gi%es
t =
X
#
X
2
6
.
S
#
2
n
#
+
S
2
2
n
2
=
5/ &
.
#
A
(512/#5+2$2)
= #((&(
:e estimate the number of degrees of freedom
+
in the @mith0@atterth"aite test by
+=
(
s
#
2
n
#
+
s
2
2
n
2
)
2
(s
#
2
/ n
#
)
2
n
#
#
+
( s
2
2
/ n
2
)
2
n
2
#
=
(#&&+#(/ (5)
2
#
5
(((512/ #5)/ A)
2
+(2$2/ A)
2
)
= 1$&25$(1 1 d.f.
or approximately 1 degrees of freedom :e clearly cannot re6ect the null hypothesis at
significance le%el $# "ith such a small t0%alue. since here the sample means are almost
e7ual but there is a lot of %ariability !he t0critical %alue
t
o/ 2
=t
$$5
is &&55
Matche" pair comparisons Dnli*e the t"o sample t0test in "hich the t"o samples are
assumed to be independent and one is comparing population means for t"o separate
populations. typically in the matche" pairs ttest (or 6ust paire" ttest for short) the
%ariables one is comparing are highly dependent as in a before and after some treatment
situation or as in t"o different "aterproofing treatments. one applied to the first and the
other to the second of a pair of shoes 3ere rather than compare t"o population means.
one loo*s at the population of differences
D
i
=X
i
Y
i
of the t"o %ariables 5or large samples the central limit theorem lets us test the null
hypothesis that the population mean difference is some %alue
j
D ,$ (often ta*en to be $)
%ersus a one or t"o sided alternati%e using the
large sample matche" pairs Z test statistic +
Z=
Dj
D ,$
S
D
/ .n
for n large. say n>($
(Kf course if "e *no" the population standard de%iation
c
D "e "ould prefer to use it
in the abo%e statistic in place of the sample standard de%iation
S
D )
5or small samples one needs to assume that these differences are normally distributed
!hen the small sample matche" pairs t test statistic is :EE; #$ page ##
t =
Dj
D, $
S
D
/ .n
"ith +=n# degrees of freedom
A
!hen for a t random %ariable "ith n0# , #5 degrees of freedom "e find ("ith
j
D ,$
=$
)
t =
D
s/ .#A
=
&&/ 1
($A($?/ (
=($5At
$#
=2A$2
"hich says "e should at significance le%el $# re6ect the null hypothesis
H
$
: j
D
=j
D, $
=$
that there is no difference and conclude that the exercise program
results in a mean decrease in "eight instead
5an"omi6ation an" Pairing + An experimenter testing the efficacy of t"o drugs in
lo"ering blood pressure might "ant to assign to one group of
n
# patients out of n
treatment "ith drug # and treat the remaining
nn
# patients "ith drug 2
5an"omi6ation of treatments here means that each of the
(
n
n
#
)
possible selections of
patients for treatment # (drug # here) are e7ually li*ely to be chosen Mandom
assignment of treatments helps to pre%ent uncontrolled sources :EE; #$ page #2
of %ariation from biasing the response Bractically this selection can be accomplished by
randomly selecting
n
# integers bet"een # and n. )f a repeat occurs "e ignore it and
choose another Alternately "e could number the
(
n
n
#
)
subsets in some fashion and
then choose a random integer bet"een # and
(
n
n
#
)
Matche" Pairing ) 'locking *+ Additionally *no"ing that blood pressure is influenced
by age and "eight. the experimenter might decide to pair off patients so that "ithin each
pair. age and "eight are approximately e7ual Kne patient "ithin the pair is randomly
assigned drug # "hile the other gets treated "ith drug 2
The prpose o( pairing according to some %ariable (s) thought to influence the
response is to remo%e the effect of that %ariable from analysis
:ithout this matching (or N'lockingO) . one drug might appear to outperform the other
6ust because patients in one sample "ere lighter and younger and thus more prone to a
decrease in blood pressure than the hea%ier and older patients in the second sample
5an"omi6ation "ithin the pair ( meaning that "e randomly assign "hich of the first or
second indi%iduals in the pair gets "hich treatment) helps to pre%ent other uncontrolled
%ariables from biasing the response to the treatments Mandomi+ation "ithin the pair is
easily achie%ed by flipping a fair coin
Kne disad%antage to pairing is the smaller number of degrees of freedom "hich results.
leading to a "ider t0distribution and so possibly an increase in %ariance !his is often
more than compensated for ho"e%er by the reduction in %ariance that comes about
because the paired %ariables are highly correlated (dependent) Mecall from the
definitions of %ariance and of co%ariance. in the dependent case one has
V  X Y =E(( X j
X
)(Y j
Y
))
2
=V  X +V Y 2Eo% X , Y
or in terms of the correlation
j=j X ,Y =Cov X , Y / c
X
c
Y .
V  X Y =V  X +V Y 2jc
X
c
Y
)n the matched pairs . the dependence is "ithin the same pair >ifferent pairs are
assumed to be independent !hus assuming the co%ariance of each pair is the same gi%es
V 
X
Y =V 
D = V 
#
n
D
i
=
V  D
i
n
=
c
#
2
+c
2
2
2jc
#
c
2
n
9ote : )f X and Y are both normal but dependent. it may or may not be the case that their
difference X0Y is normal :hen the sample si+e is small. "e need to assume that the
differences are at least approximately normal to be able to employ the t0distribution
5or large samples by the Eentral Limit !heorem this is not an issue since then
D
"ill
be approximately normal automatically
:EE; #$ page #&
EXAMPLE 11 (li*e 3: problem ??() >escribe ho" the experimenter "ho "ants to
be able to compare the effecti%eness of t"o drugs in lo"ering blood pressure "ould
randomly select A out of #2 patients to be treated "ith drug # (!he other A "ould then
get drug 2)
:e number the patients $ through ##. then choose A random numbers bet"een $ and ##
representing the A patients chosen :e could for example pic* t"o random digits from
the random digits table in the boo* to yield an integer bet"een $ and  "hich "e "ould
thro" out if greater than or e7ual to A !hen "e could ta*e the remainder upon di%ision
by #2 of this number lying bet"een $ and 5 !he remainder "ould be bet"een $ and
## (!his "ould be more efficient than thro"ing out a t"o digit number if it is larger
than ##) )f any of the numbers (remainders) thus found are the same "e ignore them
and try again until "e ha%e A different numbers bet"een $ and ##
EXAMPLE 1! (li*e 3: ??5) Alternately the experimenter reali+ing that both drugs
lea%e no measurable after effects after a # "ee* period. could decide to test the same
patient "ith the t"o different drugs administered # "ee* apart >escribe ho" to conduct
this paired comparison and to randomi+e "ithin the pair
Assuming the patients are not in mortal danger of dying from a heart attac* once ta*en
off the drug. one "ould "ant to randomly choose "hich drug to gi%e first to each patient
say by flipping a fair coin (to randomi+e "ithin the pair) !hen one "ould loo* at the
difference in blood pressure response of a gi%en patient to the t"o drugs and conduct a
paired t0test "ith these #2 differences (assumed to be normally distributed)
EXAMPLE 1$ )n order to test t"o fitness programs "ith 5$ "eight lifters a%ailable. to
see if the ne" diet and exercise regime "ill increase lifting capacity. the instructor as*s
for #$ %olunteers to recei%e the ne" treatment :hy is this a bad idea /
@uch self selected rather than randomly selected methods can ha%e hidden biases 5or
example perhaps it is more li*ely that the better. stronger. more moti%ated or ambitious
"eight lifters "ill be the ones "ho "ill "ant to %olunteer