Datatab

One sample t-test

The t-test is one of the most common hypothesis tests in statistics. The t-test determines either whether the sample mean and the mean of the population differ or if two sample means differ statistically. The t-test distinguishes between

One sample 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.

Social science example:

You want to find out whether the health perception of managers in Canada differs from that of the population as a whole. For this purpose you ask 50 managers about their perception of health.

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.

One tailed and two tailed t-test

One tailed and two tailed t-test

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:

Two-tailed (non-directional)

Is there a statistically significant difference between the mean value of the sample and the population?

One-tailed (directional)

Is the mean value of the sample significantly larger (or smaller) than the mean value of the population?

For the examples above, this gives us the following questions:

  • 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:

Two-tailed (non-directional)

  • 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.

One-tailed (directional)

  • 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.

One Sample t-test formula

You can calculate the t-test either with a statistics software like DATAtab or by hand. For the calculation by hand you first need the test statistics t, which can be calculated for the one sample t-test with the formula

Test-Statistik t berechnen

In order to check whether the mean sample value differs significantly from that of the population, the critical t-value must be calculated. First the number of degrees of freedom, abbreviated df, is required, which is calculated by taking the number of samples minus one.

Degree of freedom

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.

Area one tailed
Degree of Freedom 0.5 0.75 0.8 0.85 0.9 0.95 0.975 0.99 0.995 0.999 0.9995
... ... ... ... ... ... ... ... ... ... ... ...
9 0 0.703 0.883 1.1 1.383 1.833 2.262 2.821 3.25 4.297 4.781
10 0 0.7 0.879 1.093 1.372 1.812 2.228 2.764 3.169 4.144 4.587
11 0 0.697 0.876 1.088 1.363 1.796 2.201 2.718 3.106 4.025 4.437
12 0 0.695 0.873 1.083 1.356 1.782 2.179 2.681 3.055 3.93 4.318
13 0 0.694 0.87 1.079 1.35 1.771 2.16 2.65 3.012 3.852 4.221
... ... ... ... ... ... ... ... ... ... ... ...

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.

Number of degrees of freedom - df

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.

One sample t-test example

As an example for the t-test for one sample, we examine whether an online statistics tutorial newly introduced at the university has an effect on the students' examination results.

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
7 37
8 39
9 22
10 29
11 36
12 38
Here's how it goes on DATAtab:

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
N Mean value Standard deviation Standard error of the mean value
Score 12 32.33 5.47 1.58
One sample t-test (Test Value = 28)
t df p-value (2-tailed)
Score 2.75 11 0.02
95% confidence interval of the difference
Mean value difference Lower Upper
Score 4.33 0.86 7.81

To interpret whether your hypothesis is significant one of the two values can be used:

  • 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.

APA Style | One sample t-test

If we were to write the top results for publication in an APA journal, that is, in an APA format, we would write it that way:

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.


Statistics made easy

  • Many illustrative examples
  • Ideal for exams and theses
  • Statistics made easy on 251 pages
  • Only 6.99 €
Free sample
Datatab

"Super simple written"

"It could not be simpler"

"So many helpful examples"

Cite DATAtab: DATAtab Team (2023). DATAtab: Online Statistics Calculator. DATAtab e.U. Graz, Austria. URL https://datatab.net

Contact & Support FAQ & About Us Privacy Policy Statistics Software