0% found this document useful (0 votes)
21 views

T and Z Test

t test
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

T and Z Test

t test
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 74

STATISTICAL INFERENCE

 Statistical Inference is concerned with making decisions about a population


based on the information contained in a random sample from that
population.

 A sample is a subset of the population, selected to representative of the


larger population. It is essential that any sample is as representative as
possible of the population from which it is drawn.

 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.

 A parameter is a characteristic of a population. A statistic is a


characteristic of a sample.

 Inferential statistics enables us to make an educated guess about a


population parameter based on a statistic computed from a sample
randomly drawn from that population.

 A sampling distribution is the probability distribution of a sample


statistic that is formed when samples of size n are repeatedly taken
from a population. If the sample statistic is the sample mean, then the
distribution is the sampling distribution of sample means.
Hypothesis
• A hypothesis is a statement or assertion about the state of
nature (about the true value of an unknown population
parameter):
• The accused is innocent
• μ = 100
• Every hypothesis implies its contradiction or alternative:
 The accused is guilty
 μ ≠ 100
• A hypothesis is either true or false, and you may fail to reject
it or you may reject it on the basis of information:
 Trial testimony and evidence
 Sample data
Decision-Making
One hypothesis is maintained to be true until a decision is made
to reject it as false:
 Guilt is proven “beyond a reasonable doubt”
 The alternative is highly improbable

A decision to fail to reject or reject a hypothesis may be: Correct


 A true hypothesis may not be rejected
 An innocent defendant may be acquitted
 A false hypothesis may be rejected
 A guilty defendant may be convicted

A decision to fail to reject or reject a hypothesis may be:


Incorrect
 A true hypothesis may be rejected
 An innocent defendant may be convicted
 A false hypothesis may not be rejected
 A guilty defendant may be acquitted
Statistical Hypothesis Testing
AAnull
nullhypothesis,
hypothesis,denoted
denotedbybyHH00,,isisan
anassertion
assertionaboutaboutone
oneor
ormore
more
populationparameters.
population parameters. This
Thisassertion
assertionisisheldheldto tobe
betrue
trueuntil
untilthere
there
isissufficient
sufficientstatistical
statisticalevidence
evidencetotoconclude
concludeotherwise.
otherwise.
HH00::μμ==100
100
Thealternative
The alternativehypothesis,
hypothesis,denoted
denotedby byHH11,,isisthe
theassertion
assertionof
ofall
all
situationsnot
situations notcovered
coveredbybythe
thenull
nullhypothesis.
hypothesis.
HH11::μμ≠≠100
100

•• 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

Hypotheses about other parameters such as


population proportions and and population variances
are also possible. For example

 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 (β)

Which of the two errors is more serious?


Type I or Type II?
Since Type I is the more serious error (usually), that is
the one we concentrate on. We usually fix α to be very
small (0.05, 0.01).
Testing Process
• State the relevant null and alternative hypotheses to be tested.
• The second step is to consider the assumptions being made in
doing the test; for example, assumptions about the statistical
independence or about the form of the distributions of the
observations. This is equally important as invalid assumptions
will mean that the results of the test are invalid.
• Compute the relevant test statistic. The distribution of such a
statistic under the null hypothesis can be derived from the
assumptions. In standard cases this will be a well-known
result. For example the test statistics may follow a Student’s t
distribution or a normal distribution. The distribution of the test
statistic partitions the possible values of the estimator into
those for which the null-hypothesis is rejected and those for
which it is not.
• Compare the test-statistic (S) to the relevant critical values (CV)
(obtained from tables in standard cases).
• Decide to either fail to reject the null hypothesis or reject the
null hypothesis in favor of the alternative. The decision rule is
to reject the null hypothesis (H0) if S > CV and vice versa.
1-Tailed and 2-Tailed Tests
Thetails
The tailsof
ofaastatistical
statisticaltest
testare
aredetermined
determinedbybythe
theneed
needfor
foran
anaction.
action. IfIf
actionisisto
action tobe
betaken
takenififaaparameter
parameterisisgreater
greaterthan
thansome
somevalue
valuea,a,then
thenthe
the
alternativehypothesis
alternative hypothesisisisthat
thatthe
theparameter
parameterisisgreater
greaterthan
thana,a,and
andthe
thetest
test
isisaaright-tailed
right-tailedtest.
test.
HH0:0:μμ≤≤50
50
HH1:1:μμ>>50
50

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)

