T and Z Test
T and Z Test
Often, we may want to know things about populations but don’t have data
for every person or thing in the population. If a company’s customer
service division wanted to learn whether its customers were satisfied, it
would not be practical or perhaps even possible to contact every individual
who purchased a product. Instead, the company might select a sample or
samples of the population.
STATISTICAL INFERENCE
STATISTICAL INFERENCE
The sample mean is a statistic; that is, a random variable that depends
on the results obtained in each particular sample. Since statistic is a
random variable, it has a probability distribution.
•• HH00and
andHH1are:
1
are:
Mutually
Mutuallyexclusive
exclusive
--Only
Onlyone
onecan
canbe
betrue.
true.
Exhaustive
Exhaustive
--Together
Togetherthey
theycover
coverall
allpossibilities,
possibilities,so
soone
oneor
orthe
the
othermust
other mustbe
betrue.
true.
Hypothesis about other Parameters
H0: p ≥ 40%
H1: p < 40%
H0: σ2 ≤ 50
H1: σ2 > 50
The Null Hypothesis H0
Thenull
The nullhypothesis:
hypothesis:
Oftenrepresents
Often representsthe thestatus
statusquo quosituation
situationor oran
anexisting
existingbelief.
belief.
IsIsmaintained,
maintained,or orheld
heldto tobe
betrue,
true,until
untilaatest
testleads
leadsto
toits
itsrejection
rejection
ininfavor
favorofofthe
thealternative
alternativehypothesis.
hypothesis.
IsIsnot
notrejected
rejectedas astrue
trueor orrejected
rejectedas asfalse
falseononthe
thebasis
basisof
ofaa
considerationof
consideration ofaatest
teststatistic.
statistic.
IsIsaahypothesis
hypothesisthat thatmight
mightbe befalsified
falsifiedon
onthe
thebasis
basisof
ofobserved
observed
data.
data.
isisaastatement
statementof ofzero
zeroor ornonochange.
change.IfIfthe
theoriginal
originalclaim
claimincludes
includes
equality(≤,
equality (≤,=,=,or
or≥),
≥),ititisisthe
thenull
nullhypothesis.
hypothesis.IfIfthe
theoriginal
originalclaim
claim
doesnot
does notinclude
includeequality
equality(<, (<,not
notequal,
equal,>)>)then
thenthe
thenull
nullhypothesis
hypothesis
isisthe
thecomplement
complementof ofthetheoriginal
originalclaim.
claim.The
Thenull
nullhypothesis
hypothesis
alwaysincludes
always includesthe theequal
equalsign.sign.
The Alternative Hypothesis H1 or Ha
Alternative Hypothesis
Alternative Hypothesis (( HH11 or or Ha
Ha )) isis the
the
statement which
statement which isis true
true ifif the
the null
null
hypothesis isis false.
hypothesis false.
The type
The type of
of test
test (left,
(left, right,
right, or
or two-tail)
two-tail) isis
based on
based on the
the alternative
alternative hypothesis.
hypothesis.
The Concepts of Hypothesis Testing
•• AAtest
teststatistic
statisticisisaasample
samplestatistic
statisticcomputed
computedfrom
fromsample
sample
data. The
data. Thevalue
valueofofthe
thetest
teststatistic
statisticisisused
usedin
indetermining
determining
whetheror
whether ornot
notwewemay
mayreject
rejectthe
thenull
nullhypothesis.
hypothesis.
•• The
Thedecision
decisionrule
ruleof
ofaastatistical
statisticalhypothesis
hypothesistesttestisisaarule
rulethat
that
specifiesthe
specifies theconditions
conditionsunder
underwhich
whichthe thenull
nullhypothesis
hypothesismay may
berejected.
be rejected.
ConsiderHH0::μμ==100.
Consider 100.
0
Wemay
We mayhave
haveaadecision
decisionrule
rulethat
thatsays:
says:“Reject
“RejectHH0ifif the
thesample
sample
0
meanisisless
mean lessthan
than95
95or
ormore
morethan
than105.”
105.”
Inaacourtroom
In courtroomwewemay
maysay:
say:“The
“Theaccused
accusedisisinnocent
innocentuntil
until
provenguilty
proven guiltybeyond
beyondaareasonable
reasonabledoubt.”
doubt.”
Decision Making
Thereare
There aretwo
twopossible
possiblestates
statesof
ofnature:
nature:
HH0isistrue
true
0
HH0isisfalse
false
0
Thereare
There aretwo
twopossible
possibledecisions:
decisions:
Fail
Failto
toreject
rejectHH00as
astrue
true
Reject
RejectHH00as
asfalse
false
Decision Making
•• AAdecision
decisionmay
maybe
becorrect
correctin
intwo
twoways:
ways:
•• Failto
Fail toreject
rejectaatrue
trueHH0
0
•• Rejectaafalse
Reject falseHH0
0
•• AAdecision
decisionmay
maybe
beincorrect
incorrectin
intwo
twoways:
ways:
•• Rejectaatrue
Reject trueHH0(Type
0
(TypeIIError)
Error)
•• TheProbability
The ProbabilityofofaaType
TypeIIerror
errorisisdenoted
denotedby
byα.
α.
•• Failto
Fail toreject
rejectaafalse
falseHH0(Type
0
(TypeIIIIError)
Error)
•• TheProbability
The ProbabilityofofaaType
TypeIIIIerror
errorisisdenoted
denotedby
byβ.
β.
Errors in Hypothesis Testing
αα isis called
called the
the level
level of
of significance
significance of
of
the test
the test
11 -- ββ isis called
called the
the power
power of
of the
the test.
test.
αα and
and ββ are
are conditional
conditional probabilities:
probabilities:
αα == P(Rejecting
P(Rejecting HH00│H
│H00 isis True)
True)
ββ == P(Not
P(Not Rejecting
Rejecting HH00│H │H00 isis False)
False)
Errors in Hypothesis Testing
Decision Ho True Ho False
Reject Ho Type I Error (α) Correct Assessment
Fail to Reject Ho Correct Assessment Type II Error (β)
IfIfaction
actionisisto
tobe
betaken
takenififaaparameter
parameterisisless
lessthan
thansome
somevalue
valuea,a,then
thenthe
the
alternativehypothesis
alternative hypothesisisisthat
thatthe
theparameter
parameterisisless
lessthan
thana,a,and
andthe
thetest
testisisaa
left-tailedtest.
left-tailed test.
HH0:0:μμ≥≥50
50
HH1:1:μμ<<50
50
IfIfaction
actionisisto
tobe
betaken
takenififaaparameter
parameterisiseither
eithergreater
greaterthan
thanor
orless
lessthan
than
somevalue
some valuea,a,then
thenthethealternative
alternativehypothesis
hypothesisisisthat
thatthe
theparameter
parameterisisnot
not
equalto
equal toa,a,and
andthe
thetest
testisisaatwo-tailed
two-tailedtest.
test.
HH0:0:μμ==5050
HH1:1:μμ≠≠5050
STATISTICAL INFERENCE
TYPE OF TESTS
The type of test is determined by the Alternative Hypothesis (H1)
Thep-value
The p-valueisisthe
theprobability
probabilityof
ofobtaining
obtainingaavalue
valueof ofthe
the
teststatistic
test statisticas
asextreme
extremeas,
as,or
ormore
moreextreme
extremethan,
than,thethe
actualvalue
actual valueobtained,
obtained,when
whenthethenull
nullhypothesis
hypothesisisistrue.
true.
Thep-value
The p-valueisisthe
thesmallest
smallestlevel
levelof
ofsignificance,
significance,α,
α,at
at
whichthe
which thenull
nullhypothesis
hypothesismay
maybe berejected
rejectedusing
usingthe
the
obtainedvalue
obtained valueofofthe
thetest
teststatistic.
statistic.
DecisionRule:
Decision Rule:When
Whenthe
thep-value
p-valueisisless
lessthan
thanαα,,reject
rejectHH00..
TESTS FOR MEAN
Testing of hypothesis for a mean - the following conditions hold:
The sampling method is simple random sampling.
The sample is drawn from a normal or near-normal
population.
DECISION
TEST PROCEDURE
p p0
Z
p 0 (1 p 0 ) / n
where Z has the standard normal distribution. Compare the Z
calculated value with Z and Z / 2 which are the critical values
from normal distribution corresponding to α and α/2 probabilities
representing one tail and two-tail tests.
TESTS FOR POPULATION PROPORTION
EXAMPLE:
A semiconductor manufacturer produces controllers
used in automobile engine applications. The customer
requires that the process fraction defective at a critical
manufacturing step not exceed 0.05 and that the
manufacturer demonstrate process capability at this
level of quality using α = 0.05. The semiconductor
manufacturer takes a random sample of 200 devices
and finds that 4 of them are defective. Can the
manufacturer demonstrate process capability for the
customer?
TESTS FOR POPULATION PROPORTION
EIGHT-STEP PROCEDURE
Eight-step procedure
1. The parameter of interest is the difference in mean
drying times, μ1 - μ2
2. H0: μ1 - μ2 = 0, (or) μ1 = μ2
3. H1: μ1 - μ2 > 0, (or) μ1 > μ2. We want to reject H0 if
the new ingredient reduces the drying time.
4. α = 0.05 x1 x 2
Z0
5. The test statistics is 12 22
n1 n2
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)
6. Reject H0 if Z0 ≥ 1.645 (Zα). Note that this results from step 4,
where we specified α = 0.05 and so the boundaries of the
critical region are at from normal distribution tables.
7. Computations: Since x1 =121 minutes, x 2 =112 minutes,
σ12 = σ22 = 82 = 64 minutes and n1= n2 = 10, the value of the
test statistics is,
121 112
Z0 2.52
8 2
8
2
10
10
9. Conclusion: Since Z0 = 2.52 > 1.645, we reject H0: μ1 - μ2 = 0
at the 0.05 level of significance and conclude that adding the
new ingredient to the paint significantly reduces the drying
time.
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)
Note:
(i) In case of a two tail test – when the alternative
hypothesis is of the type H1: μ1 ≠ μ2, (or) H1: μ1 - μ2 ≠ 0 the
conclusion would be to reject H0: μ1 - μ2 = 0 at the 0.05 level of
significance, since Z0 = 2.52 > 1.96 (Zα/2). That is the mean
drying time is significantly different for the two types of
primers.
(ii) In case of an one tail test – when the alternative
hypothesis is of the type H1: μ1 < μ2 (or), H1: μ1 - μ2 < 0, the
conclusion would be do not reject H0: μ1 - μ2 = 0 at the 0.05
level of significance, since Z0 = 2.52 > - 1.645 and conclude
that adding the new ingredient to the paint significantly
reduces the drying time.
TESTS FOR MEAN
UNKNOWN VARIANCE: (t- Test)
Let x1, x2, ..., xn is a random sample drawn from a normal
population with unknown variance σ2. Using sample data,
conduct a one-sample t-test.
X
t
s/ n
where t has the t-distribution with (n-1) d.f.
Compare the ‘t’ calculated value with t and t / 2 which are
the critical values from t- distribution corresponding to α
and α/2 probabilities representing one tail and two-tail
tests.
TESTS FOR MEAN
UNKNOWN VARIANCE: (t- Test)
DECISION
2 μ > μ0 μ < μ0 1 t t
t t
3 μ < μ0 μ > μ0 1
TESTS FOR MEAN
UNKNOWN VARIANCE: (t- Test)
EXAMPLE
The increased availability of light materials with high strength has
revolutionized the design and manufacture of golf clubs, particularly
drivers. Clubs with hollow heads and very thin faces can result in much
longer tee shots, especially for players of modest skills. This is due
partly to the “spring – like effect” that the thin face imparts to the ball.
Firing of golf ball at the head of the club and measuring the ratio of the
outgoing velocity of the ball to the incoming velocity can quantify this
spring like effect. The ratio of velocities is called the coefficient of
restitution of the club. An experiment was performed in which 15 drivers
produced by a particular club maker were selected at random and their
coefficients of restitution measured. In the experiment the golf balls
were fired from air cannon so that the incoming velocity and spin rate of
the ball could be precisely controlled. It is of interest to determine if
there is evidence (with α = 0.05) to support a claim that the mean
x
coefficient of restitution exceeds 0.82. The observations are:
0.8411 0.8191 0.8182 0.8125 0.8750
0.8580 0.8532 0.8483 0.8276 0.7983
0.8042 0.8730 0.8282 0.8359 0.8660
TESTS FOR MEAN
UNKNOWN VARIANCE: (t- Test)
EIGHT-STEP PROCEDURE
0.83725 0.82
t0 2.72
0.02456 / 15
n1 n 2 2
1 1
Where
2
s
1
n1 1
( x1i x1 ) 2 and s 2
2
n2 1
2i 2
( x x ) 2
x1 x 2 ( 1 2 )
Then the random variable t
1 1
sp
n1 n2
DECISION
Case Null Alternative Number of Reject Null
hypothesis hypothesis tails Hypothesis
μ 1= μ2 μ1≠ μ2
1 or or 2 t 0 t / 2
μ 1 - μ2 = 0 μ1 - μ 2 ≠ 0
2
μ1 ≥ μ 2
or
μ1 < μ 2
or 1
t 0 t
μ1 - μ 2 ≥ 0 μ1 - μ 2 < 0
μ1 ≤ μ2 μ1 > μ2 t 0 t
3 or or 1
μ 1 - μ2 ≤ 0 μ1 - μ 2 > 0
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
Two catalysts are being
analyzed to determine how they
Observation Catalyst Catalyst
affect the mean yield of a
chemical process. Specifically, Number 1 2
Catalyst-1 is currently in use, 1 91.50 89.19
but Catalyst-2 is acceptable.
2 94.18 90.95
Since Catalyst-2 cheaper, it
should be adopted, if it does 3 92.18 90.46
not change the process yield. A 4 95.39 93.21
test is run in the pilot plant and
the results are shown in the 5 91.79 97.19
table below. Is there any 6 89.07 97.04
difference between the mean
yields? Use α = 0.05, and 7 94.72 91.07
assume equal variances. 8 89.21 92.75
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
From the data it can be calculated that x1 = 92.255,
x2 = 92.733, s = 2.39 and s = 2.98.
1 2
Eight-step procedure
1. The parameters of interest are μ1 and μ2, and we
want to know if μ1 - μ2=0.
2. H0: μ1 - μ2 = 0, (or) μ1 = μ2
3. H1: μ1 - μ2 ≠ 0, (or) μ1 ≠ μ2.
4. α = 0.05 x1 x 2
to
1 1
5. The test statistic is sp
n1 n2
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
6. Reject H0 if t0 > 2.145 ( = t0.025,14) (or) if t0 < -2.145 (= -t0.025,14). Note that this
results from step 4, where we specified α = 0.05 and so the boundaries of the
critical region are at t0.025,14 = 2.145 from t-distribution tables (two tail).
8. Conclusion: Since t0 = -0.35, we have -2.145 < t0 = -0.35 < 2.145, we do not
reject H0: μ1 - μ2 = 0 at the 0.05 level of significance and conclude that there is
no strong evidence that Catalyst-2 results in a mean yield that differs from
the mean yield when Catalyst-1 is used.
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
Note: In case of one tail tests –
when the alternative is of the type H1: μ1 - μ2 > 0 (or) H1: μ1 > μ2
the conclusion would be do not reject H0: μ1 - μ 2 = 0, (or)
μ1 = μ 2 at the 0.05 level of significance, since t0 = -0.35 < 1.761
(=t0.05,14). We conclude that the mean yield of Catalyst-1 is not
significantly greater than the mean yield when catalyst-2 is
used.
when the alternative is of the type H1: μ1- μ2 < 0 (or) H1: μ1 < μ2
the conclusion would be do not reject H0: μ1 - μ2 = 0, (or)
μ1 = μ2 at the 0.05 level of significance, since t 0 = - 0.35 > -1.761
(= -t0.05,14). We conclude that the mean yield of Catalyst-1 is not
significantly less than the mean yield when Catalyst-2 is used.
PAIRED t-TEST
The paired t-test is generally used when measurements
are taken from the same subject before and after some
manipulation such as injection of a drug.
The number of points in each data set must be the same,
and they must be organized in pairs, in which there is a
definite relationship between each pair of data points.
Clearly for paired t-test, the data is dependent, i.e. there is
a one-to-one correspondence between the values in the
two samples.
For example, same subject measured before and after a
process change or same subject measured at different
times.
PAIRED t-TEST
Let (x11, x21), (x12, x22), … , (x1n, x2n) be a set of n paired
observations of a sample drawn from two populations with
means μ1 and μ2 and variances σ12 and σ22respectively.
Define the differences between each pair of observations as
Dj = x1j - x2j, j = 1,2, … , n.
Then ‘Dj’s are assumed to be normally distributed with mean
μD = μ1 - μ2 and variance σD2.
Testing hypothesis about the difference between μ 1 and μ2 is
accomplished by
D performing
D a one-sample t-test on μD.
Then, tD
D / n
has a t-distribution with (n-1)
1 degrees of freedom. An estimator
of σD2is given by s D n 1 (di d )
2 2
1
d
n
di
where di = x1j-x2j and
PAIRED t-TEST
HYPOTHESES TESTED
DECISION
d
t0
sD / n
PAIRED t-TEST
6. Reject H0 if t0 > 2.306 ( = t0.025,8) (or) if t0 < -2.306 (= -t0.025,8).
Note that this results from step 4, where we specified α = 0.05
and so the boundaries of the critical region are at t 0.025,8= 2.306
from t-distribution tables (two tail).