You are on page 1of 13

Week 10 notes Hypothesis testing WEEK 10 page 1

Tests concerning one mean : Let us start by discussing


EXAMPLE 1 : problem 5 c) from EXAM 2 (example of a hypothesis testing problem)
5 !he bolt diameter X is normally distributed "ith mean #2$$ cm and standard
de%iation $$& cm !he "asher diameter ' is normally distributed "ith mean #2$( cm
and standard de%iation $$( cm
c) )f all "e *no" is that the bolt diameter X is normally distributed and that a sample of
si+e n , - bolts has (sample) mean diameter #2$( and (sample) standard de%iation $$&
cm . should "e belie%e that the population mean is #2$$ / )t may be useful to *no" the
t0critical %alues (1 degrees of freedom)
t
$$5
=&&55 t
$$#
=(5$#
2 3int: "hat *ind of random %ariable is (

X j)/( S/ .n) / 4 Explain


t =

X j
S/ .n
is a random %ariable ha%ing a t0distribution "ith parameter
+=n#=1
degrees of
freedom 5or the gi%en sample this gi%es a %alue of
t =
#2$(#2$$
$$&/ .-
=
$$(
$$#
=(
"hich lies bet"een the t"o t0critical %alues gi%en
!his says that at significance le%el o=$#=2($$5) "e "ould re6ect the null
hypothesis

H
$
: j=#2$$
that the population mean is #2$$ cm since the obser%ed t %alue exceeds the t0critical
%alue
t
o/ 2
=t
$$5
=&&55
and instead conclude that the (20sided) alternati%e hypothesis
H
a
: j#2$$
is true but for a more stringent test "ith a higher standard ha%ing significance le%el

o=$$2 and t0critical %alue t
o/ 2
=t
$$#
=(5$#
"e "ould accept the null hypothesis that the mean is #2
)t is not really right to mix up the language of confidence inter%als "ith that of re6ection
regions since confidence inter%als in%ol%e the random 7uantity

X (the sample mean)


"hereas the re6ection region is fixed once "e fix the type ) error probability
(significance le%el)
o
!hus "e should not say that "e are --8 confident that the null
hypothesis that the mean is #2 is false "hen the significance le%el is o=$#=2($$5)
9ote that the p-vale "hich is the probability of seeing data :EE; #$ page 2
as extreme as the obser%ed sample gi%en the null hypothesis is true "ould lie some"here
bet"een $$2 and $# (the p0%alue "ould be t"ice the probability
o/ 2
represented by
the t0critical %alue
t
o/ 2
=(
"hich "e don<t *no" exactly here but only that it lies
bet"een t"ice the probabilities
o/ 2
for the t"o t0critical %alues
t
o/ 2 "ith
o/ 2
, $$5 and
o/ 2
, $$#) since for a t"o sided test li*e this one "e "ould also ha%e seen
e7ually strong e%idence in fa%or of re6ecting the null hypothesis had "e seen a negati%e
%alue of t less than or e7ual to
t , - ( instead of a t %alue greater than or e7ual to t , (
)t is true that if the null hypothesis holds. the probability of a sample gi%ing a t %alue as
extreme as this one is smaller than $# and in this sense there is a fair amount of
e%idence against the null hypothesis (le%el $# is usually considered statistically
significant) =ut it depends on ho" high "e set our standards
EXAMPLE ! >eri%ation of the (large) sample si+e formulas used in problems ?&( and
?&5 of the text !he problem is to determine for a gi%en null hypothesis
H
$
: j=j
$
about the population mean ho" large a sample si+e "e need to achie%e the specified
o
and

in order to insure that both the type ) error probability is bounded by a


specified
o
and the type )) error probability is bounded by a specified

"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

!hus the type )) error probability o


=P( z

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

"e "ant the sample si+e n to be large enough that


z

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

!he type )) error probability is bounded by

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

"e can safely ignore the right hand bound


z
o/ 2
+
j
$
j
#
c/ .n
on Z since it is & standard de%iations to the right of
z
"hich "ill
already be large (before adding & to it ) "hen

is small @imilar considerations lead to


the same sample si+e result "hen
j
#
>j
$ so that the right hand bound on Z in the
ine7uality

z
o/ 2
+
j
$
j
#
c/ .n
z

"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