Left Tailed Test - H1: parameter < value

Notice the inequality points to the left


Decision Rule: Reject Ho if test statistic < critical value
STATISTICAL INFERENCE

Right Tailed Test - H1: parameter > value

Notice the inequality points to the right


Decision Rule: Reject H0 if test statistic > critical value
STATISTICAL INFERENCE
Two Tailed Test - H1: parameter ≠ value

Notice the inequality points to both sides


Decision Rule: Reject H0 if test statistic < critical
value (left) or test statistic > critical value (right)
The p-Value

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.

Generally, the sampling distribution will be approximately


normally distributed if any of the following conditions apply.
• The population distribution is normal.
• The sampling distribution is symmetric, unimodal, without
outliers.
• The sampling distribution is moderately skewed, unimodal,
without outliers, and the sample size is more than 30

This approach consists of four steps: (1) state the hypotheses,


(2) formulate an analysis plan, (3) analyze sample data, and (4)
interpret results.
TESTS FOR MEAN
STATEMENT OF THE HYPOTHESES
Alternative Number of
Case Null hypothesis
hypothesis tails
1 μ = μ0 μ ≠ μ0 2
2 μ > μ0 μ < μ0 1
3 μ < μ0 μ > μ0 1
The first case of hypotheses is an example of a two-tailed test, since
an extreme value on either side of the sampling distribution would
cause to reject the null hypothesis. The other two cases of
hypotheses are one-tailed tests, since an extreme value on only one
side of the sampling distribution would cause a researcher to reject
the null hypothesis.
TESTS FOR MEAN
KNOWN VARIANCE: (Z- Test)
Let x1, x2, ..., xn is a random sample drawn from a normal
population with known variance σ2. Using sample data,
conduct a one-sample Z-test.

Calculate the test statistic


X  
Z 
/ n
where Z is the standard normal variable.

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 MEAN
KNOWN VARIANCE: (Z- Test)

DECISION

Null Alternative Number Reject Null


Case
hypothesis hypothesis of tails Hypothesis
1 μ = μ0 μ ≠ μ0 2 Z Z  / 2
Z  Z 
2 μ > μ0 μ < μ0 1
Z Z 
3 μ < μ0 μ > μ0 1
TESTS FOR MEAN
KNOWN VARIANCE: (Z- Test)
EXAMPLE
Aircrew escape systems are powered by a solid
propellant. The burning rate of this propellant is an
important product characteristic. Specifications
require that the mean burning rate must be 50
centimeters per second. It is known that the standard
deviation of burning rate is σ = 2 centimeter per
second. The experimenter decides to specify a Type I
error probability or significance level of α = 0.05. He
selects a random sample of n= 25 and obtains a
sample average burning rate of x = 51.3 centimeter
per second. What conclusion should be drawn?
TESTS FOR MEAN
KNOWN VARIANCE: (Z- Test)
EIGHT-STEP PROCEDURE

1. The parameter of interest is μ, the mean


burning rate.
2. H0: μ = 50 centimeter per second
3. H1: μ ≠ 50 centimeter per second
4. α = 0.05
5. The test statistics is
X  0
Z
/ n
TESTS FOR MEAN
KNOWN VARIANCE: (Z- Test)
6. Reject H0 if Z ≥ 1.96 or if Z ≤ -1.96. Note that this results from
step 4, where we specified α = 0.05 and so the boundaries of
the critical region are at Z 0.025 1.96 and  Z 0.025  1.96 from
normal distribution tables.

7. Computations: Since = 51.3 and σ = 2,


51.3  50
Z0  3.25
2 / 25

8. Conclusion: Since Z0 = 3.25 > 1.96 (Zα/2), we reject H0: μ = 50 at


