One-sample t test

from Wikipedia, the free encyclopedia

The sample t-test (engl. One sample t-test ) is a test of significance from the mathematical statistics . Using the mean value of a random sample , it checks whether the mean value of a population is equal to a specified value (or smaller or larger).

A corresponding extension of a comparison of means for two (dependent or independent) samples is the two-sample t-test .

Test idea

The one-sample t-test uses the mean of a sample to check (in the simplest case) whether the mean of the population differs from a given value .

The graphic below shows a population (black dots) and a sample (red dots) that were randomly drawn from the population. The sample mean can be calculated from the sample, but the population mean is unknown. One suspects z. B. because of historical results or theoretical considerations that the mean of the population is different from a given value .

In the simplest case, the test checks

  • the null hypothesis that the population mean equals the given value ( )
  • against the alternative hypothesis that the mean of the population is not equal to the given value ( ).
One sample ttest.svg

If the sample is appropriately drawn, e.g. For example, as a simple random sample , there is a high probability that the mean of the sample will be close to the mean of the population . I.e. the distance between the dashed red and black lines will most likely be small.

  • If the specified value is now close to the mean value of the sample , i.e. H. the dashed blue and dashed red lines have a small distance, then the specified value is also close to the mean value of the population . We cannot then reject the null hypothesis.
  • However, if the specified value is far from the mean value of the sample , i.e. H. the dashed blue and dashed red lines have a large distance, then the specified value is also far away from the mean value of the population . Then we can reject the null hypothesis.

The exact mathematical calculations can be found in the following sections.

Hypotheses

For the one-sample t-test, three different hypothesis pairs (null hypothesis vs. alternative hypothesis ) can be formulated:

  1. vs. (two-sided test),
  2. vs. (right-sided test) and
  3. vs. (left side test),

The same test statistic is used for all three hypothesis pairs , only the areas for the rejection or acceptance of the null hypothesis differ.

Mathematical derivation of the test statistic

For a normally distributed population

If there are independent, normally distributed random variables with expected value and standard deviation , and if you want to test the null hypothesis , then it makes sense to use their arithmetic mean

to use as test statistic . Namely, it is also normally distributed with an expected value , but has the standard deviation . If it is known , the hypothesis could be tested with a Gaussian test . For this one calculates

,

which is standard normally distributed under the null hypothesis.

Normally, however, the standard deviation is unknown and appears here as a so-called interference parameter (since there is no inference here) . In this case it stands to reason to use the empirical standard deviation

to estimate and as test statistic

to use. Under the null hypothesis, however, this statistic is no longer normally distributed, but t-distributed with degrees of freedom . If the value of the test statistic for a specific sample is so large (or so small) that this or an even more significant value is sufficiently improbable under the null hypothesis , the null hypothesis is rejected.

For an arbitrarily distributed population

If ( ) are independently and identically distributed random variables with expected value and standard deviation , then, as in the above case, it is obvious to use their arithmetic mean

to use as test statistic . Although the distribution of is unknown, the central limit theorem means that it is approximately normally distributed with expected value and standard deviation .

Because the standard deviation is normally unknown, it is obvious in this case to use the empirical standard deviation as well

to estimate and again as test statistic

to use. Under the null hypothesis, however, this statistic is only approximately t-distributed with degrees of freedom. If the value of the test statistic for a specific sample is so large (or so small) that this or an even more extreme value is sufficiently improbable under the null hypothesis , the null hypothesis is rejected.

example

Two-sided test

The aim is to test whether the average runtime of notebook batteries deviates from the 3.5 hours specified by the manufacturer. For this purpose, the running times of 10 batteries of this brand are measured under controlled identical conditions. Since we have few observations, the central limit theorem cannot be applied; see section Mathematical Derivation of Test Statistics for an Arbitrarily Distributed Population . We must therefore assume that the runtime of the notebook batteries is normally distributed in the population.

The following hypotheses should be tested:

General example
vs. Hours vs. Hours

For example, performing the test would give the sample mean hours and sample standard deviation hours. The test value can now be calculated from this as follows:

General example
With Hours
and Hours

The null hypothesis is rejected at the significance level , if . Therein corresponds to the - quantile of the t-distribution with degrees of freedom.

For the example, this means that the null hypothesis is rejected at a significance level if t is less than the 2.5% quantile or greater than the 97.5% quantile of the t-distribution with degrees of freedom. The value can be found with the help of a t-table or a computer program . Because of the symmetry of the t-distribution is . Because of the null hypothesis that the expected value of the running time is equal to 3.5 hours, it can be rejected at the level of significance . The batteries do not run for an average of 3.5 hours, i.e. more or less.

One-sided test

In practice, a one-sided test would have been carried out, because the customer is only satisfied if the batteries run for more than 3.5 hours. The hypotheses for checking whether the batteries can hold out for at least 3.5 hours are then

General example
vs. Hours vs. Hours

The test value is given again and can also be used to test the one-sided hypothesis on the level of significance . The null hypothesis is now rejected if is.

For results . And then we can reject this null hypothesis as well, i.e. In other words, we were able to show that the average battery life is less than 3.5 hours.

Alternative tests

  • In the case,
  • if the central limit theorem for the sample variables is not met, or
  • if the central limit theorem for the sample variables is met and the sample size is less than or equal to 30
As an alternative, the nonparametric single sample median test can be used. However, this tests whether the median of the population corresponds to a specified value.
  • If the standard deviation is known, the one- sample Gaussian test should be used.

Compact display

One-sample t-test
requirements
  • independent of each other
  • or and sufficiently large (see ZGS )
Hypotheses

(right side)


(two-sided)


(left side)
Test statistics
Test value with and
Rejection area

literature

Web links