is small (so it "ill not


appreciably alter the probability if "e simply drop this bound on the left)
EXAMPLE $ Broblem ?(& of the text (li*e 3: problem ?(#)
)n a labor management discussion it "as brought up that "or*ers at a certain large plant
ta*e on a%erage &2A minutes to get to "or* )f a random sample of A$ "or*ers too* on
a%erage &&1 minutes "ith a standard de%iation of A# minutes. can "e re6ect the null
hypothesis
H
$
: j=&2A
in fa%or of the alternati%e hypothesis
H
a
: j>&2A
at the $5
le%el of significance /
:e ha%e a one0sided test "ith sample si+e n , A$ . sample mean
x=&&1
.
o=$5
sample standard de%iation s , A# minutes :e "ould (falsely) re6ect the null hypothesis
"ith type ) error probability
o=$5
if (assuming it is really true) "e see
Z=

X j
$
s/ .A$
>z
$5
=#A(5

5or the abo%e sample "e get


xj
$
s/ .A$
=
&&1&2A
A#/ .A$
=#52&z
$5
=#A(5
so based on this sample "e "ould not re6ect the null hypothesis at le%el $5
EXAMPLE % Broblem ?(5 (li*e 3: problem ?(()
Ci%en a random sample of 5 pints from different production lots. "e "ant to test
"hether the fat content of a certain *ind of ice cream exceeds #(8 :hat can "e
conclude at the $# le%el of significance about the null hypothesis

H
$
: j=#( ( =#(8 )
if the sample mean has the mean
x=#(-8
and the (sample) standard de%iation

s=$$(2( =(28 )
/
(!he boo* has a
c
the population standard de%iation instead of the sample standard
de%iation s but 6udging from the ans"er in the bac* in%ol%ing a t statistic this is a typo )
:e must assume that "e are sampling from a normal or approximately normal
population of fat contents or else "e can not say much )f fat contents are normally
distributed then "ith n , 5 the t0statistic "ith n 0 # , ( degrees of freedom

t =
xj
$
s/ .5
=
#(-#(
$$(2/ .5
=
$$-$.5
$$(2
=(?->t
$#
=&?(?
exceeds the t0critical %alue so "e re6ect the null hypothesis at significance le%el $#
EXAMPLE & Broblem ?(? (li*e 3: ?(A)
A random sample from a company<s %ery extensi%e files sho"s that orders for a certain
piece of machinery "ere filled respecti%ely in #$. #2. #-. #(. #5 . #1. ##. and #& days
Dse the le%el of significance
o=$#
to test the claim that orders :EE; #$ page 5
are filled in #$5 days Ehoose the alternati%e hypothesis so that re6ection of the null
hypothesis implies that it ta*es longer than indicated Assume normality
:e ha%e a sample of si+e n , 1 times "hose sample mean is

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
$#
=2--1
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

!he relation 'et#een con(i"ence intervals an" )!-si"e"* hypothesis testing +


Gohnson remar*s that statisticians usually prefer a confidence inter%al statement ("hen
one is a%ailable) about a population parameter such as the population mean
j
rather
than a null hypothesis for a single %alue
H
$
: j=j
$ since (for t"o0sided tests) exactly
those null hypothesis using a %alue of
j
$ that falls inside a
#$$(#o) 8
confidence
inter%al are the ones that are accepted at significance le%el
o
!hus "e are not limited
to the particular null %alue
j
$ used in a gi%en test. but rather any %alue falling inside
the confidence inter%al
)n EXAMBLE A belo" "e do Broblem ?5& (@ome"hat li*e 3: ?5( and ?55)
!he boo* as*s you to do these type )) error probability calculations using the
operating characteristic crves gi%en in table 1 in appendix = assuming samples from
a normal population !his is a plot for specified
o
("ith separate cur%es for different
sample si+es) of the acceptance probability

L(j)=P( accept H
$
"hen actual mean is j)
"here one plots the probability not against mean
j
directly but rather against its
departure
d=H jj
$
H/ c
from the null hypothesis %alue
j
$ relati%e to the standard
de%iation
c
) "ould prefer that you understand ho" to calculate these type )) error
probabilities directly
,alclation o( type t#o error pro'a'ility

(or a !-si"e" test gi%en actual


population mean
j=j
# and significance le%el
o
assuming either a large sample si+e
or "hen sampling from a normal population !he acceptance region is determined by
pretending the null hypothesis holds !he statistic used "ill not be standard normal
unless the actual mean
j=j
# is employed !hus

, 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

is small the right hand bound on Z


z
o/ 2
+
j
$
j
#
c/ .n
z

"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 t-test 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#o-sample t-test + 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 )one-si"e"* t-test 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
=#-11-1$
: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 t-test 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/-)
, 5-102J#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
(5-12/#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
(((5-12/ #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 t-test (or 6ust paire" t-test 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

5or such matched pairs one has a single population of differences


EXAMPLE 10 Broblem ??2 (li*e 3: ??#) Paire" t-test e0ample :
)n a study of the effecti%eness of physical exercise in "eight reduction. a group of #A
persons engaged in a prescribed program of physical exercise for one month sho"ed the
follo"ing results :
:eights before (in pounds ) :
2$-. #?1. #A-. 2#2. #1$. #-2. #51. #1$. #?$. #5&. #1&. #A5. 2$#. #?-. 2(&. #((
:eight after :
#-A. #?#. #?$. 2$?. #??. #-$. #5-. #1$. #A(. #52. #?-. #A2. #--. #?&. 2&#. #($
Dse the $# le%el of significance to test "hether the exercise program is effecti%e :
!he #A differences ("eight after minus "eight before) are :
-#&. 0?. L#. 05. 0&. 02. L#. $. 0A. 0#. 0(. 0&. 02. 0A. 0#2. 0(
!he sample mean difference is
D=
&&
1
=( (+#/ 1)
and the sample %ariance is
S
2
=
#
#5
( (-#/ 1)
2
+(&#/1)
2
+(5+#/ 1)
2
+(##/ 1)
2
+(#+#/1)
2
+(2+#/ 1)
2
+(5+#/1)
2
+((+#/ 1)
2
+(2#/ 1)
2
+(&+#/ 1)
2
+($+#/ 1)
2
+(#+#/1)
2
+(2+#/ 1)
2
+(2#/ 1)
2
+(1#/1)
2
+($+#/1)
2
)
,
#
#5
( -
2
+&
2
+5
2
+#
2
+#
2
+2
2
+5
2
+(
2
+2
2
+&
2
+$
2
+#
2
+2
2
+2
2
+1
2
+$
2
-/ (&/ (+5/ (#/ (+#/ (
+2/ (+5/ (+(/ (2/ (+&/ (+$/ (+#/ (+2/ (2/ (1/ (+$/ (+(#A(#/ 1)
2
=#/ () )
or
s
D
2
,
#
#5
( 2(1
#
(
) = #A5#A

A
!hen for a t random %ariable "ith n0# , #5 degrees of freedom "e find ("ith
j
D ,$
=$
)
t =

D
s/ .#A
=
&&/ 1
($A($?/ (
=($5--A-t
$#
=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