the 0.05 level of significance. Stated more completely, we
conclude that the mean burning rate differs from 50 centimeters
per second, based on a sample of 25 measurements. In fact,
there is strong evidence that the mean burning rate is not equal
to 50 centimeters per second.
TESTS FOR MEAN
KNOWN VARIANCE: (Z- Test)
Note: In case of one tail tests –
when the alternative is of the type H1: μ > 50 centimeter per
second the conclusion would be to reject H0: μ ≤ 50 at the 0.05
level of significance, since Z0 = 3.25 > 1.64 (Zα). Stated more
completely, we conclude that the mean burning rate differs from
50 centimeters per second, based on a sample of 25
measurements. In fact, there is strong evidence that the mean
burning rate exceeds 50 centimeters per second.

when the alternative is of the type H1: μ < 50 centimeter per


second the conclusion would be do not reject H0: μ ≥ 50 at the
0.05 level of significance, since Z0 = 3.25 > - 1.64 (Zα). Stated
more completely, we conclude that the mean burning rate
differs from 50 centimeters per second, based on a sample of 25
measurements. In fact, there is strong evidence that the mean
burning rate exceeds 50 centimeters per second.
TESTS FOR POPULATION PROPORTION
 A random sample of size ‘n’ is drawn from a large
population and that x (≤n) observations in this
sample belong to a specified class of interest.

 Then p = x/n is a point estimator of the proportion


‘p’ of the population that belongs to this class.

 Note that n and p are parameters of binomial


distribution.

 When n is relatively large and if p is not too close to


either 0 (zero) or 1 (one), then p is approximately
normal with mean p and variance p(1- p)/n. For this
approximation we require that np and n(1-p) be
greater than 5.
TESTS FOR POPULATION PROPORTION

We will consider testing the following hypotheses

Case Null Alternative Number of


hypothesis hypothesis tails
1 p= p0 p≠ p0 2
2 p > p0 p < p0 1
3 p < p0 p > p0 1
TESTS FOR POPULATION PROPORTION

TEST PROCEDURE

Let X be the number of observations in a random sample of size


‘n’ that belongs to the class associated with p. Using sample
data, conduct a one-sample Z-test as follows:

Calculate the test statistic

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

1. The parameter of interest is the process fraction


defective p.
2. H0: p = 0.05
3. H1: p < 0.05; (this formulation of the problem will allow
the manufacturer to make a strong claim about
process capability if null hypothesis H0: p = 0.05 is
rejected).
4. α = 0.05 p  p0
Z0 
5. The test statistics is p (1  p ) / n
0 0
TESTS FOR POPULATION PROPORTION
6. Reject H0 if Z ≤ -1.96. Note that this results from Step-4
where we specified α = 0.05 and so the boundary of the
critical region is from normal distribution tables.

7. Computations: Since x=4, n=200, p0= 0.05 and = 0.02


p
0.02  0.05
Z0   1.95
0.05(1  0.95) / 200

8. Conclusion: Since Z0 = -1.95 < -1.645 (Zα), we reject


H0: p = 0.05 at the 0.05 level of significance and
conclude that the process fraction
defective is less than 0.05. Hence the
process is capable.
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
There are two binomial parameters of interest, say p1
and p2 .

Suppose that two independent random samples of


sizes n1 and n2 are taken from two populations.

Let x1 and x2 represent the number of observations that


belong to the class of interest in samples or 1 and 2,
respectively.
x1 x2 x1  x 2
p  and p 
Let, p1  n1 , 2 n, 2 n1  n2
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
We test the following hypotheses:

Case Null Alternative Number of


hypothesis hypothesis tails
p1 = p 2 p1 ≠ p 2
1 or or 2
p1 - p 2 = 0 p1 - p 2 ≠ 0
p1 ≥ p 2 p1 < p 2
2 or or 1
p1 - p 2 ≥ 0 p1 - p 2 < 0
p1 ≤ p 2 p1 > p 2
3 or or 1
p1 - p 2 ≤ 0 p1 - p 2 > 0
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
Calculate the test statistic
p1  p 2  ( p1  p 2 )
Z
p1 (1  p1 ) p 2 (1  p 2 )

n1 n2

where Z has the standard normal distribution.


Under null hypothesis the test statistic becomes
p1  p 2
Z0 
 1 1 
