T -test
T -test
The choice of which t-test to use depends on whether one or two samples are available. If two
samples are available, a distinction is made between dependent and independent samples. In this
tutorial you will find everything about the one sample t-test.
Tip: Do you want to calculate the t-value? You can easily calculate it for all three t-tests online
in the t-test calculator on DATAtab
The one sample t-test is used to test whether the population differs from a fixed value. So, the
question is: Are there statistically significant differences between a sample mean and the fixed
value? The set value may, for example, reflect the remaining population percentage or a set
quality target that is to be controlled.
Technical example:
You want to find out if the screws your company produces really weigh 10 grams on average. To
test this, weigh 50 screws and compare the actual weight with the weight they should have (10
grams).
Medical example:
A pharmaceutical company promises that its new drug lowers blood pressure by 10 mmHg in
one week. You want to find out if this is correct. To do this, compare the observed reduction in
blood pressure of 75 test subjects with the expected reduction of 10 mmHg.
Assumptions
In a one sample t-test, the data under consideration must be from a random sample, have metric
scale of measurement, and be normally distributed.
So if you want to know whether a sample differs from the population, you have to calculate a
one sample t-test. But before the t-test can be calculated, a question and the hypotheses must first
be defined. This determines whether a one tailed (directional) or a two tailed (non-
directional) t-test must be calculated.
The question helps you to define the object of investigation. In the case of the one sample t-
test the question is:
Is the mean value of the sample significantly larger (or smaller) than the mean value of the
population?
Does the health perception of managers in Canada differ from that of the overall
population in Canada?
Does the production plant produce screws with a weight of 10 grams?
Does the new drug lower blood pressure by 10 mmHg within one week?
Hypotheses t-Test
In order to perform a one sample t-test, the following hypotheses are formulated:
Null hypothesis H0: The mean value of the population is equal to the specified value.
Alternative hypothesis H1: The mean value of the population is not equal to the specified
value.
Null hypothesis H0: The mean value of the population is equal to or greater than (or less
than) that of the specified value.
Alternative hypothesis H1: The mean value of the population is smaller (or larger) than the
specified values.
where the standard deviation is the population standard deviation estimated using the sample.
If the number of degrees of freedom is known, the critical t-value can be determined using
the table of t-values. For a sample of 12 people, the degree of freedom is 11, and the significance
level is assumed to be 5 %. The table below shows the t values for a one tailed open distribution.
Depending on whether you want to calculate a one tailed (directional) or two tailed (non-
directional) t-test, you must read the t value at either 0.95 or 0.975. For the non-directional
hypothesis and an significance level of 5%, the critical t-value is 2.201.
If the calculated t value is below the critical t value, there is no significant difference between the
sample and the population; if it is above the critical t value, there is a significant difference.
Interpret t-value
The t-value is calculated by dividing the measured difference by the scatter in the sample data.
The larger the magnitude of t, the more this argues against the null hypothesis. If the calculated t-
value is larger than the critical t-value, the null hypothesis is rejected.
The number of degrees of freedom indicates how many values are allowed to vary freely. The
degrees of freedom are therefore the number of independent individual pieces of information.
The average score in the statistics test at a university has been 28 points for years. This semester
a new online statistics tutorial was introduced. Now the course management would like to know
whether the success of the studies has changed since the introduction of the statistics tutorial:
Does the online statistics tutorial have a positive effect on exam results?
The population considered is all students who have written the statistics exam since the new
statistics tutorial was introduced. The reference value to be compared is 28.
Null hypothesis H0
The mean value from the sample and the predefined value does not differ significantly. The
online statistics tutorial has no significant effect on exam results.
Student Score
1 28
2 29
3 35
4 37
5 32
6 26
Student Score
7 37
8 39
9 22
10 29
11 36
12 38
Do you want to calculate a t-test independently? Calculate the example in the Statistics
Calculator. Just copy the upper table including the first row into the t-Test Calculator. Datatab
will then provide you with the tables below.
The following results are obtained with DATAtab: The mean value is 32.33 and the standard
deviation 5.46. This leads to a standard error of the mean value of 1.57. The t-statistic thus gives
2.75
You would now like to know whether your hypothesis (the score is 28) is significant or not. To
do this, you first specify a significance level in Datatab, usually 5% is used, which is preselected.
Now you will get the table below in Datatab.
Statistics
t df p
Scor 2.75 1 0.02
e 1
p-value (2-tailed)
lower and upper confidence interval of the difference
In this example p-value (2-tailed) is equal to 0.02, i.e. 2 %. Put into words this means: The
probability that a sample with a mean difference of 4.33 or more will be drawn from the
population is 2%. The significance level was set at 5%, which is greater than 2%. For this reason,
a significant difference between the sample and the population is assumed.
Whether or not there is a significant difference can also be read from the confidence interval of
the difference. If the lower and upper limits go throw zero, there is no significant difference. If
this is not the case, there is a significant difference. In this example, the lower value is 0.86 and
the upper value is 7.81. Since the lower and upper values do not touch zero, there is a significant
difference.
A t-test showed a statistically reliable difference between the score of students who attended the
online course and the average score of students who did not attend an online course. (M = 32.33,
s = 5.47) and 28, t(11) = 2.75, p < 0.02, α = 0.05.