1) The document presents information on different types of t-tests including the single sample t-test, independent sample t-test, and dependent/paired sample t-test. Equations and examples are provided for each.
2) The single sample t-test compares the mean of a sample to a hypothesized population mean. The independent t-test compares the means of two independent samples. The dependent t-test compares the means of two related samples, such as pre-and post-test scores.
3) A z-test is also discussed and compared to t-tests. The z-test is used when the population standard deviation is known and sample sizes are large, while t-tests are used
1. UNIVERSITY OF MEDICAL SCIENCE
AND TECHNOLOGY
Faculty of Pharmacy
Graduate college
M.Sc. of Pharmaceutical Analysis And Quality
Control
Batch (9)
Subject: Biostatistics
Presentation: the t-test
Prepared by
Mohamed Hersi Farah
Modether aldow
Aya Ahmed Salih Ahmed
Under the supervision of
Dr.Suleiman Abdgabbar Abdullah
28th of December 2019
1
3. OVERVIEW
1. Introduction
Definitions
Applications of t-test
2. Types of t-test
Single sample t-test
Equation for one-sample t-test
Example of one-sample t-test
How to calculate one-sample t-test
Independent t-test
Equation for independent sample t-test
Example of independent sample t-test
How to calculate independent t-test
3
4. OVERVIEW…..
Dependent t-test or Paired t-test
Equation for dependent sample t-test
Example of dependent sample t-test
The procedure follows when calculating paired t-test
3. z-test.
Comparison of t-test and z-test
Formula to find the value of z-test is
When do we use z-test
4. Summary
5. Reference
4
5. 1. INTRODUCTION
1.1 Definitions:
The t score: is a ratio between the
difference between two groups and the
difference within the groups.
A large t-score tells you that the
groups are different (not
significance).
A small t-score tells you that the
groups are similar (significance).
5
6. INTRODUCTION………
A p-value: is the probability that the results
from your sample data occurred by chance. P-
values are from 0% to 100%. They are usually
written as a decimal. For example, a p value of
5% is 0.05. Low p-values are good. In most
cases, a p-value of 0.05 (5%) is accepted to
mean the data is valid.
6
7. INTRODUCTION……..
A t-test: is a type of inferential statistic used to determine if
there is a significant difference between the means of two
groups, which may be related in certain features.
The t test tells you how significant the differences between
groups are; In other words it lets you know if those differences
(measured in means/averages) could have happened by chance.
7
8. 1.2 APPLICATIONS OF T-TEST
The calculations of a confidence interval
for a sample mean
To test whether a sample mean is different
from a hypothesized value
To compare mean two samples
To compare two sample means by group
8
9. 2. TYPES OF T-TEST
1) Single sample t-test: is a statistical procedure used to
determine whether a sample of observations could have been
generated by a process with a specific mean.
2) Independent sample t-test: we have two means; two
groups; no relation between groups, example when we want
to compare the mean of T/T groups with Placebo group.
3) Dependent t-test or Paired t-test: it consist of samples of
matched pairs of similar units or one group of units tested
twice; Example: difference of mean pre and post drug
intervention.
9
10. 2.1 SINGLE SAMPLE T-TEST
It is used in measuring whether a sample
value significantly differs from a
hypothesized value.
The single-sample t test compares the
mean of your sample data to a known
value. For example, you might want to
know how your sample mean compares to
the population mean. You should run a one
sample t test when you don’t know the
population standard deviation or you have
a small sample size.
10
11. 2.1.1 EQUATION FOR ONE-SAMPLE T-TEST
𝑡 =
𝑥 − 𝜇
𝑠/ 𝑛
Where:
t = the t statistic
𝑥 =the mean of the sample
𝜇 =the comparison mean
S= the sample standard deviation
n = the sample size
11
12. 2.1.2 EXAMPLE OF ONE-SAMPLE T-TEST
10 individuals had taken an
exam and we want to test
whether their scores, all
together, are significantly
different from the score of 100.
while standard deviation is 5.35
and sample mean is 107.8.
12
13. SOLUTION:
𝑡 =
107.8 − 100
5.35/ 10
= 4.61
We need to calculate the degree of freedom
Here, the degree of freedom is simply the sample
size minus one (n-1), 10-1=9
Now, we will refer to a t-table to determine the
critical t value for 9 degrees of freedom at the 0.05
level of significance
Looking at a t-table, this value of 4.61 is greater
than the critical t value of 2.26, we can say that the
score of our sample of 10 individuals differ
significantly from the score of 100. 13
15. 2.1.3 HOW TO CALCULATE ONE-SAMPLE T-TEST
Calculate The sample means (x̄ ).
Find The population means or comparison mean (μ).
Calculate The sample standard deviation(s).
Find the sample size (n).
Calculate the degree of freedom.
Insert the items from the above into the t-score formula and
calculate t-value.
Find the t-table value (critical t-value) by using your calculated
degree of freedom.
Compare the two t-values you have, if the calculated t value is
greater then the critical t- value the result is no significant or we
can reject the null hypothesis.
15
16. 2. INDEPENDENT T-TEST
The independent sample t-test consist of test that
compare mean value (s)of continuous- level (interval
or ratio data), in a normal distributed data.
The independent sample t-test compares two means.
The independent sample t-test is also called unpaired
t-test/ sample t-test.
It is the t-test to be use when two separate independent
and identically distributed variables are measured.
Example: comparison of mean cholesterol levels in
treatment group with placebo group after
administration of test drug.
16
17. 2.2.1 EQUATION FOR INDEPENDENT
SAMPLE T-TEST
𝑡 =
𝑥1 − 𝑥2
𝑠𝑠1 + 𝑠𝑠2
𝑛1 + 𝑛2 − 2
.
1
𝑛1
+
1
𝑛2
Here:
t = the t statistic
𝑥1 and 𝑥2 are the means of the two different groups
n1= n of group one
n2 = n of group two
SS= sum of squares
17
18. 2.2.2 EXAMPLE OF INDEPENDENT SAMPLE T-TEST
Suppose we have to compare the mean value of two groups, one
with 7 subjects and the other with 5 subjects.
These are their score:
Case Group One Group Two
1 78 87
2 82 92
3 87 86
4 65 95
5 75 73
6 82
7 71
x 77.14 86.60
SS 334.86 285.20
18
20. SOLUTION:
𝑡 =
77.14 − 86.60
334.86 + 285.20
7 + 5 − 2
1
7
+
1
5
−9.46
620.06
10
12
35
=
−9.46
21.26
= −0.44
For an independent
or between subjects
t-test: degree
freedom = n1+n2-2
7+5-2=10
Now, take the absolute value
of this, which is 0.44.
Now, for the 0.05 probability
level with 10 degrees of
freedom, we see from the
table that the critical t score is
2.228 for to tailed test.
Since the calculated t score is
less than the critical t score,
the results are significant at
the 0.05 probability.
20
22. 2.2.3 HOW TO CALCULATE INDEPENDENT T-TEST
Calculate the difference between two sample mean (x1 and
x2).
Calculate the sum of squares (SS1 and SS2).
Then calculate the degree of freedom (n1+n2-2).
Insert the items from the above into the t-score formula and
calculate t-value.
Find the t-table value (critical t-value) by using your
calculated degree of freedom.
Compare the two t-values (t-score) you have, if the calculated t
value is greater then the critical t- value the result is no
significant or we can reject the null hypothesis.
22
23. 2.3 DEPENDENT T-TEST OR PAIRED T-TEST
A paired t-test is used to compare two population
means where you have two samples in which
observations in one sample can be paired with
observations in the other sample.
A comparison of two different methods of
measurement or two different treatment where the
measurements/treatments are applied to the same
subjects.
Example: 1. pre-test/posttest samples in which a
factor is measured before and after an intervention.
2. Matched samples, in which individuals are matched
on personal characteristics such as age and sex.
23
24. 2.3.1 EQUATION FOR DEPENDENT SAMPLE T-TEST
𝑡 =
𝑥 − 𝜇
𝑆 𝑛
t = the t statistic
𝒙d = mean difference
𝑺 𝒏 = standard error of the mean
difference
𝝁 ∶H0=0; the null hypothesis 24
25. 2.3.3 EXAMPLE OF DEPENDENT SAMPLE T-TEST
Table below shows an intensive intervention
program for 10 subjects with BMI more
than 25 kg/m2. After a 12-week lifestyle
change (diet and physical activity) trial,
BMIs are compared between baseline and at
week 12. Paired t-test is applied to test the
mean difference in subjects with before and
after the intervention.
25
27. SOLUTION:
𝑡 =
2.9−0
3.03 10
= 3.0266
Note that, because t distribution is changed with the
number of observation (or degree of freedom, df), when
t statistic is calculated, it should be compared with the t
values in a standard t-distribution table. In the
example, n = 10, df = 10−1 = 9, from t-distribution
table, when df = 9, if P-value = 0.05 (for two-tailed
test), t-value = 2.26; and if P-value = 0.01 (for two-
tailed test), t-value = 3.25. That is, our observed t-value
(3.02) >2.26, P < .05. We reject the null hypothesis.
27
29. 2.3.4 THE PROCEDURE FOLLOWS WHEN
CALCULATING PAIRED T-TEST
Calculate the difference between the two observations
on each pair.
Calculate the mean difference
Calculate the standard error of the mean difference.
Calculate the t-test, which is given by under the null
hypothesis, this statistics follow a t-distribution with
n-1 degree of freedom.
Use t-table of the t-distribution to compare your t
value to the t from t table .
29
30. Z-TEST
Z-test is the statistical hypothesis which
is used in order to determine that whether
the to samples means calculated are
different in case the standard deviation is
available and sample is large.
30
31. COMPARISON OF T-TEST AND Z-TEST
t-test uses:
t-test can be used to test a
hypothesis, but they are very
useful when we need to
determine if there is a
statistically significant
comparison between the 2
independent sample groups.
Usually, t-test are more
appropriate when you are
dealing with problems with a
limited sample size example
n<30.
Mostly, they are useful when the
standard deviation is unknown.
z-test uses
Z-test can be used to compare
population averages to a
sample’s.
The z-test will be tell you how
far, in standard deviation terms,
a data point is from the average
of a data set.
A z-test will do a comparison of
a sample to a defined population
that is typically used for dealing
with problems relating to a large
samples. (Example, n>30)
Mostly, they are very useful
when the standard deviation is
known. 31
32. FORMULA TO FIND THE VALUE OF Z-TEST IN
ONE SAMPLE:
Z =
𝑥 − 𝜇
𝜎
𝑥=mean of sample
𝜇=mean of population
𝜎=standard deviation of population
32
33. EXAMPLE OF Z-TEST IN ONE SAMPLE:
For example, let’s say you have a test score of 190.
the test has mean of 150 and a standard deviation of
25. assuming a normal distribution, your z score
would be:
Z =
𝑥−𝜇
𝜎
=
190−150
25
= 1.6
The z score tells you have many standard deviations
from the mean your score is. In this example, your
score is 1.6 standard deviations above the mean.
33
34. Z TEST FORMULA: STANDARD ERROR OF THE
MEAN
Z =
𝑥 − 𝜇
𝜎/ 𝑛
𝑥=mean of sample
𝜇=mean of population
𝜎/ 𝑛=standard error of the mean
34
35. EXAMPLE OF STANDARD ERROR OF THE
MEAN
In general, the mean height of the women is 65 “with
a standard deviation of 3.5”. What is the probability
of finding a random sample of women with a mean
height of 70”, assuming the heights are normally
distributed?
solution:
Z =
𝑥 − 𝜇
𝜎/ 𝑛
=
70−65
3.5/ 50
=
5
0.495
=10.1
35
36. WHEN DO WE USE Z-TEST
When samples are draw at random
When the samples are taken from population are
independent.
When standard deviation is know
When number of observation is larger than (n≥30)
36
37. SUMMARY
The t-test compares the actual difference
between two means in relation to the
variation in the data (expressed as the
standard deviation of the difference between
the means).
37
38. SUMMARY CONT……..
One –sample t-test: Difference between a set value and
a variable.
Independent sample t-test: difference between two
independent groups. (between subjects).
Dependent sample t-test: difference between two
related measures (example, repeated over time or two
related measures at one time). (within subjects).
Z- test: is any statistical test for which the distribution of
the test statistic under the hypothesis can be a normal
distribution
38
39. 4. REFERENCE:
Meier et. al. (2014). Applied Statistics for Public and
Nonprofit Administration, Cengage Learning.
Altaian DG (1991) Practical Statistics for Medical
Research. Chapman & Hall, London.
Armitage P, Matthews JNS and Berry G (2001)
Statistical Methods in Medical Research (4e). Blackwell
Scientific Publications, Oxford.
Barker DJP, Cooper C and Rose GR (1998) Bland M
(2000) An Introduction to Medical Statistics (3e). Oxford
University Press, Oxford.
39