p (1  p )  
 n1 n2 
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
Compare the calculated value of Z0 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.
The decisions are:
Null Alternative Number Reject Null
Case
hypothesis hypothesis of tails Hypothesis
p1 = p 2 p1 ≠ p 2
1 or
p1 - p 2 = 0
or
p1 - p 2 ≠ 0
2 Z Z  / 2
p1 ≥ p 2 p1 < p 2
2 or or 1 Z  Z 
p1 - p 2 ≥ 0 p1 - p 2 < 0
p1 ≤ p 2 p1 > p 2 Z Z 
3 or or 1
p1 - p 2 ≤ 0 p1 - p 2 > 0
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
EXAMPLE
Acme Drug Company develops a new drug, designed
to prevent colds. The company states that the drug is
equally effective for men and women. To test this
claim, they choose a simple random sample of 100
women and 200 men from a population of 100,000
volunteers. At the end of the study, 38% of the women
caught a cold; and 51% of the men caught a cold.
Based on these findings, can we reject the company's
claim that the drug is equally effective for men and
women? Use a 0.05 level of significance.
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
EIGHT-STEP PROCEDURE
1. The parameters of interest are p1 and p2 the
proportion of men and women who caught a
cold.
2. H0: p1 = p2
3. H1: p1 ≠ p2
4. α = 0.05 p1  p 2
Z0 
5. The test statistics is  1 1 
p (1  p )  
 n1 n2 

where, p1 0.51 , p 2 0.38 and p 0.5933 , n 1=200


and n2 = 100
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS
6. Reject H0 if Z ≥ 1.96 or if Z ≤ - 1.96. Note that this
results from step 4, where we specified α = 0.05 and
so the boundaries of the critical region are at
Z 0.025 1.96 and
 Z 0.025  1.96 from normal distribution
tables.
7. Computations: The value of the test statistics is,
0.51  0.38
Z0  2.17
 1 1 
0.5933(1  0.5933)  
 200 100 

6. Conclusion: Since Z0 = 2.17 > 1.96 (Zα/2), we reject H0:


p1 = p2 at 0.05 level of significance. Hence we reject
the claim that the drug is equally effective for men and
women.
TESTS FOR DIFFERENCE BETWEEN
TWO POPULATION PROPORTIONS

Note: In case of one tail tests –


when the alternative is of the type H1: p1 > p2 the
conclusion would be to reject H0: p1 = p2 at the
0.05 level of significance, since Z0 = 2.17 > 1.64 (Zα)
and conclude that the drug is more effective for
men than women.

when the alternative is of the type H1: p1 < p2 the


conclusion would be do not reject H0: p1 = p2 at
the 0.05 level of significance, since
Z0 = 2.17 > - 1.64 (Zα) and conclude that the drug is
more effective for men than women.
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)
 Testing for the difference between two means from two
independent populations with means μ1 and μ2 and variances
σ12 and σ22­respectively. Inference will be based on two
random samples of sizes n1 and n2 respectively.
 Let x11, x12, … , x1n1 is a random sample of n1 observations from
the population with mean μ1 and variance σ12 and x21, x22, … ,
x2n2 is a random sample of n2 observations from the population
with mean μ2 and variance σ22. Assume that both populations
x  x 2  ( 1   2 )
are independent and normal.Z  1
 Then the random variable,  12  22

n1 n2

has a N(0,1) distribution.


TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)
The hypotheses tested are:
Case Null hypothesis Alternative hypothesis Number of tails
μ1 = μ 2 μ1≠ μ2
1 or or 2
μ1 - μ2 =0 μ1 - μ2 ≠0
μ1 ≥ μ2 μ1 < μ2
2 or or 1
μ1 - μ2 ≥0 μ1 - μ2 <0
μ1 ≤ μ2 μ1 > μ2
3 or or 1
μ1 - μ2 ≤ 0 μ1 - μ2 > 0
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)
 Given the two sample observations, calculate the
sample means x1 and x 2. Under the null
hypothesis the test statistic becomes,
x1  x 2
Z0 
 12  22

n1 n2

 Compare the calculated value of Z0 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.
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)

Case Null Alternative Number of Reject Null


