Professional Documents
Culture Documents
mpiwowar@cm-uj.krakow.pl
t-Student test
Quick history:
In the year 1908, an Englishman named William Sealy Gosset developed the t-
test as well as t distribution.
Gosset worked as a head brewer of the Guinness brewery in Dublin and found
which existing statistical techniques using large samples were not useful for the
small sample sizes which he encountered in his work.
• Two-samples t test for independent samples (is used to compare two means
from independent populations)
• Paired t test for dependent samples (is used to compare two means from
dependent population)
• One-sample t test (is used for one sample and one mean value)
Monika Piwowar
mpiwowar@cm-uj.krakow.pl
Caution! Remember that two-samples and paired t test can be used to TWO AND
ONLY TWO MEANS. No more! If you need to compare more than two means you
have to you other statistical algorithm, e.g. one-way analysis of variance (one-way
ANOVA).
Consider a drug company that wants to test the effectiveness of a new drug in reducing
blood pressure. They could collect data in two ways:
• Sample the blood pressures of the same people before and after they receive a
dose. The two samples are dependent because they are taken from the same
people. The people with the highest blood pressure in the first sample will likely
have the highest blood pressure in the second sample.
• Give one group of people an active drug and give a different group of people an
inactive placebo, then compare the blood pressures between the groups. These
two samples would likely be independent because the measurements are from
different people. Knowing something about the distribution of values in the first
sample doesn't inform you about the distribution of values in the second.
-------------------------------------------------------------------------------------------------
Two-samples t-test
(independent two samples)
The idea of the t test for independent samples (two-sample t-test) is to compare means
of variable of interest in two different populations. As the test name indicates the
populations (samples) must be independent to each other, the measurement results of
one population are not dependent on the measurement to the other one.
Hypothesis testing involving the difference between two population means is the most
frequently employed to determine whether or not it is reasonable to conclude that the
two population means are unequal. In such case, the following hypotheses may be
formulated:
• The difference between mean value of the variable of interest in the first
population and mean value of the variable of interest in the second population is
not significant.
• The mean values of the variable of interest do not differ significantly between two
studied populations.
• The qualitative factor, that distinguish between populations, is not significant
predictor of the mean value of the variable of interest (it does not make that the
mean values differed in statistically significant way).
How to do it in R
# Two-samples t test (independent 2-group t-test)
Paired t-test
(dependent 2-group t-test)
The idea of the Student's t test for dependent samples (paired version) is double
comparison the same group of people (observations). Our group (sample) are
mutually dependent, because the second test result is dependent on the outcome of the first
study. The purpose of Student's t test paired version is to establish the magnitude of
changes in the measurement of the examined observations.
• The difference between mean value of the variable of interest in the first
measurement time point and mean value of the variable of interest in the second
measurement time point is not significant.
• The mean values of the variable of interest do not differ significantly between two
measurement points.
Monika Piwowar
mpiwowar@cm-uj.krakow.pl
• The qualitative factor (e.g. treatment, time), that distinguish between two
measurement points, is not significant predictor of the mean value of the variable of
interest.
How to do it in R
# paired t test (dependent 2-group t-test)
One-sample t-test
The idea of the ne-sample t test is the comparison of mean in one group of subjects
with the established mean value µ0 (well-known in the theory or from other researches).
Comparison of one group is an exception in the family of t-tests.
The null hypothesis states that there is no significant difference between the mean value in
the whole population (µ) and the established mean value (µ0).
How to do it in R
# one sample t-test