Gosset invented the t -test to handle small samples for quality
control in brewing. He wrote under the name "Student".
t test-origint test-origin
Founder WS GossetFounder WS Gosset
Wrote under the pseudonym “Student”Wrote under the pseudonym “Student”
Mostly worked in tea (t) timeMostly worked in tea (t) time
? Hence known as Student's ? Hence known as Student's t t test. test.
Preferable when the n < 60Preferable when the n < 60
Certainly if n Certainly if n << 30 30
TypesTypes
One sample One sample
compare with populationcompare with population
UnpairedUnpaired
compare with controlcompare with control
PairedPaired
same subjects: pre-postsame subjects: pre-post
T-testT-test
1.1.Test for single meanTest for single mean
Whether the sample mean is equal to the predefined
population mean ?
2. Test for difference in means. Test for difference in means
Whether the CD4 level of patients taking treatment A is
equal to CD4 level of patients taking treatment B ?
3. Test for paired observationTest for paired observation
Whether the treatment conferred any significant benefit ?
Test directionTest direction
One tailed t testOne tailed t test
Two tailed testTwo tailed test
Developing the
Pooled-Variance t Test (Part 1)
•Setting Up the Hypothesis:
H
0:
1 -
2 = 0
H
1
:
1
-
2
0
H
0:
1 =
2
H
1:
1
2
OR
Two
Tail
Mean systolic BP in nephritis is significantly Mean systolic BP in nephritis is significantly
higher than of normal personhigher than of normal person
100 110 120 130 140
0.050.05
Mean systolic BP in nephritis is significantly Mean systolic BP in nephritis is significantly
different from that of normal person different from that of normal person
0.025 0.025
100 110 120 130 140
Statistical AnalysisStatistical Analysis
control
group
mean
treatment
group
mean
Is there a difference?
What doesWhat does differencedifference mean?mean?
medium
variability
high
variability
low
variability
The mean difference
is the same for all
three cases
What doesWhat does differencedifference mean?mean?
medium
variability
high
variability
low
variability
Which one shows
the greatest
difference?
What doesWhat does differencedifference mean?mean?
a statistical difference is a function of the a statistical difference is a function of the
difference between meansdifference between means relative to the relative to the
variabilityvariability
a small difference between means with a small difference between means with
large variability could be due to large variability could be due to chancechance
like a like a signal-to-noisesignal-to-noise ratio ratio
low
variability
Which one shows
the greatest
difference?
So we estimateSo we estimate
low
variability
signal
noise
difference between group means
variability of groups
=
X
T - X
C
SE(X
T
- X
C
)
=
=t-value
__
__
Two sample t-testTwo sample t-test
Difference
between means
Sample size
Variability
of data
t-test t t
+
+
Probability - pProbability - p
With t we check the probability With t we check the probability
Reject or do not reject Null hypothesisReject or do not reject Null hypothesis
You reject if p < 0.05 or still lessYou reject if p < 0.05 or still less
Difference between means (groups) is Difference between means (groups) is
more & more significant if p is less & lessmore & more significant if p is less & less
.95
t0
f(t)
-1.96 1.96
.025
red area = rejection region for 2-sided test
AssumptionsAssumptions
Normal distributionNormal distribution
Equal varianceEqual variance
Random samplingRandom sampling
t-Statistict-Statistic
ns
x
t
/
When the sampled population is normally When the sampled population is normally
distributed, the t statistic is Student t distributed, the t statistic is Student t
distributed with n-1 degrees of freedom.distributed with n-1 degrees of freedom.
T- test for single meanT- test for single mean
The following are the weight (mg) of each of 20
rats drawn at random from a large stock. Is it
likely that the mean weight of these 20 rats are
similar to the mean weight ( 24 mg) of the whole
stock ?
9 18 21 26
14 18 22 27
15 19 22 29
15 19 24 30
16 20 24 32
Steps for test for single meanSteps for test for single mean
1.Questioned to be answered
Is the Mean weight of the sample of 20 rats is 24 mg?
N=20, =21.0 mg, sd=5.91 , =24.0 mg
2. Null Hypothesis
The mean weight of rats is 24 mg. That is, The
sample mean is equal to population mean.
3. Test statistics --- t
(n-1)
df
4. Comparison with theoretical value
if tab t
(n-1) < cal t
(n-1) reject Ho,
if tab t
(n-1)
> cal t
(n-1)
accept Ho,
5. Inference
ns
x
t
/
x
t –test for single mean t –test for single mean
Test statisticsTest statistics
n=20, =21.0 mg, sd=5.91 , n=20, =21.0 mg, sd=5.91 ,
=24.0 mg=24.0 mg
tt
= t = t
.05, 19 .05, 19 = 2.093 = 2.093 Accept H Accept H
00 if t < 2.093 if t < 2.093Reject Reject
HH
00 if t >= 2.093 if t >= 2.093
x
30.2
2091.5
240.21
ll
t
Inference :Inference :
There is no evidence that the sample is taken There is no evidence that the sample is taken
from the population with mean weight of 24 gmfrom the population with mean weight of 24 gm
In Conclusion !In Conclusion !
Student ‘s t-test will be used:Student ‘s t-test will be used:
--- When Sample size is small--- When Sample size is small
and for the following situations:and for the following situations:
(1) to compare the single sample mean(1) to compare the single sample mean
with the population meanwith the population mean
(2) to compare the sample means of (2) to compare the sample means of
two indpendent samplestwo indpendent samples
(3) to compare the sample means of (3) to compare the sample means of
paired samples paired samples