hypothesis hypothesis tails Hypothesis
μ1 = μ 2 μ1≠ μ2
1 or or 2 Z 0 Z  / 2
μ1 - μ2 =0 μ1 - μ2 ≠0
μ1 ≥ μ2 μ1 < μ2 Z 0  Z 
2 or or 1
μ1 - μ2 ≥0 μ1 - μ2 <0
μ1 ≤ μ2 μ1 > μ2 Z 0 Z 
3 or or 1
μ1 - μ2 ≤ 0 μ1 - μ2 > 0
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)
EXAMPLE:

A product developer is interested in reducing the drying time of


primer paint. Two formulations of the paint are tested.
Formulation-1 is the standard chemistry and Formulation-2 has a
new drying ingredient that should reduce the drying time. From
experience it is known that the standard deviation of drying time is
8 minutes and this inherent variability should be unaffected by the
addition of the new ingredient. Ten specimens are painted with
Formulation-1 and another 10 specimens are painted with
Formulation-2; the 20 specimens are painted in random order. The
two sample average drying times are 121 minutes and 112 minutes
respectively. What conclusions can be the product developer draw
about the effectiveness of the new ingredient, using α = 0.05.
TEST FOR DIFFERENCE IN TWO MEANS
KNOWN VARIANCE - (Z- Test)

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.

Calculate the test statistic

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

Null Alternative Number Reject Null


Case
hypothesis hypothesis of tails Hypothesis
1 μ = μ0 μ ≠ μ0 2 t t / 2

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

1. The parameter of interest is the mean


coefficient of restitution, μ.
2. H0: μ ≤ 0.82
3. H1: μ > 0.82. We want to reject H0 if the
mean coefficient of restitution exceeds 0.82
4. α = 0.05
5. The test statistics is
X  0
t0 
s/ n
TESTS FOR MEAN
UNKNOWN VARIANCE: (t- Test)
6. Reject H0 if t0 ≥ 1.761 (t0.05, 14)

7. Computations: Since = 0.83725, s = 0.02456,


μ0 = 0.82 and n = 15 we have,

0.83725  0.82
t0  2.72
0.02456 / 15

8. Conclusion: Since t0 = 2.72 > 1.761 (t0.05, 14), we


reject H0: μ = 0.82 at the 0.05 level of
significance that the mean coefficient of
restitution exceeds 0.82 based on a sample of
15 measurements.
TESTS FOR MEAN
UNKNOWN VARIANCE: (t- Test)
Note: In case of a two tail test –
when the alternative is of the type H1: μ ≠ 0.82 the conclusion
would be to reject H0: μ = 0.82 at the 0.05 level of significance,
since t0 = 2.72 > 2.145 (t0.025). Stated more completely, we
conclude that the mean coefficient of restitution is not equal
to 0.82 based on a sample of 15 measurements

In case of an one tail test –


when the alternative is of the type H1: μ < 0.82, the conclusion
would be do not reject H0: μ ≥ 0.82 at the 0.05 level of
significance, since t0 = 2.72 > - 1.761 ( - t0.05, 14), Stated more
completely, we conclude that the mean coefficient of
restitution exceeds 0.82 based on a sample of 15
measurements
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
Testing for the difference between two means from two
independent populations with means μ1 and μ2 and unknown
variances σ12 and σ22­respectively. Here it is assumed that σ 12 =
σ22 = σ2. That is the variances of the two normal populations are
unknown but are equal. Inference will be based on two random
samples of sizes n1 and n2 respectively.

Let x11, x12, … , x1n1 is a random sample of n1 observations from the


population with mean μ1 and x21, x22, … , x2n2 is a random sample of
n2 observations from the population with mean μ2 and common
unknown variance σ2. Assume that both populations are
independent and normal.
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
The pooled estimator of the common variance σ2 from
the two samples is
2 2
( n  1) s  ( n  1) s
s 2p  1 1 2 2

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

has t-distribution with n1+n2-2 degrees of freedom.


TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
The hypotheses tested are:

Case Null Alternative Number of


hypothesis hypothesis tails
μ1 = μ 2 μ1≠ μ2
1 or or 2
μ1 - μ2 = 0 μ1 - μ2 ≠ 0
μ1 ≥ μ2 μ1 < μ2
2 or or 1
μ1 - μ 2 ≥ 0 μ1 - μ 2 < 0
μ1 ≤ μ2 μ1 > μ 2
3 or or 1
μ1 - μ 2 ≤ 0 μ1 - μ 2 > 0
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)
Given the two sample observations, calculate the
sample means x1 , x 2 and the pooled estimate sp.

