2. Introduction
The t-test is a basic test that is limited to two
groups. For multiple groups, you would have to
compare each pair of groups, for example with
three groups there would be three tests (AB,
AC, BC), whilst with seven groups there would
need to be 21 tests.
The basic principle is to test the null
hypothesis that the means of the two groups
are equal.
3.
The t-test assumes:
It is used when there is random assignment and
only two sets of measurement to compare.
There are two main types of t-test:
A normal distribution (parametric data)
Underlying variances are equal (if not, use Welch's test)
Independent-measures t-test: when samples are not
matched.
Matched-pair t-test: When samples appear in pairs (eg.
before-and-after).
A single-sample t-test compares a sample against
a known figure, for example where measures of a
manufactured item are compared against the
required standard.
4. Applications
To compare the mean of a sample with
population mean.
To compare the mean of one sample
with the mean of another independent
sample.
To compare between the values
(readings) of one sample but in 2
occasions.
4
5. 1.Sample mean and population
mean
The general steps of testing hypothesis must be
followed.
Ho: Sample mean=Population mean.
Degrees of freedom = n - 1
−
X −µ
t =
SE
5
6. Example
The following data represents hemoglobin values in
gm/dl for 10 patients:
10.5 9
6.5
8
11
7
8.5
9.5
12
7.5
Is the mean value for patients significantly differ
from the mean value of general population
(12 gm/dl) . Evaluate the role of chance.
6
7. Solution
Mention all steps of testing hypothesis.
8.95 − 12
t=
= −5.352
1.80201
10
Then compare with tabulated value, for 9 df, and 5% level of
significance. It is = 2.262
The calculated value>tabulated value.
Reject Ho and conclude that there is a statistically significant difference
between the mean of sample and population mean, and this
difference is unlikely due to chance.
7
9. 2.Two independent samples
The following data represents weight in Kg for 10
males and 12 females.
Males:
80
75
95
55
60
70
75
72
80
65
Females:
60
70
50
85
45
60
80
65
70
62
77
82
9
10. 2.Two independent samples, cont.
Is there a statistically significant difference between
the mean weight of males and females. Let alpha =
0.01
To solve it follow the steps and use this equation.
−
t=
−
X1 − X 2
2
2
(n1 − 1) S1 + (n 2 − 1) S 2 1
1
( + )
n1 + n 2 − 2
n1 n 2
10
12. 3.One sample in two occasions
Mention steps of testing hypothesis.
The df here = n – 1.
−
d
t =
sd
n
sd =
d2 −
∑
(∑ d ) 2
n −1
n
12
13. Example: Blood pressure of 8
patients, before & after treatment
BP before BP after
180
140
200
145
230
150
240
155
170
120
190
130
200
140
165
130
Mean d=465/8=58.125
d
40
55
80
85
50
60
60
35
∑d=465
d2
1600
3025
6400
7225
2500
3600
3600
1225
13
∑d2=29175
14. Results and conclusion
t=9.387
Tabulated t (df7), with level of significance
0.05, two tails, = 2.36
We reject Ho and conclude that there is
significant difference between BP readings
before and after treatment.
P<0.05.
14