Under the null hypothesis the test statistic becomes,


x1  x 2
to 
1 1
sp 
n1 n2

Compare the ‘t’ calculated value with  and t / 2 which


t
are the critical values from t- distribution
corresponding to α and α/2 probabilities representing
one tail and two-tail tests.
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)

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).

7. Computations: We have x1= 92.255, x 2= 92.733, s1 = 2.39, s2 = 2.98 and


n1= n2 = 8. Therefore, 2 (n1  1) s12  (n2  1) s 22 7(2.39) 2  7(2.98) 2
sp   7.30
n1  n2  2 88 2

And sp = √7.30 = 2.70 92.255  92.733


t0   0.35
Hence the value of test statistic is,  1 1
2.70   
 8 8

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 σ22­respectively.
 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 σD2­is given by s D  n  1  (di  d )
2 2

1
d 
n
 di
where di = x1j-x2j and
PAIRED t-TEST
HYPOTHESES TESTED

Case Null Alternative Number of


hypothesis hypothesis tails
1 μD = 0 μD ≠ 0 2
2 μD ≥ 0 μD < 0 1
3 μD ≤ 0 μD > 0 1
PAIRED t-TEST
 Given the pairs of sample observations, calculate d
and sD2. Under the null hypothesis the test statistic
becomes,
d
t0 
sD / n

 where t0 has a t-distribution with (n-1) degrees of


freedom. Compare the t0 calculated value with t 
t / 2
and which are the critical values from normal
distribution corresponding to α and α/2
probabilities representing one tail and two-tail tests.
The decisions are given in the following table.
TEST FOR DIFFERENCE IN TWO MEANS
UNKNOWN VARIANCE - (t- Test)

DECISION

Null Alternative Number Reject Null


Case
hypothesis hypothesis of tails Hypothesis
1 μD = 0 μD ≠ 0 2 t 0 t / 2
μD ≥ 0 μD < 0 t 0  t
2 1
μD ≤ 0 μD > 0
t 0 t
3 1
PAIRED t-TEST
EXAMPLE: Girde Karlsruh Lehigh Difference
The following data r Method Method dj
refers to Strength 1 1.186 1.061 0.119
predictions for 2 1.151 0.992 0.159
nine Steel Plate
Girders by 3 1.322 1.063 0.259
Karlsruhe and 4 1.339 1.062 0.277
Lehigh Methods.
5 1.200 1.065 0.138
Test whether there
is any significant 6 1.402 1.178 0.224
difference 7 1.365 1.037 0.328
between the two
8 1.537 1.086 0.451
methods.
9 1.559 1.052 0.507
PAIRED t-TEST
1. The parameters of interest is the mean of the
differences in strength between the two methods, say,
μD = μ1 - μ 2 = 0.
2. H0: μD = 0
3. H1: μD ≠ 0
4. α = 0.05
5. The test statistics is

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).

7. Computations: We have d = 0.2736, and sD = 0.1356 and n = 9.


Therefore,
0.2736
t0  6.05
0.1356 9

8. Conclusion: Since t0 = 6.05 > 2.306 ( = t0.025,8) we reject H0: μD = 0


at the 0.05 level of significance and conclude that the strength
prediction methods yield different results.
PAIRED t-TEST
Note: In case of one tail tests –
 When the alternative is of the type H1: μD > 0 the conclusion
would be to reject H0: μD = 0, at the 0.05 level of significance,
since t0 = 6.05 > 1.860 (=t0.05,8). Specifically, the data indicate that
the Karlsruhe Method produces, on the average higher strength
predictions than does the Lehigh Methods.

 when the alternative is of the type H1: μD < 0 the conclusion


would be do not reject H0: μD = 0, at the 0.05 level of significance,
since t0 = 6.05 > -1.860 (=-t0.05,8). Specifically, the
data indicate that the Karlsruhe Method produces, on the
average higher strength predictions than does the Lehigh
Methods.

You might also like