JMP | Statistical Discovery.™ From SAS.

Statistics Knowledge Portal

A free online introduction to statistics

The One-Sample t -Test

What is the one-sample t -test.

The one-sample t-test is a statistical hypothesis test used to determine whether an unknown population mean is different from a specific value.

When can I use the test?

You can use the test for continuous data. Your data should be a random sample from a normal population.

What if my data isn’t nearly normally distributed?

If your sample sizes are very small, you might not be able to test for normality. You might need to rely on your understanding of the data. When you cannot safely assume normality, you can perform a nonparametric test that doesn’t assume normality.

Using the one-sample t -test

See how to perform a one-sample t -test using statistical software.

  • Download JMP to follow along using the sample data included with the software.
  • To see more JMP tutorials, visit the JMP Learning Library .

The sections below discuss what we need for the test, checking our data, performing the test, understanding test results and statistical details.

What do we need?

For the one-sample t -test, we need one variable.

We also have an idea, or hypothesis, that the mean of the population has some value. Here are two examples:

  • A hospital has a random sample of cholesterol measurements for men. These patients were seen for issues other than cholesterol. They were not taking any medications for high cholesterol. The hospital wants to know if the unknown mean cholesterol for patients is different from a goal level of 200 mg.
  • We measure the grams of protein for a sample of energy bars. The label claims that the bars have 20 grams of protein. We want to know if the labels are correct or not.

One-sample t -test assumptions

For a valid test, we need data values that are:

  • Independent (values are not related to one another).
  • Continuous.
  • Obtained via a simple random sample from the population.

Also, the population is assumed to be normally distributed .

One-sample t -test example

Imagine we have collected a random sample of 31 energy bars from a number of different stores to represent the population of energy bars available to the general consumer. The labels on the bars claim that each bar contains 20 grams of protein.

Table 1: Grams of protein in random sample of energy bars

Energy Bar - Grams of Protein
20.7027.4622.1519.8521.2924.75
20.7522.9125.3420.3321.5421.08
22.1419.5621.1018.0424.1219.95
19.7218.2816.2617.4620.5322.12
25.0622.4419.0819.8821.3922.3325.79

If you look at the table above, you see that some bars have less than 20 grams of protein. Other bars have more. You might think that the data support the idea that the labels are correct. Others might disagree. The statistical test provides a sound method to make a decision, so that everyone makes the same decision on the same set of data values. 

Checking the data

Let’s start by answering: Is the t -test an appropriate method to test that the energy bars have 20 grams of protein ? The list below checks the requirements for the test.

  • The data values are independent. The grams of protein in one energy bar do not depend on the grams in any other energy bar. An example of dependent values would be if you collected energy bars from a single production lot. A sample from a single lot is representative of that lot, not energy bars in general.
  • The data values are grams of protein. The measurements are continuous.
  • We assume the energy bars are a simple random sample from the population of energy bars available to the general consumer (i.e., a mix of lots of bars).
  • We assume the population from which we are collecting our sample is normally distributed, and for large samples, we can check this assumption.

We decide that the t -test is an appropriate method.

Before jumping into analysis, we should take a quick look at the data. The figure below shows a histogram and summary statistics for the energy bars.

Histogram and summary statistics for the grams of protein in energy bars

From a quick look at the histogram, we see that there are no unusual points, or outliers . The data look roughly bell-shaped, so our assumption of a normal distribution seems reasonable.

From a quick look at the statistics, we see that the average is 21.40, above 20. Does this  average from our sample of 31 bars invalidate the label's claim of 20 grams of protein for the unknown entire population mean? Or not?

How to perform the one-sample t -test

For the t -test calculations we need the mean, standard deviation and sample size. These are shown in the summary statistics section of Figure 1 above.

We round the statistics to two decimal places. Software will show more decimal places, and use them in calculations. (Note that Table 1 shows only two decimal places; the actual data used to calculate the summary statistics has more.)

We start by finding the difference between the sample mean and 20:

$ 21.40-20\ =\ 1.40$

Next, we calculate the standard error for the mean. The calculation is:

Standard Error for the mean = $ \frac{s}{\sqrt{n}}= \frac{2.54}{\sqrt{31}}=0.456 $

This matches the value in Figure 1 above.

We now have the pieces for our test statistic. We calculate our test statistic as:

$ t =  \frac{\text{Difference}}{\text{Standard Error}}= \frac{1.40}{0.456}=3.07 $

To make our decision, we compare the test statistic to a value from the t- distribution. This activity involves four steps.

  • We calculate a test statistic. Our test statistic is 3.07.
  • We decide on the risk we are willing to take for declaring a difference when there is not a difference. For the energy bar data, we decide that we are willing to take a 5% risk of saying that the unknown population mean is different from 20 when in fact it is not. In statistics-speak, we set α = 0.05. In practice, setting your risk level (α) should be made before collecting the data.

We find the value from the t- distribution based on our decision. For a t -test, we need the degrees of freedom to find this value. The degrees of freedom are based on the sample size. For the energy bar data:

degrees of freedom = $ n - 1 = 31 - 1 = 30 $

The critical value of t with α = 0.05 and 30 degrees of freedom is +/- 2.043. Most statistics books have look-up tables for the distribution. You can also find tables online. The most likely situation is that you will use software and will not use printed tables.

We compare the value of our statistic (3.07) to the t value. Since 3.07 > 2.043, we reject the null hypothesis that the mean grams of protein is equal to 20. We make a practical conclusion that the labels are incorrect, and the population mean grams of protein is greater than 20.

Statistical details

Let’s look at the energy bar data and the 1-sample t -test using statistical terms.

Our null hypothesis is that the underlying population mean is equal to 20. The null hypothesis is written as:

$ H_o:  \mathrm{\mu} = 20 $

The alternative hypothesis is that the underlying population mean is not equal to 20. The labels claiming 20 grams of protein would be incorrect. This is written as:

$ H_a:  \mathrm{\mu} ≠ 20 $

This is a two-sided test. We are testing if the population mean is different from 20 grams in either direction. If we can reject the null hypothesis that the mean is equal to 20 grams, then we make a practical conclusion that the labels for the bars are incorrect. If we cannot reject the null hypothesis, then we make a practical conclusion that the labels for the bars may be correct.

We calculate the average for the sample and then calculate the difference with the population mean, mu:

$  \overline{x} - \mathrm{\mu} $

We calculate the standard error as:

$ \frac{s}{ \sqrt{n}} $

The formula shows the sample standard deviation as s and the sample size as n .  

The test statistic uses the formula shown below:

$  \dfrac{\overline{x} - \mathrm{\mu}} {s / \sqrt{n}} $

We compare the test statistic to a t value with our chosen alpha value and the degrees of freedom for our data. Using the energy bar data as an example, we set α = 0.05. The degrees of freedom ( df ) are based on the sample size and are calculated as:

$ df = n - 1 = 31 - 1 = 30 $

Statisticians write the t value with α = 0.05 and 30 degrees of freedom as:

$ t_{0.05,30} $

The t value for a two-sided test with α = 0.05 and 30 degrees of freedom is +/- 2.042. There are two possible results from our comparison:

  • The test statistic is less extreme than the critical  t  values; in other words, the test statistic is not less than -2.042, or is not greater than +2.042. You fail to reject the null hypothesis that the mean is equal to the specified value. In our example, you would be unable to conclude that the label for the protein bars should be changed.
  • The test statistic is more extreme than the critical  t  values; in other words, the test statistic is less than -2.042, or is greater than +2.042. You reject the null hypothesis that the mean is equal to the specified value. In our example, you conclude that either the label should be updated or the production process should be improved to produce, on average, bars with 20 grams of protein.

Testing for normality

The normality assumption is more important for small sample sizes than for larger sample sizes.

Normal distributions are symmetric, which means they are “even” on both sides of the center. Normal distributions do not have extreme values, or outliers. You can check these two features of a normal distribution with graphs. Earlier, we decided that the energy bar data was “close enough” to normal to go ahead with the assumption of normality. The figure below shows a normal quantile plot for the data, and supports our decision.

Normal quantile plot for energy bar data

You can also perform a formal test for normality using software. The figure below shows results of testing for normality with JMP software. We cannot reject the hypothesis of a normal distribution. 

Testing for normality using JMP software

We can go ahead with the assumption that the energy bar data is normally distributed.

What if my data are not from a Normal distribution?

If your sample size is very small, it is hard to test for normality. In this situation, you might need to use your understanding of the measurements. For example, for the energy bar data, the company knows that the underlying distribution of grams of protein is normally distributed. Even for a very small sample, the company would likely go ahead with the t -test and assume normality.

What if you know the underlying measurements are not normally distributed? Or what if your sample size is large and the test for normality is rejected? In this situation, you can use a nonparametric test. Nonparametric  analyses do not depend on an assumption that the data values are from a specific distribution. For the one-sample t ­-test, the one possible nonparametric test is the Wilcoxon Signed Rank test. 

Understanding p-values

Using a visual, you can check to see if your test statistic is more extreme than a specified value in the distribution. The figure below shows a t- distribution with 30 degrees of freedom.

t-distribution with 30 degrees of freedom and α = 0.05

Since our test is two-sided and we set α = 0.05, the figure shows that the value of 2.042 “cuts off” 5% of the data in the tails combined.

The next figure shows our results. You can see the test statistic falls above the specified critical value. It is far enough “out in the tail” to reject the hypothesis that the mean is equal to 20.

Our results displayed in a t-distribution with 30 degrees of freedom

Putting it all together with Software

You are likely to use software to perform a t -test. The figure below shows results for the 1-sample t -test for the energy bar data from JMP software.  

One-sample t-test results for energy bar data using JMP software

The software shows the null hypothesis value of 20 and the average and standard deviation from the data. The test statistic is 3.07. This matches the calculations above.

The software shows results for a two-sided test and for one-sided tests. We want the two-sided test. Our null hypothesis is that the mean grams of protein is equal to 20. Our alternative hypothesis is that the mean grams of protein is not equal to 20.  The software shows a p- value of 0.0046 for the two-sided test. This p- value describes the likelihood of seeing a sample average as extreme as 21.4, or more extreme, when the underlying population mean is actually 20; in other words, the probability of observing a sample mean as different, or even more different from 20, than the mean we observed in our sample. A p -value of 0.0046 means there is about 46 chances out of 10,000. We feel confident in rejecting the null hypothesis that the population mean is equal to 20.

t-test Calculator

Table of contents

Welcome to our t-test calculator! Here you can not only easily perform one-sample t-tests , but also two-sample t-tests , as well as paired t-tests .

Do you prefer to find the p-value from t-test, or would you rather find the t-test critical values? Well, this t-test calculator can do both! 😊

What does a t-test tell you? Take a look at the text below, where we explain what actually gets tested when various types of t-tests are performed. Also, we explain when to use t-tests (in particular, whether to use the z-test vs. t-test) and what assumptions your data should satisfy for the results of a t-test to be valid. If you've ever wanted to know how to do a t-test by hand, we provide the necessary t-test formula, as well as tell you how to determine the number of degrees of freedom in a t-test.

When to use a t-test?

A t-test is one of the most popular statistical tests for location , i.e., it deals with the population(s) mean value(s).

There are different types of t-tests that you can perform:

  • A one-sample t-test;
  • A two-sample t-test; and
  • A paired t-test.

In the next section , we explain when to use which. Remember that a t-test can only be used for one or two groups . If you need to compare three (or more) means, use the analysis of variance ( ANOVA ) method.

The t-test is a parametric test, meaning that your data has to fulfill some assumptions :

  • The data points are independent; AND
  • The data, at least approximately, follow a normal distribution .

If your sample doesn't fit these assumptions, you can resort to nonparametric alternatives. Visit our Mann–Whitney U test calculator or the Wilcoxon rank-sum test calculator to learn more. Other possibilities include the Wilcoxon signed-rank test or the sign test.

Which t-test?

Your choice of t-test depends on whether you are studying one group or two groups:

One sample t-test

Choose the one-sample t-test to check if the mean of a population is equal to some pre-set hypothesized value .

The average volume of a drink sold in 0.33 l cans — is it really equal to 330 ml?

The average weight of people from a specific city — is it different from the national average?

Two-sample t-test

Choose the two-sample t-test to check if the difference between the means of two populations is equal to some pre-determined value when the two samples have been chosen independently of each other.

In particular, you can use this test to check whether the two groups are different from one another .

The average difference in weight gain in two groups of people: one group was on a high-carb diet and the other on a high-fat diet.

The average difference in the results of a math test from students at two different universities.

This test is sometimes referred to as an independent samples t-test , or an unpaired samples t-test .

Paired t-test

A paired t-test is used to investigate the change in the mean of a population before and after some experimental intervention , based on a paired sample, i.e., when each subject has been measured twice: before and after treatment.

In particular, you can use this test to check whether, on average, the treatment has had any effect on the population .

The change in student test performance before and after taking a course.

The change in blood pressure in patients before and after administering some drug.

How to do a t-test?

So, you've decided which t-test to perform. These next steps will tell you how to calculate the p-value from t-test or its critical values, and then which decision to make about the null hypothesis.

Decide on the alternative hypothesis :

Use a two-tailed t-test if you only care whether the population's mean (or, in the case of two populations, the difference between the populations' means) agrees or disagrees with the pre-set value.

Use a one-tailed t-test if you want to test whether this mean (or difference in means) is greater/less than the pre-set value.

Compute your T-score value :

Formulas for the test statistic in t-tests include the sample size , as well as its mean and standard deviation . The exact formula depends on the t-test type — check the sections dedicated to each particular test for more details.

Determine the degrees of freedom for the t-test:

The degrees of freedom are the number of observations in a sample that are free to vary as we estimate statistical parameters. In the simplest case, the number of degrees of freedom equals your sample size minus the number of parameters you need to estimate . Again, the exact formula depends on the t-test you want to perform — check the sections below for details.

The degrees of freedom are essential, as they determine the distribution followed by your T-score (under the null hypothesis). If there are d degrees of freedom, then the distribution of the test statistics is the t-Student distribution with d degrees of freedom . This distribution has a shape similar to N(0,1) (bell-shaped and symmetric) but has heavier tails . If the number of degrees of freedom is large (>30), which generically happens for large samples, the t-Student distribution is practically indistinguishable from N(0,1).

💡 The t-Student distribution owes its name to William Sealy Gosset, who, in 1908, published his paper on the t-test under the pseudonym "Student". Gosset worked at the famous Guinness Brewery in Dublin, Ireland, and devised the t-test as an economical way to monitor the quality of beer. Cheers! 🍺🍺🍺

p-value from t-test

Recall that the p-value is the probability (calculated under the assumption that the null hypothesis is true) that the test statistic will produce values at least as extreme as the T-score produced for your sample . As probabilities correspond to areas under the density function, p-value from t-test can be nicely illustrated with the help of the following pictures:

p-value from t-test

The following formulae say how to calculate p-value from t-test. By cdf t,d we denote the cumulative distribution function of the t-Student distribution with d degrees of freedom:

p-value from left-tailed t-test:

p-value = cdf t,d (t score )

p-value from right-tailed t-test:

p-value = 1 − cdf t,d (t score )

p-value from two-tailed t-test:

p-value = 2 × cdf t,d (−|t score |)

or, equivalently: p-value = 2 − 2 × cdf t,d (|t score |)

However, the cdf of the t-distribution is given by a somewhat complicated formula. To find the p-value by hand, you would need to resort to statistical tables, where approximate cdf values are collected, or to specialized statistical software. Fortunately, our t-test calculator determines the p-value from t-test for you in the blink of an eye!

t-test critical values

Recall, that in the critical values approach to hypothesis testing, you need to set a significance level, α, before computing the critical values , which in turn give rise to critical regions (a.k.a. rejection regions).

Formulas for critical values employ the quantile function of t-distribution, i.e., the inverse of the cdf :

Critical value for left-tailed t-test: cdf t,d -1 (α)

critical region:

(-∞, cdf t,d -1 (α)]

Critical value for right-tailed t-test: cdf t,d -1 (1-α)

[cdf t,d -1 (1-α), ∞)

Critical values for two-tailed t-test: ±cdf t,d -1 (1-α/2)

(-∞, -cdf t,d -1 (1-α/2)] ∪ [cdf t,d -1 (1-α/2), ∞)

To decide the fate of the null hypothesis, just check if your T-score lies within the critical region:

If your T-score belongs to the critical region , reject the null hypothesis and accept the alternative hypothesis.

If your T-score is outside the critical region , then you don't have enough evidence to reject the null hypothesis.

How to use our t-test calculator

Choose the type of t-test you wish to perform:

A one-sample t-test (to test the mean of a single group against a hypothesized mean);

A two-sample t-test (to compare the means for two groups); or

A paired t-test (to check how the mean from the same group changes after some intervention).

Two-tailed;

Left-tailed; or

Right-tailed.

This t-test calculator allows you to use either the p-value approach or the critical regions approach to hypothesis testing!

Enter your T-score and the number of degrees of freedom . If you don't know them, provide some data about your sample(s): sample size, mean, and standard deviation, and our t-test calculator will compute the T-score and degrees of freedom for you .

Once all the parameters are present, the p-value, or critical region, will immediately appear underneath the t-test calculator, along with an interpretation!

One-sample t-test

The null hypothesis is that the population mean is equal to some value μ 0 \mu_0 μ 0 ​ .

The alternative hypothesis is that the population mean is:

  • different from μ 0 \mu_0 μ 0 ​ ;
  • smaller than μ 0 \mu_0 μ 0 ​ ; or
  • greater than μ 0 \mu_0 μ 0 ​ .

One-sample t-test formula :

  • μ 0 \mu_0 μ 0 ​ — Mean postulated in the null hypothesis;
  • n n n — Sample size;
  • x ˉ \bar{x} x ˉ — Sample mean; and
  • s s s — Sample standard deviation.

Number of degrees of freedom in t-test (one-sample) = n − 1 n-1 n − 1 .

The null hypothesis is that the actual difference between these groups' means, μ 1 \mu_1 μ 1 ​ , and μ 2 \mu_2 μ 2 ​ , is equal to some pre-set value, Δ \Delta Δ .

The alternative hypothesis is that the difference μ 1 − μ 2 \mu_1 - \mu_2 μ 1 ​ − μ 2 ​ is:

  • Different from Δ \Delta Δ ;
  • Smaller than Δ \Delta Δ ; or
  • Greater than Δ \Delta Δ .

In particular, if this pre-determined difference is zero ( Δ = 0 \Delta = 0 Δ = 0 ):

The null hypothesis is that the population means are equal.

The alternate hypothesis is that the population means are:

  • μ 1 \mu_1 μ 1 ​ and μ 2 \mu_2 μ 2 ​ are different from one another;
  • μ 1 \mu_1 μ 1 ​ is smaller than μ 2 \mu_2 μ 2 ​ ; and
  • μ 1 \mu_1 μ 1 ​ is greater than μ 2 \mu_2 μ 2 ​ .

Formally, to perform a t-test, we should additionally assume that the variances of the two populations are equal (this assumption is called the homogeneity of variance ).

There is a version of a t-test that can be applied without the assumption of homogeneity of variance: it is called a Welch's t-test . For your convenience, we describe both versions.

Two-sample t-test if variances are equal

Use this test if you know that the two populations' variances are the same (or very similar).

Two-sample t-test formula (with equal variances) :

where s p s_p s p ​ is the so-called pooled standard deviation , which we compute as:

  • Δ \Delta Δ — Mean difference postulated in the null hypothesis;
  • n 1 n_1 n 1 ​ — First sample size;
  • x ˉ 1 \bar{x}_1 x ˉ 1 ​ — Mean for the first sample;
  • s 1 s_1 s 1 ​ — Standard deviation in the first sample;
  • n 2 n_2 n 2 ​ — Second sample size;
  • x ˉ 2 \bar{x}_2 x ˉ 2 ​ — Mean for the second sample; and
  • s 2 s_2 s 2 ​ — Standard deviation in the second sample.

Number of degrees of freedom in t-test (two samples, equal variances) = n 1 + n 2 − 2 n_1 + n_2 - 2 n 1 ​ + n 2 ​ − 2 .

Two-sample t-test if variances are unequal (Welch's t-test)

Use this test if the variances of your populations are different.

Two-sample Welch's t-test formula if variances are unequal:

  • s 1 s_1 s 1 ​ — Standard deviation in the first sample;
  • s 2 s_2 s 2 ​ — Standard deviation in the second sample.

The number of degrees of freedom in a Welch's t-test (two-sample t-test with unequal variances) is very difficult to count. We can approximate it with the help of the following Satterthwaite formula :

Alternatively, you can take the smaller of n 1 − 1 n_1 - 1 n 1 ​ − 1 and n 2 − 1 n_2 - 1 n 2 ​ − 1 as a conservative estimate for the number of degrees of freedom.

🔎 The Satterthwaite formula for the degrees of freedom can be rewritten as a scaled weighted harmonic mean of the degrees of freedom of the respective samples: n 1 − 1 n_1 - 1 n 1 ​ − 1 and n 2 − 1 n_2 - 1 n 2 ​ − 1 , and the weights are proportional to the standard deviations of the corresponding samples.

As we commonly perform a paired t-test when we have data about the same subjects measured twice (before and after some treatment), let us adopt the convention of referring to the samples as the pre-group and post-group.

The null hypothesis is that the true difference between the means of pre- and post-populations is equal to some pre-set value, Δ \Delta Δ .

The alternative hypothesis is that the actual difference between these means is:

Typically, this pre-determined difference is zero. We can then reformulate the hypotheses as follows:

The null hypothesis is that the pre- and post-means are the same, i.e., the treatment has no impact on the population .

The alternative hypothesis:

  • The pre- and post-means are different from one another (treatment has some effect);
  • The pre-mean is smaller than the post-mean (treatment increases the result); or
  • The pre-mean is greater than the post-mean (treatment decreases the result).

Paired t-test formula

In fact, a paired t-test is technically the same as a one-sample t-test! Let us see why it is so. Let x 1 , . . . , x n x_1, ... , x_n x 1 ​ , ... , x n ​ be the pre observations and y 1 , . . . , y n y_1, ... , y_n y 1 ​ , ... , y n ​ the respective post observations. That is, x i , y i x_i, y_i x i ​ , y i ​ are the before and after measurements of the i -th subject.

For each subject, compute the difference, d i : = x i − y i d_i := x_i - y_i d i ​ := x i ​ − y i ​ . All that happens next is just a one-sample t-test performed on the sample of differences d 1 , . . . , d n d_1, ... , d_n d 1 ​ , ... , d n ​ . Take a look at the formula for the T-score :

Δ \Delta Δ — Mean difference postulated in the null hypothesis;

n n n — Size of the sample of differences, i.e., the number of pairs;

x ˉ \bar{x} x ˉ — Mean of the sample of differences; and

s s s  — Standard deviation of the sample of differences.

Number of degrees of freedom in t-test (paired): n − 1 n - 1 n − 1

t-test vs Z-test

We use a Z-test when we want to test the population mean of a normally distributed dataset, which has a known population variance . If the number of degrees of freedom is large, then the t-Student distribution is very close to N(0,1).

Hence, if there are many data points (at least 30), you may swap a t-test for a Z-test, and the results will be almost identical. However, for small samples with unknown variance, remember to use the t-test because, in such cases, the t-Student distribution differs significantly from the N(0,1)!

🙋 Have you concluded you need to perform the z-test? Head straight to our z-test calculator !

What is a t-test?

A t-test is a widely used statistical test that analyzes the means of one or two groups of data. For instance, a t-test is performed on medical data to determine whether a new drug really helps.

What are different types of t-tests?

Different types of t-tests are:

  • One-sample t-test;
  • Two-sample t-test; and
  • Paired t-test.

How to find the t value in a one sample t-test?

To find the t-value:

  • Subtract the null hypothesis mean from the sample mean value.
  • Divide the difference by the standard deviation of the sample.
  • Multiply the resultant with the square root of the sample size.

.css-1qjnekj.css-1qjnekj{color:#2B3148;background-color:transparent;font-family:"Roboto","Helvetica","Arial",sans-serif;font-size:20px;line-height:24px;overflow:visible;padding-top:0px;position:relative;}.css-1qjnekj.css-1qjnekj:after{content:'';-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);transform:scale(0);position:absolute;border:2px solid #EA9430;border-radius:2px;inset:-8px;z-index:1;}.css-1qjnekj .js-external-link-button.link-like,.css-1qjnekj .js-external-link-anchor{color:inherit;border-radius:1px;-webkit-text-decoration:underline;text-decoration:underline;}.css-1qjnekj .js-external-link-button.link-like:hover,.css-1qjnekj .js-external-link-anchor:hover,.css-1qjnekj .js-external-link-button.link-like:active,.css-1qjnekj .js-external-link-anchor:active{text-decoration-thickness:2px;text-shadow:1px 0 0;}.css-1qjnekj .js-external-link-button.link-like:focus-visible,.css-1qjnekj .js-external-link-anchor:focus-visible{outline:transparent 2px dotted;box-shadow:0 0 0 2px #6314E6;}.css-1qjnekj p,.css-1qjnekj div{margin:0;display:block;}.css-1qjnekj pre{margin:0;display:block;}.css-1qjnekj pre code{display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}.css-1qjnekj pre:not(:first-child){padding-top:8px;}.css-1qjnekj ul,.css-1qjnekj ol{display:block margin:0;padding-left:20px;}.css-1qjnekj ul li,.css-1qjnekj ol li{padding-top:8px;}.css-1qjnekj ul ul,.css-1qjnekj ol ul,.css-1qjnekj ul ol,.css-1qjnekj ol ol{padding-top:0;}.css-1qjnekj ul:not(:first-child),.css-1qjnekj ol:not(:first-child){padding-top:4px;} .css-1dtpypy{margin:auto;background-color:white;overflow:auto;overflow-wrap:break-word;word-break:break-word;}.css-1dtpypy code,.css-1dtpypy kbd,.css-1dtpypy pre,.css-1dtpypy samp{font-family:monospace;}.css-1dtpypy code{padding:2px 4px;color:#444;background:#ddd;border-radius:4px;}.css-1dtpypy figcaption,.css-1dtpypy caption{text-align:center;}.css-1dtpypy figcaption{font-size:12px;font-style:italic;overflow:hidden;}.css-1dtpypy h3{font-size:1.75rem;}.css-1dtpypy h4{font-size:1.5rem;}.css-1dtpypy .mathBlock{font-size:24px;-webkit-padding-start:4px;padding-inline-start:4px;}.css-1dtpypy .mathBlock .katex{font-size:24px;text-align:left;}.css-1dtpypy .math-inline{background-color:#f0f0f0;display:inline-block;font-size:inherit;padding:0 3px;}.css-1dtpypy .videoBlock,.css-1dtpypy .imageBlock{margin-bottom:16px;}.css-1dtpypy .imageBlock__image-align--left,.css-1dtpypy .videoBlock__video-align--left{float:left;}.css-1dtpypy .imageBlock__image-align--right,.css-1dtpypy .videoBlock__video-align--right{float:right;}.css-1dtpypy .imageBlock__image-align--center,.css-1dtpypy .videoBlock__video-align--center{display:block;margin-left:auto;margin-right:auto;clear:both;}.css-1dtpypy .imageBlock__image-align--none,.css-1dtpypy .videoBlock__video-align--none{clear:both;margin-left:0;margin-right:0;}.css-1dtpypy .videoBlock__video--wrapper{position:relative;padding-bottom:56.25%;height:0;}.css-1dtpypy .videoBlock__video--wrapper iframe{position:absolute;top:0;left:0;width:100%;height:100%;}.css-1dtpypy .videoBlock__caption{text-align:left;}@font-face{font-family:'KaTeX_AMS';src:url(/katex-fonts/KaTeX_AMS-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_AMS-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_AMS-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Caligraphic';src:url(/katex-fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'),url(/katex-fonts/KaTeX_Caligraphic-Bold.woff) format('woff'),url(/katex-fonts/KaTeX_Caligraphic-Bold.ttf) format('truetype');font-weight:bold;font-style:normal;}@font-face{font-family:'KaTeX_Caligraphic';src:url(/katex-fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Caligraphic-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Caligraphic-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Fraktur';src:url(/katex-fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'),url(/katex-fonts/KaTeX_Fraktur-Bold.woff) format('woff'),url(/katex-fonts/KaTeX_Fraktur-Bold.ttf) format('truetype');font-weight:bold;font-style:normal;}@font-face{font-family:'KaTeX_Fraktur';src:url(/katex-fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Fraktur-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Fraktur-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Main';src:url(/katex-fonts/KaTeX_Main-Bold.woff2) format('woff2'),url(/katex-fonts/KaTeX_Main-Bold.woff) format('woff'),url(/katex-fonts/KaTeX_Main-Bold.ttf) format('truetype');font-weight:bold;font-style:normal;}@font-face{font-family:'KaTeX_Main';src:url(/katex-fonts/KaTeX_Main-BoldItalic.woff2) format('woff2'),url(/katex-fonts/KaTeX_Main-BoldItalic.woff) format('woff'),url(/katex-fonts/KaTeX_Main-BoldItalic.ttf) format('truetype');font-weight:bold;font-style:italic;}@font-face{font-family:'KaTeX_Main';src:url(/katex-fonts/KaTeX_Main-Italic.woff2) format('woff2'),url(/katex-fonts/KaTeX_Main-Italic.woff) format('woff'),url(/katex-fonts/KaTeX_Main-Italic.ttf) format('truetype');font-weight:normal;font-style:italic;}@font-face{font-family:'KaTeX_Main';src:url(/katex-fonts/KaTeX_Main-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Main-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Main-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Math';src:url(/katex-fonts/KaTeX_Math-BoldItalic.woff2) format('woff2'),url(/katex-fonts/KaTeX_Math-BoldItalic.woff) format('woff'),url(/katex-fonts/KaTeX_Math-BoldItalic.ttf) format('truetype');font-weight:bold;font-style:italic;}@font-face{font-family:'KaTeX_Math';src:url(/katex-fonts/KaTeX_Math-Italic.woff2) format('woff2'),url(/katex-fonts/KaTeX_Math-Italic.woff) format('woff'),url(/katex-fonts/KaTeX_Math-Italic.ttf) format('truetype');font-weight:normal;font-style:italic;}@font-face{font-family:'KaTeX_SansSerif';src:url(/katex-fonts/KaTeX_SansSerif-Bold.woff2) format('woff2'),url(/katex-fonts/KaTeX_SansSerif-Bold.woff) format('woff'),url(/katex-fonts/KaTeX_SansSerif-Bold.ttf) format('truetype');font-weight:bold;font-style:normal;}@font-face{font-family:'KaTeX_SansSerif';src:url(/katex-fonts/KaTeX_SansSerif-Italic.woff2) format('woff2'),url(/katex-fonts/KaTeX_SansSerif-Italic.woff) format('woff'),url(/katex-fonts/KaTeX_SansSerif-Italic.ttf) format('truetype');font-weight:normal;font-style:italic;}@font-face{font-family:'KaTeX_SansSerif';src:url(/katex-fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_SansSerif-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_SansSerif-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Script';src:url(/katex-fonts/KaTeX_Script-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Script-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Script-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Size1';src:url(/katex-fonts/KaTeX_Size1-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Size1-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Size1-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Size2';src:url(/katex-fonts/KaTeX_Size2-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Size2-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Size2-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Size3';src:url(/katex-fonts/KaTeX_Size3-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Size3-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Size3-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Size4';src:url(/katex-fonts/KaTeX_Size4-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Size4-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Size4-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}@font-face{font-family:'KaTeX_Typewriter';src:url(/katex-fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'),url(/katex-fonts/KaTeX_Typewriter-Regular.woff) format('woff'),url(/katex-fonts/KaTeX_Typewriter-Regular.ttf) format('truetype');font-weight:normal;font-style:normal;}.css-1dtpypy .katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto;}.css-1dtpypy .katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor;}.css-1dtpypy .katex .katex-version::after{content:'0.13.13';}.css-1dtpypy .katex .katex-mathml{position:absolute;clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden;}.css-1dtpypy .katex .katex-html>.newline{display:block;}.css-1dtpypy .katex .base{position:relative;display:inline-block;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:-webkit-min-content;width:-moz-min-content;width:min-content;}.css-1dtpypy .katex .strut{display:inline-block;}.css-1dtpypy .katex .textbf{font-weight:bold;}.css-1dtpypy .katex .textit{font-style:italic;}.css-1dtpypy .katex .textrm{font-family:KaTeX_Main;}.css-1dtpypy .katex .textsf{font-family:KaTeX_SansSerif;}.css-1dtpypy .katex .texttt{font-family:KaTeX_Typewriter;}.css-1dtpypy .katex .mathnormal{font-family:KaTeX_Math;font-style:italic;}.css-1dtpypy .katex .mathit{font-family:KaTeX_Main;font-style:italic;}.css-1dtpypy .katex .mathrm{font-style:normal;}.css-1dtpypy .katex .mathbf{font-family:KaTeX_Main;font-weight:bold;}.css-1dtpypy .katex .boldsymbol{font-family:KaTeX_Math;font-weight:bold;font-style:italic;}.css-1dtpypy .katex .amsrm{font-family:KaTeX_AMS;}.css-1dtpypy .katex .mathbb,.css-1dtpypy .katex .textbb{font-family:KaTeX_AMS;}.css-1dtpypy .katex .mathcal{font-family:KaTeX_Caligraphic;}.css-1dtpypy .katex .mathfrak,.css-1dtpypy .katex .textfrak{font-family:KaTeX_Fraktur;}.css-1dtpypy .katex .mathtt{font-family:KaTeX_Typewriter;}.css-1dtpypy .katex .mathscr,.css-1dtpypy .katex .textscr{font-family:KaTeX_Script;}.css-1dtpypy .katex .mathsf,.css-1dtpypy .katex .textsf{font-family:KaTeX_SansSerif;}.css-1dtpypy .katex .mathboldsf,.css-1dtpypy .katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:bold;}.css-1dtpypy .katex .mathitsf,.css-1dtpypy .katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic;}.css-1dtpypy .katex .mainrm{font-family:KaTeX_Main;font-style:normal;}.css-1dtpypy .katex .vlist-t{display:inline-table;table-layout:fixed;border-collapse:collapse;}.css-1dtpypy .katex .vlist-r{display:table-row;}.css-1dtpypy .katex .vlist{display:table-cell;vertical-align:bottom;position:relative;}.css-1dtpypy .katex .vlist>span{display:block;height:0;position:relative;}.css-1dtpypy .katex .vlist>span>span{display:inline-block;}.css-1dtpypy .katex .vlist>span>.pstrut{overflow:hidden;width:0;}.css-1dtpypy .katex .vlist-t2{margin-right:-2px;}.css-1dtpypy .katex .vlist-s{display:table-cell;vertical-align:bottom;font-size:1px;width:2px;min-width:2px;}.css-1dtpypy .katex .vbox{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-items:baseline;-webkit-box-align:baseline;-ms-flex-align:baseline;align-items:baseline;}.css-1dtpypy .katex .hbox{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:100%;}.css-1dtpypy .katex .thinbox{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;width:0;max-width:0;}.css-1dtpypy .katex .msupsub{text-align:left;}.css-1dtpypy .katex .mfrac>span>span{text-align:center;}.css-1dtpypy .katex .mfrac .frac-line{display:inline-block;width:100%;border-bottom-style:solid;}.css-1dtpypy .katex .mfrac .frac-line,.css-1dtpypy .katex .overline .overline-line,.css-1dtpypy .katex .underline .underline-line,.css-1dtpypy .katex .hline,.css-1dtpypy .katex .hdashline,.css-1dtpypy .katex .rule{min-height:1px;}.css-1dtpypy .katex .mspace{display:inline-block;}.css-1dtpypy .katex .llap,.css-1dtpypy .katex .rlap,.css-1dtpypy .katex .clap{width:0;position:relative;}.css-1dtpypy .katex .llap>.inner,.css-1dtpypy .katex .rlap>.inner,.css-1dtpypy .katex .clap>.inner{position:absolute;}.css-1dtpypy .katex .llap>.fix,.css-1dtpypy .katex .rlap>.fix,.css-1dtpypy .katex .clap>.fix{display:inline-block;}.css-1dtpypy .katex .llap>.inner{right:0;}.css-1dtpypy .katex .rlap>.inner,.css-1dtpypy .katex .clap>.inner{left:0;}.css-1dtpypy .katex .clap>.inner>span{margin-left:-50%;margin-right:50%;}.css-1dtpypy .katex .rule{display:inline-block;border:solid 0;position:relative;}.css-1dtpypy .katex .overline .overline-line,.css-1dtpypy .katex .underline .underline-line,.css-1dtpypy .katex .hline{display:inline-block;width:100%;border-bottom-style:solid;}.css-1dtpypy .katex .hdashline{display:inline-block;width:100%;border-bottom-style:dashed;}.css-1dtpypy .katex .sqrt>.root{margin-left:0.27777778em;margin-right:-0.55555556em;}.css-1dtpypy .katex .sizing.reset-size1.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size1{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size1.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size2{font-size:1.2em;}.css-1dtpypy .katex .sizing.reset-size1.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size3{font-size:1.4em;}.css-1dtpypy .katex .sizing.reset-size1.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size4{font-size:1.6em;}.css-1dtpypy .katex .sizing.reset-size1.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size5{font-size:1.8em;}.css-1dtpypy .katex .sizing.reset-size1.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size6{font-size:2em;}.css-1dtpypy .katex .sizing.reset-size1.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size7{font-size:2.4em;}.css-1dtpypy .katex .sizing.reset-size1.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size8{font-size:2.88em;}.css-1dtpypy .katex .sizing.reset-size1.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size9{font-size:3.456em;}.css-1dtpypy .katex .sizing.reset-size1.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size10{font-size:4.148em;}.css-1dtpypy .katex .sizing.reset-size1.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size1.size11{font-size:4.976em;}.css-1dtpypy .katex .sizing.reset-size2.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size1{font-size:0.83333333em;}.css-1dtpypy .katex .sizing.reset-size2.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size2{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size2.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size3{font-size:1.16666667em;}.css-1dtpypy .katex .sizing.reset-size2.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size4{font-size:1.33333333em;}.css-1dtpypy .katex .sizing.reset-size2.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size5{font-size:1.5em;}.css-1dtpypy .katex .sizing.reset-size2.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size6{font-size:1.66666667em;}.css-1dtpypy .katex .sizing.reset-size2.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size7{font-size:2em;}.css-1dtpypy .katex .sizing.reset-size2.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size8{font-size:2.4em;}.css-1dtpypy .katex .sizing.reset-size2.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size9{font-size:2.88em;}.css-1dtpypy .katex .sizing.reset-size2.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size10{font-size:3.45666667em;}.css-1dtpypy .katex .sizing.reset-size2.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size2.size11{font-size:4.14666667em;}.css-1dtpypy .katex .sizing.reset-size3.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size1{font-size:0.71428571em;}.css-1dtpypy .katex .sizing.reset-size3.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size2{font-size:0.85714286em;}.css-1dtpypy .katex .sizing.reset-size3.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size3{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size3.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size4{font-size:1.14285714em;}.css-1dtpypy .katex .sizing.reset-size3.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size5{font-size:1.28571429em;}.css-1dtpypy .katex .sizing.reset-size3.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size6{font-size:1.42857143em;}.css-1dtpypy .katex .sizing.reset-size3.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size7{font-size:1.71428571em;}.css-1dtpypy .katex .sizing.reset-size3.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size8{font-size:2.05714286em;}.css-1dtpypy .katex .sizing.reset-size3.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size9{font-size:2.46857143em;}.css-1dtpypy .katex .sizing.reset-size3.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size10{font-size:2.96285714em;}.css-1dtpypy .katex .sizing.reset-size3.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size3.size11{font-size:3.55428571em;}.css-1dtpypy .katex .sizing.reset-size4.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size1{font-size:0.625em;}.css-1dtpypy .katex .sizing.reset-size4.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size2{font-size:0.75em;}.css-1dtpypy .katex .sizing.reset-size4.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size3{font-size:0.875em;}.css-1dtpypy .katex .sizing.reset-size4.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size4{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size4.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size5{font-size:1.125em;}.css-1dtpypy .katex .sizing.reset-size4.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size6{font-size:1.25em;}.css-1dtpypy .katex .sizing.reset-size4.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size7{font-size:1.5em;}.css-1dtpypy .katex .sizing.reset-size4.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size8{font-size:1.8em;}.css-1dtpypy .katex .sizing.reset-size4.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size9{font-size:2.16em;}.css-1dtpypy .katex .sizing.reset-size4.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size10{font-size:2.5925em;}.css-1dtpypy .katex .sizing.reset-size4.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size4.size11{font-size:3.11em;}.css-1dtpypy .katex .sizing.reset-size5.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size1{font-size:0.55555556em;}.css-1dtpypy .katex .sizing.reset-size5.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size2{font-size:0.66666667em;}.css-1dtpypy .katex .sizing.reset-size5.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size3{font-size:0.77777778em;}.css-1dtpypy .katex .sizing.reset-size5.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size4{font-size:0.88888889em;}.css-1dtpypy .katex .sizing.reset-size5.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size5{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size5.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size6{font-size:1.11111111em;}.css-1dtpypy .katex .sizing.reset-size5.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size7{font-size:1.33333333em;}.css-1dtpypy .katex .sizing.reset-size5.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size8{font-size:1.6em;}.css-1dtpypy .katex .sizing.reset-size5.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size9{font-size:1.92em;}.css-1dtpypy .katex .sizing.reset-size5.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size10{font-size:2.30444444em;}.css-1dtpypy .katex .sizing.reset-size5.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size5.size11{font-size:2.76444444em;}.css-1dtpypy .katex .sizing.reset-size6.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size1{font-size:0.5em;}.css-1dtpypy .katex .sizing.reset-size6.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size2{font-size:0.6em;}.css-1dtpypy .katex .sizing.reset-size6.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size3{font-size:0.7em;}.css-1dtpypy .katex .sizing.reset-size6.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size4{font-size:0.8em;}.css-1dtpypy .katex .sizing.reset-size6.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size5{font-size:0.9em;}.css-1dtpypy .katex .sizing.reset-size6.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size6{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size6.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size7{font-size:1.2em;}.css-1dtpypy .katex .sizing.reset-size6.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size8{font-size:1.44em;}.css-1dtpypy .katex .sizing.reset-size6.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size9{font-size:1.728em;}.css-1dtpypy .katex .sizing.reset-size6.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size10{font-size:2.074em;}.css-1dtpypy .katex .sizing.reset-size6.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size6.size11{font-size:2.488em;}.css-1dtpypy .katex .sizing.reset-size7.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size1{font-size:0.41666667em;}.css-1dtpypy .katex .sizing.reset-size7.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size2{font-size:0.5em;}.css-1dtpypy .katex .sizing.reset-size7.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size3{font-size:0.58333333em;}.css-1dtpypy .katex .sizing.reset-size7.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size4{font-size:0.66666667em;}.css-1dtpypy .katex .sizing.reset-size7.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size5{font-size:0.75em;}.css-1dtpypy .katex .sizing.reset-size7.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size6{font-size:0.83333333em;}.css-1dtpypy .katex .sizing.reset-size7.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size7{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size7.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size8{font-size:1.2em;}.css-1dtpypy .katex .sizing.reset-size7.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size9{font-size:1.44em;}.css-1dtpypy .katex .sizing.reset-size7.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size10{font-size:1.72833333em;}.css-1dtpypy .katex .sizing.reset-size7.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size7.size11{font-size:2.07333333em;}.css-1dtpypy .katex .sizing.reset-size8.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size1{font-size:0.34722222em;}.css-1dtpypy .katex .sizing.reset-size8.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size2{font-size:0.41666667em;}.css-1dtpypy .katex .sizing.reset-size8.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size3{font-size:0.48611111em;}.css-1dtpypy .katex .sizing.reset-size8.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size4{font-size:0.55555556em;}.css-1dtpypy .katex .sizing.reset-size8.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size5{font-size:0.625em;}.css-1dtpypy .katex .sizing.reset-size8.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size6{font-size:0.69444444em;}.css-1dtpypy .katex .sizing.reset-size8.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size7{font-size:0.83333333em;}.css-1dtpypy .katex .sizing.reset-size8.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size8{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size8.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size9{font-size:1.2em;}.css-1dtpypy .katex .sizing.reset-size8.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size10{font-size:1.44027778em;}.css-1dtpypy .katex .sizing.reset-size8.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size8.size11{font-size:1.72777778em;}.css-1dtpypy .katex .sizing.reset-size9.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size1{font-size:0.28935185em;}.css-1dtpypy .katex .sizing.reset-size9.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size2{font-size:0.34722222em;}.css-1dtpypy .katex .sizing.reset-size9.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size3{font-size:0.40509259em;}.css-1dtpypy .katex .sizing.reset-size9.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size4{font-size:0.46296296em;}.css-1dtpypy .katex .sizing.reset-size9.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size5{font-size:0.52083333em;}.css-1dtpypy .katex .sizing.reset-size9.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size6{font-size:0.5787037em;}.css-1dtpypy .katex .sizing.reset-size9.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size7{font-size:0.69444444em;}.css-1dtpypy .katex .sizing.reset-size9.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size8{font-size:0.83333333em;}.css-1dtpypy .katex .sizing.reset-size9.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size9{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size9.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size10{font-size:1.20023148em;}.css-1dtpypy .katex .sizing.reset-size9.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size9.size11{font-size:1.43981481em;}.css-1dtpypy .katex .sizing.reset-size10.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size1{font-size:0.24108004em;}.css-1dtpypy .katex .sizing.reset-size10.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size2{font-size:0.28929605em;}.css-1dtpypy .katex .sizing.reset-size10.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size3{font-size:0.33751205em;}.css-1dtpypy .katex .sizing.reset-size10.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size4{font-size:0.38572806em;}.css-1dtpypy .katex .sizing.reset-size10.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size5{font-size:0.43394407em;}.css-1dtpypy .katex .sizing.reset-size10.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size6{font-size:0.48216008em;}.css-1dtpypy .katex .sizing.reset-size10.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size7{font-size:0.57859209em;}.css-1dtpypy .katex .sizing.reset-size10.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size8{font-size:0.69431051em;}.css-1dtpypy .katex .sizing.reset-size10.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size9{font-size:0.83317261em;}.css-1dtpypy .katex .sizing.reset-size10.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size10{font-size:1em;}.css-1dtpypy .katex .sizing.reset-size10.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size10.size11{font-size:1.19961427em;}.css-1dtpypy .katex .sizing.reset-size11.size1,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size1{font-size:0.20096463em;}.css-1dtpypy .katex .sizing.reset-size11.size2,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size2{font-size:0.24115756em;}.css-1dtpypy .katex .sizing.reset-size11.size3,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size3{font-size:0.28135048em;}.css-1dtpypy .katex .sizing.reset-size11.size4,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size4{font-size:0.32154341em;}.css-1dtpypy .katex .sizing.reset-size11.size5,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size5{font-size:0.36173633em;}.css-1dtpypy .katex .sizing.reset-size11.size6,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size6{font-size:0.40192926em;}.css-1dtpypy .katex .sizing.reset-size11.size7,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size7{font-size:0.48231511em;}.css-1dtpypy .katex .sizing.reset-size11.size8,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size8{font-size:0.57877814em;}.css-1dtpypy .katex .sizing.reset-size11.size9,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size9{font-size:0.69453376em;}.css-1dtpypy .katex .sizing.reset-size11.size10,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size10{font-size:0.83360129em;}.css-1dtpypy .katex .sizing.reset-size11.size11,.css-1dtpypy .katex .fontsize-ensurer.reset-size11.size11{font-size:1em;}.css-1dtpypy .katex .delimsizing.size1{font-family:KaTeX_Size1;}.css-1dtpypy .katex .delimsizing.size2{font-family:KaTeX_Size2;}.css-1dtpypy .katex .delimsizing.size3{font-family:KaTeX_Size3;}.css-1dtpypy .katex .delimsizing.size4{font-family:KaTeX_Size4;}.css-1dtpypy .katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1;}.css-1dtpypy .katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4;}.css-1dtpypy .katex .nulldelimiter{display:inline-block;width:0.12em;}.css-1dtpypy .katex .delimcenter{position:relative;}.css-1dtpypy .katex .op-symbol{position:relative;}.css-1dtpypy .katex .op-symbol.small-op{font-family:KaTeX_Size1;}.css-1dtpypy .katex .op-symbol.large-op{font-family:KaTeX_Size2;}.css-1dtpypy .katex .op-limits>.vlist-t{text-align:center;}.css-1dtpypy .katex .accent>.vlist-t{text-align:center;}.css-1dtpypy .katex .accent .accent-body{position:relative;}.css-1dtpypy .katex .accent .accent-body:not(.accent-full){width:0;}.css-1dtpypy .katex .overlay{display:block;}.css-1dtpypy .katex .mtable .vertical-separator{display:inline-block;min-width:1px;}.css-1dtpypy .katex .mtable .arraycolsep{display:inline-block;}.css-1dtpypy .katex .mtable .col-align-c>.vlist-t{text-align:center;}.css-1dtpypy .katex .mtable .col-align-l>.vlist-t{text-align:left;}.css-1dtpypy .katex .mtable .col-align-r>.vlist-t{text-align:right;}.css-1dtpypy .katex .svg-align{text-align:left;}.css-1dtpypy .katex svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;}.css-1dtpypy .katex svg path{stroke:none;}.css-1dtpypy .katex img{border-style:none;min-width:0;min-height:0;max-width:none;max-height:none;}.css-1dtpypy .katex .stretchy{width:100%;display:block;position:relative;overflow:hidden;}.css-1dtpypy .katex .stretchy::before,.css-1dtpypy .katex .stretchy::after{content:'';}.css-1dtpypy .katex .hide-tail{width:100%;position:relative;overflow:hidden;}.css-1dtpypy .katex .halfarrow-left{position:absolute;left:0;width:50.2%;overflow:hidden;}.css-1dtpypy .katex .halfarrow-right{position:absolute;right:0;width:50.2%;overflow:hidden;}.css-1dtpypy .katex .brace-left{position:absolute;left:0;width:25.1%;overflow:hidden;}.css-1dtpypy .katex .brace-center{position:absolute;left:25%;width:50%;overflow:hidden;}.css-1dtpypy .katex .brace-right{position:absolute;right:0;width:25.1%;overflow:hidden;}.css-1dtpypy .katex .x-arrow-pad{padding:0 0.5em;}.css-1dtpypy .katex .cd-arrow-pad{padding:0 0.55556em 0 0.27778em;}.css-1dtpypy .katex .x-arrow,.css-1dtpypy .katex .mover,.css-1dtpypy .katex .munder{text-align:center;}.css-1dtpypy .katex .boxpad{padding:0 0.3em 0 0.3em;}.css-1dtpypy .katex .fbox,.css-1dtpypy .katex .fcolorbox{box-sizing:border-box;border:0.04em solid;}.css-1dtpypy .katex .cancel-pad{padding:0 0.2em 0 0.2em;}.css-1dtpypy .katex .cancel-lap{margin-left:-0.2em;margin-right:-0.2em;}.css-1dtpypy .katex .sout{border-bottom-style:solid;border-bottom-width:0.08em;}.css-1dtpypy .katex .angl{box-sizing:border-box;border-top:0.049em solid;border-right:0.049em solid;margin-right:0.03889em;}.css-1dtpypy .katex .anglpad{padding:0 0.03889em 0 0.03889em;}.css-1dtpypy .katex .eqn-num::before{counter-increment:katexEqnNo;content:'(' counter(katexEqnNo) ')';}.css-1dtpypy .katex .mml-eqn-num::before{counter-increment:mmlEqnNo;content:'(' counter(mmlEqnNo) ')';}.css-1dtpypy .katex .mtr-glue{width:50%;}.css-1dtpypy .katex .cd-vert-arrow{display:inline-block;position:relative;}.css-1dtpypy .katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + 0.3em);text-align:left;}.css-1dtpypy .katex .cd-label-right{display:inline-block;position:absolute;left:calc(50% + 0.3em);text-align:right;}.css-1dtpypy .katex-display{display:block;margin:1em 0;text-align:center;}.css-1dtpypy .katex-display>.katex{display:block;white-space:nowrap;}.css-1dtpypy .katex-display>.katex>.katex-html{display:block;position:relative;}.css-1dtpypy .katex-display>.katex>.katex-html>.tag{position:absolute;right:0;}.css-1dtpypy .katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto;}.css-1dtpypy .katex-display.fleqn>.katex{text-align:left;padding-left:2em;}.css-1dtpypy body{counter-reset:katexEqnNo mmlEqnNo;}.css-1dtpypy table{width:-webkit-max-content;width:-moz-max-content;width:max-content;}.css-1dtpypy .tableBlock{max-width:100%;margin-bottom:1rem;overflow-y:scroll;}.css-1dtpypy .tableBlock thead,.css-1dtpypy .tableBlock thead th{border-bottom:1px solid #333!important;}.css-1dtpypy .tableBlock th,.css-1dtpypy .tableBlock td{padding:10px;text-align:left;}.css-1dtpypy .tableBlock th{font-weight:bold!important;}.css-1dtpypy .tableBlock caption{caption-side:bottom;color:#555;font-size:12px;font-style:italic;text-align:center;}.css-1dtpypy .tableBlock caption>p{margin:0;}.css-1dtpypy .tableBlock th>p,.css-1dtpypy .tableBlock td>p{margin:0;}.css-1dtpypy .tableBlock [data-background-color='aliceblue']{background-color:#f0f8ff;color:#000;}.css-1dtpypy .tableBlock [data-background-color='black']{background-color:#000;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='chocolate']{background-color:#d2691e;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='cornflowerblue']{background-color:#6495ed;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='crimson']{background-color:#dc143c;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='darkblue']{background-color:#00008b;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='darkseagreen']{background-color:#8fbc8f;color:#000;}.css-1dtpypy .tableBlock [data-background-color='deepskyblue']{background-color:#00bfff;color:#000;}.css-1dtpypy .tableBlock [data-background-color='gainsboro']{background-color:#dcdcdc;color:#000;}.css-1dtpypy .tableBlock [data-background-color='grey']{background-color:#808080;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='lemonchiffon']{background-color:#fffacd;color:#000;}.css-1dtpypy .tableBlock [data-background-color='lightpink']{background-color:#ffb6c1;color:#000;}.css-1dtpypy .tableBlock [data-background-color='lightsalmon']{background-color:#ffa07a;color:#000;}.css-1dtpypy .tableBlock [data-background-color='lightskyblue']{background-color:#87cefa;color:#000;}.css-1dtpypy .tableBlock [data-background-color='mediumblue']{background-color:#0000cd;color:#fff;}.css-1dtpypy .tableBlock [data-background-color='omnigrey']{background-color:#f0f0f0;color:#000;}.css-1dtpypy .tableBlock [data-background-color='white']{background-color:#fff;color:#000;}.css-1dtpypy .tableBlock [data-text-align='center']{text-align:center;}.css-1dtpypy .tableBlock [data-text-align='left']{text-align:left;}.css-1dtpypy .tableBlock [data-text-align='right']{text-align:right;}.css-1dtpypy .tableBlock [data-vertical-align='bottom']{vertical-align:bottom;}.css-1dtpypy .tableBlock [data-vertical-align='middle']{vertical-align:middle;}.css-1dtpypy .tableBlock [data-vertical-align='top']{vertical-align:top;}.css-1dtpypy .tableBlock__font-size--xxsmall{font-size:10px;}.css-1dtpypy .tableBlock__font-size--xsmall{font-size:12px;}.css-1dtpypy .tableBlock__font-size--small{font-size:14px;}.css-1dtpypy .tableBlock__font-size--large{font-size:18px;}.css-1dtpypy .tableBlock__border--some tbody tr:not(:last-child){border-bottom:1px solid #e2e5e7;}.css-1dtpypy .tableBlock__border--bordered td,.css-1dtpypy .tableBlock__border--bordered th{border:1px solid #e2e5e7;}.css-1dtpypy .tableBlock__border--borderless tbody+tbody,.css-1dtpypy .tableBlock__border--borderless td,.css-1dtpypy .tableBlock__border--borderless th,.css-1dtpypy .tableBlock__border--borderless tr,.css-1dtpypy .tableBlock__border--borderless thead,.css-1dtpypy .tableBlock__border--borderless thead th{border:0!important;}.css-1dtpypy .tableBlock:not(.tableBlock__table-striped) tbody tr{background-color:unset!important;}.css-1dtpypy .tableBlock__table-striped tbody tr:nth-of-type(odd){background-color:#f9fafc!important;}.css-1dtpypy .tableBlock__table-compactl th,.css-1dtpypy .tableBlock__table-compact td{padding:3px!important;}.css-1dtpypy .tableBlock__full-size{width:100%;}.css-1dtpypy .textBlock{margin-bottom:16px;}.css-1dtpypy .textBlock__text-formatting--finePrint{font-size:12px;}.css-1dtpypy .textBlock__text-infoBox{padding:0.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:0.25rem;}.css-1dtpypy .textBlock__text-infoBox p{margin:0;}.css-1dtpypy .textBlock__text-infoBox--primary{background-color:#cce5ff;border-color:#b8daff;color:#004085;}.css-1dtpypy .textBlock__text-infoBox--secondary{background-color:#e2e3e5;border-color:#d6d8db;color:#383d41;}.css-1dtpypy .textBlock__text-infoBox--success{background-color:#d4edda;border-color:#c3e6cb;color:#155724;}.css-1dtpypy .textBlock__text-infoBox--danger{background-color:#f8d7da;border-color:#f5c6cb;color:#721c24;}.css-1dtpypy .textBlock__text-infoBox--warning{background-color:#fff3cd;border-color:#ffeeba;color:#856404;}.css-1dtpypy .textBlock__text-infoBox--info{background-color:#d1ecf1;border-color:#bee5eb;color:#0c5460;}.css-1dtpypy .textBlock__text-infoBox--dark{background-color:#d6d8d9;border-color:#c6c8ca;color:#1b1e21;}.css-1dtpypy .text-overline{-webkit-text-decoration:overline;text-decoration:overline;}.css-1dtpypy.css-1dtpypy{color:#2B3148;background-color:transparent;font-family:"Roboto","Helvetica","Arial",sans-serif;font-size:20px;line-height:24px;overflow:visible;padding-top:0px;position:relative;}.css-1dtpypy.css-1dtpypy:after{content:'';-webkit-transform:scale(0);-moz-transform:scale(0);-ms-transform:scale(0);transform:scale(0);position:absolute;border:2px solid #EA9430;border-radius:2px;inset:-8px;z-index:1;}.css-1dtpypy .js-external-link-button.link-like,.css-1dtpypy .js-external-link-anchor{color:inherit;border-radius:1px;-webkit-text-decoration:underline;text-decoration:underline;}.css-1dtpypy .js-external-link-button.link-like:hover,.css-1dtpypy .js-external-link-anchor:hover,.css-1dtpypy .js-external-link-button.link-like:active,.css-1dtpypy .js-external-link-anchor:active{text-decoration-thickness:2px;text-shadow:1px 0 0;}.css-1dtpypy .js-external-link-button.link-like:focus-visible,.css-1dtpypy .js-external-link-anchor:focus-visible{outline:transparent 2px dotted;box-shadow:0 0 0 2px #6314E6;}.css-1dtpypy p,.css-1dtpypy div{margin:0;display:block;}.css-1dtpypy pre{margin:0;display:block;}.css-1dtpypy pre code{display:block;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}.css-1dtpypy pre:not(:first-child){padding-top:8px;}.css-1dtpypy ul,.css-1dtpypy ol{display:block margin:0;padding-left:20px;}.css-1dtpypy ul li,.css-1dtpypy ol li{padding-top:8px;}.css-1dtpypy ul ul,.css-1dtpypy ol ul,.css-1dtpypy ul ol,.css-1dtpypy ol ol{padding-top:0;}.css-1dtpypy ul:not(:first-child),.css-1dtpypy ol:not(:first-child){padding-top:4px;} Test setup

Choose test type

t-test for the population mean, μ, based on one independent sample . Null hypothesis H 0 : μ = μ 0  

Alternative hypothesis H 1

Test details

Significance level α

The probability that we reject a true H 0 (type I error).

Degrees of freedom

Calculated as sample size minus one.

Test results

One Sample T Test: SPSS, By Hand, Step by Step

  • What is the One Sample T Test?
  • Example (By Hand)
  • One Sample T Test (SPSS)

What is a One Sample T Test?

The one 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 . For a full rundown on which test to use, see: T-score vs. Z-Score .

Assumptions of the test (your data should meet these requirements for the test to be valid):

  • Data is independent .
  • Data is collected randomly. For example, with simple random sampling .
  • The data is approximately normally distributed .

One Sample T Test Example

Example question : your company wants to improve sales. Past sales data indicate that the average sale was $100 per transaction. After training your sales force, recent sales data (taken from a sample of 25 salesmen) indicates an average sale of $130, with a standard deviation of $15. Did the training work? Test your hypothesis at a 5% alpha level .

Step 1: Write your null hypothesis statement ( How to state a null hypothesis ). The accepted hypothesis is that there is no difference in sales, so: H 0 : μ = $100.

Step 2: Write your alternate hypothesis . This is the one you’re testing in the one sample t test. You think that there is a difference (that the mean sales increased), so: H 1 : μ > $100.

Step 3: Identify the following pieces of information you’ll need to calculate the test statistic. The question should give you these items:

  • The sample mean (x̄). This is given in the question as $130.
  • The population mean (μ). Given as $100 (from past data).
  • The sample standard deviation (s) = $15.
  • Number of observations (n) = 25.

one sample t test

Step 5: Find the t-table value. You need two values to find this:

  • The alpha level: given as 5% in the question.
  • The degrees of freedom , which is the number of items in the sample (n) minus 1: 25 – 1 = 24.

Look up 24 degrees of freedom in the left column and 0.05 in the top row. The intersection is 1.711. This is your one-tailed critical t-value.

What this critical value means in a one tailed t test, is that we would expect most values to fall under 1.711. If our calculated t-value (from Step 4) falls within this range, the null hypothesis is likely true.

Step 5: Compare Step 4 to Step 5. The value from Step 4 does not fall into the range calculated in Step 5, so we can reject the null hypothesis . The value of 10 falls into the rejection region (the left tail).

In other words, it’s highly likely that the mean sale is greater. The one sample t test has told us that sales training was probably a success.

Want to check your work? Take a look at Daniel Soper’s calculator . Just plug in your data to get the t-statistic and critical values.

Beyer, W. H. CRC Standard Mathematical Tables, 31st ed. Boca Raton, FL: CRC Press, pp. 536 and 571, 2002. Agresti A. (1990) Categorical Data Analysis. John Wiley and Sons, New York. Friedman (2015). Fundamentals of Clinical Trials 5th ed. Springer.” Salkind, N. (2016). Statistics for People Who (Think They) Hate Statistics: Using Microsoft Excel 4th Edition.

  • Comprehensive Learning Paths
  • 150+ Hours of Videos
  • Complete Access to Jupyter notebooks, Datasets, References.

Rating

One Sample T Test – Clearly Explained with Examples | ML+

  • October 8, 2020
  • Selva Prabhakaran

One sample T-Test tests if the given sample of observations could have been generated from a population with a specified mean.

If it is found from the test that the means are statistically different, we infer that the sample is unlikely to have come from the population.

For example: If you want to test a car manufacturer’s claim that their cars give a highway mileage of 20kmpl on an average. You sample 10 cars from the dealership, measure their mileage and use the T-test to determine if the manufacturer’s claim is true.

By end of this, you will know when and how to do the T-Test, the concept, math, how to set the null and alternate hypothesis, how to use the T-tables, how to understand the one-tailed and two-tailed T-Test and see how to implement in R and Python using a practical example.

one sample hypothesis test formula

Introduction

Purpose of one sample t test, how to set the null and alternate hypothesis, procedure to do one sample t test, one sample t test example, one sample t test implementation, how to decide which t test to perform two tailed, upper tailed or lower tailed.

  • Related Posts

The ‘One sample T Test’ is one of the 3 types of T Tests . It is used when you want to test if the mean of the population from which the sample is drawn is of a hypothesized value. You will understand this statement better (and all of about One Sample T test) better by the end of this post.

T Test was first invented by William Sealy Gosset, in 1908. Since he used the pseudo name as ‘Student’ when publishing his method in the paper titled ‘Biometrika’, the test came to be know as Student’s T Test.

Since it assumes that the test statistic, typically the sample mean, follows the sampling distribution, the Student’s T Test is considered as a Parametric test.

The purpose of the One Sample T Test is to determine if a sample observations could have come from a process that follows a specific parameter (like the mean).

It is typically implemented on small samples.

For example, given a sample of 15 items, you want to test if the sample mean is the same as a hypothesized mean (population). That is, essentially you want to know if the sample came from the given population or not.

Let’s suppose, you want to test if the mean weight of a manufactured component (from a sample size 15) is of a particular value (55 grams), with a 99% confidence.

Image showing manufacturing quality testing

How did we determine One sample T-test is the right test for this?

one sample hypothesis test formula

Because, there is only one sample involved and you want to compare the mean of this sample against a particular (hypothesized) value..

To do this, you need to set up a null hypothesis and an alternate hypothesis .

The null hypothesis usually assumes that there is no difference in the sample means and the hypothesized mean (comparison mean). The purpose of the T Test is to test if the null hypothesis can be rejected or not.

Depending on the how the problem is stated, the alternate hypothesis can be one of the following 3 cases:

  • Case 1: H1 : x̅ != µ. Used when the true sample mean is not equal to the comparison mean. Use Two Tailed T Test.
  • Case 2: H1 : x̅ > µ. Used when the true sample mean is greater than the comparison mean. Use Upper Tailed T Test.
  • Case 3: H1 : x̅ < µ. Used when the true sample mean is lesser than the comparison mean. Use Lower Tailed T Test.

Where x̅ is the sample mean and µ is the population mean for comparison. We will go more into the detail of these three cases after solving some practical examples.

Example 1: A customer service company wants to know if their support agents are performing on par with industry standards.

According to a report the standard mean resolution time is 20 minutes per ticket. The sample group has a mean at 21 minutes per ticket with a standard deviation of 7 minutes.

Can you tell if the company’s support performance is better than the industry standard or not?

Example 2: A farming company wants to know if a new fertilizer has improved crop yield or not.

Historic data shows the average yield of the farm is 20 tonne per acre. They decide to test a new organic fertilizer on a smaller sample of farms and observe the new yield is 20.175 tonne per acre with a standard deviation of 3.02 tonne for 12 different farms.

Did the new fertilizer work?

Step 1: Define the Null Hypothesis (H0) and Alternate Hypothesis (H1)

H0: Sample mean (x̅) = Hypothesized Population mean (µ)

H1: Sample mean (x̅) != Hypothesized Population mean (µ)

The alternate hypothesis can also state that the sample mean is greater than or less than the comparison mean.

Step 2: Compute the test statistic (T)

$$t = \frac{Z}{s} = \frac{\bar{X} – \mu}{\frac{\hat{\sigma}}{\sqrt{n}}}$$

where s is the standard error .

Step 3: Find the T-critical from the T-Table

Use the degree of freedom and the alpha level (0.05) to find the T-critical.

Step 4: Determine if the computed test statistic falls in the rejection region.

Alternately, simply compute the P-value. If it is less than the significance level (0.05 or 0.01), reject the null hypothesis.

Problem Statement:

We have the potato yield from 12 different farms. We know that the standard potato yield for the given variety is µ=20.

x = [21.5, 24.5, 18.5, 17.2, 14.5, 23.2, 22.1, 20.5, 19.4, 18.1, 24.1, 18.5]

Test if the potato yield from these farms is significantly better than the standard yield.

Step 1: Define the Null and Alternate Hypothesis

H0: x̅ = 20

H1: x̅ > 20

n = 12. Since this is one sample T test, the degree of freedom = n-1 = 12-1 = 11.

Let’s set alpha = 0.05, to meet 95% confidence level.

Step 2: Calculate the Test Statistic (T) 1. Calculate sample mean

$$\bar{X} = \frac{x_1 + x_2 + x_3 + . . + x_n}{n}$$

$$\bar{x} = 20.175$$

  • Calculate sample standard deviation

$$\bar{\sigma} = \frac{(x_1 – \bar{x})^2 + (x_2 – \bar{x})^2 + (x_3 – \bar{x})^2 + . . + (x_n – \bar{x})^2}{n-1}$$

$$\sigma = 3.0211$$

  • Substitute in the T Statistic formula

$$T = \frac{\bar{x} – \mu}{se} = \frac{\bar{x} – \mu}{\frac{\sigma}{\sqrt{n}}}$$

$$T = (20.175 – 20)/(3.0211/\sqrt{12}) = 0.2006$$

Step 3: Find the T-Critical

Confidence level = 0.95, alpha=0.05. For one tailed test, look under 0.05 column. For d.o.f = 12 – 1 = 11, T-Critical = 1.796 .

Now you might wonder why ‘One Tailed test’ was chosen. This is because of the way you define the alternate hypothesis. Had the null hypothesis simply stated that the sample means is not equal to 20, then we would have gone for a two tailed test. More details about this topic in the next section.

Image showing T-Table for one sample T Test

Step 4: Does it fall in rejection region?

Since the computed T Statistic is less than the T-critical, it does not fall in the rejection region.

Image showing one-tailed T Test

Clearly, the calculated T statistic does not fall in the rejection region. So, we do not reject the null hypothesis.

Since you want to perform a ‘One Tailed Greater than’ test (that is, the sample mean is greater than the comparison mean), you need to specify alternative='greater' in the t.test() function. Because, by default, the t.test() does a two tailed test (which is what you do when your alternate hypothesis simply states sample mean != comparison mean).

The P-value computed here is nothing but p = Pr(T > t) (upper-tailed), where t is the calculated T statistic.

Image showing T-Distribution for P-value Computation for One Sample T-Test

In Python, One sample T Test is implemented in ttest_1samp() function in the scipy package. However, it does a Two tailed test by default , and reports a signed T statistic. That means, the reported P-value will always be computed for a Two-tailed test. To calculate the correct P value, you need to divide the output P-value by 2.

Apply the following logic if you are performing a one tailed test:

For greater than test: Reject H0 if p/2 < alpha (0.05). In this case, t will be greater than 0. For lesser than test: Reject H0 if p/2 < alpha (0.05). In this case, t will be less than 0.

Since it is one tailed test, the real p-value is 0.8446/2 = 0.4223. We do not rejecting the Null Hypothesis anyway.

The decision of whether the computed test statistic falls in the rejection region depends on how the alternate hypothesis is defined.

We know the Null Hypothesis is H0: µD = 0. Where, µD is the difference in the means, that is sample mean minus the comparison mean.

You can also write H0 as: x̅ = µ , where x̅ is sample mean and ‘µ’ is the comparison mean.

Case 1: If H1 : x̅ != µ , then rejection region lies on both tails of the T-Distribution (two-tailed). This means the alternate hypothesis just states the difference in means is not equal. There is no comparison if one of the means is greater or lesser than the other.

In this case, use Two Tailed T Test .

Here, P value = 2 . Pr(T > | t |)

Image showing two-tailed-test

Case 2: If H1: x̅ > µ , then rejection region lies on upper tail of the T-Distribution (upper-tailed). If the mean of the sample of interest is greater than the comparison mean. Example: If Component A has a longer time-to-failure than Component B.

In such case, use Upper Tailed based test.

Here, P-value = Pr(T > t)

Image showing upper tailed T-Distribution

Case 3: If H1: x̅ < µ , then rejection region lies on lower tail of the T-Distribution (lower-tailed). If the mean of the sample of interest is lesser than the comparison mean.

In such case, use lower tailed test.

Here, P-value = Pr(T < t)

Image showing T-Distribution for Lower Tailed T-Test

Hope you are now familiar and clear about with the One Sample T Test. If some thing is still not clear, write in comment. Next, topic is Two sample T test . Stay tuned.

More Articles

Correlation – connecting the dots, the role of correlation in data analysis, hypothesis testing – a deep dive into hypothesis testing, the backbone of statistical inference, sampling and sampling distributions – a comprehensive guide on sampling and sampling distributions, law of large numbers – a deep dive into the world of statistics, central limit theorem – a deep dive into central limit theorem and its significance in statistics, skewness and kurtosis – peaks and tails, understanding data through skewness and kurtosis”, similar articles, complete introduction to linear regression in r, how to implement common statistical significance tests and find the p value, logistic regression – a complete tutorial with examples in r.

Subscribe to Machine Learning Plus for high value data science content

© Machinelearningplus. All rights reserved.

one sample hypothesis test formula

Machine Learning A-Z™: Hands-On Python & R In Data Science

Free sample videos:.

one sample hypothesis test formula

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
  • independent sample t-test
  • paired samples t-test

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:

  • Null hypothesis H 0 : The mean value of the population is equal to the specified value.
  • Alternative hypothesis H 1 : The mean value of the population is not equal to the specified value.
  • Null hypothesis H 0 : The mean value of the population is equal to or greater than (or less than) that of the specified value.
  • Alternative hypothesis H 1 : The mean value of the population is smaller (or larger) than the specified values.

One sample t-test equation

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 equation

Calculate one sample t-test

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.

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.

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
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 412 pages
  • 5rd revised edition (April 2024)
  • Only 7.99 €

Datatab

"Super simple written"

"It could not be simpler"

"So many helpful examples"

Statistics Calculator

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

User Preferences

Content preview.

Arcu felis bibendum ut tristique et egestas quis:

  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
  • Duis aute irure dolor in reprehenderit in voluptate
  • Excepteur sint occaecat cupidatat non proident

Keyboard Shortcuts

5.3 - hypothesis testing for one-sample mean.

In the previous section, we learned how to perform a hypothesis test for one proportion. The concepts of hypothesis testing remain constant for any hypothesis test. In these next few sections, we will present the hypothesis test for one mean. We start with our knowledge of the sampling distribution of the sample mean.

Hypothesis Test for One-Sample Mean Section  

Recall that under certain conditions, the sampling distribution of the sample mean, \(\bar{x} \), is approximately normal with mean, \(\mu \), standard error \(\dfrac{\sigma}{\sqrt{n}} \), and estimated standard error \(\dfrac{s}{\sqrt{n}} \).

\(H_0\colon \mu=\mu_0\)

Conditions:

  • The distribution of the population is Normal
  • The sample size is large \( n>30 \).

Test Statistic:

If at least one of conditions are satisfied, then...

\( t=\dfrac{\bar{x}-\mu_0}{\frac{s}{\sqrt{n}}} \)

will follow a t-distribution with \(n-1 \) degrees of freedom.

Notice when working with continuous data we are going to use a t statistic as opposed to the z statistic. This is due to the fact that the sample size impacts the sampling distribution and needs to be taken into account. We do this by recognizing “degrees of freedom”. We will not go into too much detail about degrees of freedom in this course.

Let’s look at an example.

Example 5-1 Section  

This depends on the standard deviation of \(\bar{x} \) . 

\begin{align} t^*&=\dfrac{\bar{x}-\mu}{\frac{s}{\sqrt{n}}}\\&=\dfrac{8.3-8.5}{\frac{1.2}{\sqrt{61}}}\\&=-1.3 \end{align} 

Thus, we are asking if \(-1.3\) is very far away from zero, since that corresponds to the case when \(\bar{x}\) is equal to \(\mu_0 \). If it is far away, then it is unlikely that the null hypothesis is true and one rejects it. Otherwise, one cannot reject the null hypothesis. 

Calcworkshop

One Sample T Test Easily Explained w/ 5+ Examples!

// Last Updated: October 9, 2020 - Watch Video //

Did you know that a hypothesis test for a sample mean is the same thing as a one sample t-test?

Jenn (B.S., M.Ed.) of Calcworkshop® teaching one sample t test

Jenn, Founder Calcworkshop ® , 15+ Years Experience (Licensed & Certified Teacher)

Learn the how-to with 5 step-by-step examples.

Let’s go!

What is a One Sample T Test?

A one sample t-test determines whether or not the sample mean is statistically different (statistically significant) from a population mean.

While significance tests for population proportions are based on z-scores and the normal distribution, hypothesis testing for population means depends on whether or not the population standard deviation is known or unknown.

For a one sample t test, we compare a test variable against a test value. And depending on whether or not we know the population standard deviation will determine what type of test variable we calculate.

T Test Vs. Z Test

So, determining whether or not to use a z-test or a t-test comes down to four things:

  • Are we are working with a proportion (z-test) or mean (z-test or t-test)?
  • Do you know the population standard deviation (z-test)?
  • Is the population normally distributed (z-test)?
  • What is the sample size? If the sample is less than 30 (t-test), if the sample is larger than 30 we can apply the central limit theorem as population is approximately normally.

How To Calculate a Test Statistic

Standard deviation known.

If the population standard deviation is known , then our significance test will follow a z-value. And as we learned while conducting confidence intervals, if our sample size is larger than 30, then our distribution is normal or approximately normal. And if our sample size is less than 30, we apply the Central Limit Theorem and deem our distribution approximately normal.

z test statistic formula

Z Test Statistic Formula

Standard Deviation Unknown

If the population standard deviation is unknown , we will use a sample standard deviation that will be close enough to the unknown population standard deviation. But this will also cause us to have to use a t-distribution instead of a normal distribution as noted by StatTrek .

Just like we saw with confidence intervals for population means, the t-distribution has an additional parameter representing the degrees of freedom or the number of observations that can be chosen freely.

t test statistic formula

T Test Statistic Formula

This means that our test statistic will be a t-value rather than a z-value. But thankfully, how we find our p-value and draw our final inference is the same as for hypothesis testing for proportions, as the graphic below illustrates.

how to find the p value

How To Find The P Value

Example Question

For example, imagine a company wants to test the claim that their batteries last more than 40 hours. Using a simple random sample of 15 batteries yielded a mean of 44.9 hours, with a standard deviation of 8.9 hours. Test this claim using a significance level of 0.05.

one sample t test example

One Sample T Test Example

How To Find P Value From T

So, our p-value is a probability, and it determines whether our test statistic is as extreme or more extreme then our test value, assuming that the null hypothesis is true. To find this value we either use a calculator or a t-table, as we will demonstrate in the video.

We have significant evidence to conclude the company’s claim that their batteries last more than 40 hours.

what does the p value mean

What Does The P Value Mean?

Together we will work through various examples of how to create a hypothesis test about population means using normal distributions and t-distributions.

One Sample T Test – Lesson & Examples (Video)

  • Introduction to Video: One Sample t-test
  • 00:00:43 – Steps for conducting a hypothesis test for population means (one sample z-test or one sample t-test)
  • Exclusive Content for Members Only
  • 00:03:49 – Conduct a hypothesis test and confidence interval when population standard deviation is known (Example #1)
  • 00:13:49 – Test the null hypothesis when population standard deviation is known (Example #2)
  • 00:18:56 – Use a one-sample t-test to test a claim (Example #3)
  • 00:26:50 – Conduct a hypothesis test and confidence interval when population standard deviation is unknown (Example #4)
  • 00:37:16 – Conduct a hypothesis test by using a one-sample t-test and provide a confidence interval (Example #5)
  • 00:49:19 – Test the hypothesis by first finding the sample mean and standard deviation (Example #6)
  • Practice Problems with Step-by-Step Solutions
  • Chapter Tests with Video Solutions

Get access to all the courses and over 450 HD videos with your subscription

Monthly and Yearly Plans Available

Get My Subscription Now

Still wondering if CalcWorkshop is right for you? Take a Tour and find out how a membership can take the struggle out of learning math.

5 Star Excellence award from Shopper Approved for collecting at least 100 5 star reviews

One Sample T-Test

The one 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. Suppose you are interested in determining whether an assembly line produces laptop computers that weigh five pounds. To test this hypothesis, you could collect a sample of laptop computers from the assembly line, measure their weights, and compare the sample with a value of five using a one-sample t -test.

There are two kinds of hypotheses for a one sample t -test, the null hypothesis and the alternative hypothesis . The alternative hypothesis assumes that some difference exists between the true mean (μ) and the comparison value (m0), whereas the null hypothesis assumes that no difference exists. The purpose of the one sample t -test is to determine if the null hypothesis should be rejected, given the sample data. The alternative hypothesis can assume one of three forms depending on the question being asked. If the goal is to measure any difference, regardless of direction, a two-tailed hypothesis is used. If the direction of the difference between the sample mean and the comparison value matters, either an upper-tailed or lower-tailed hypothesis is used. The null hypothesis remains the same for each type of one sample t -test. The hypotheses are formally defined below:

• The null hypothesis (\(H_0\)) assumes that the difference between the true mean (\(\mu\)) and the comparison value (\(m_0\)) is equal to zero.

  • • The two-tailed alternative hypothesis (\(H_1\)) assumes that the difference between the true mean (\(\mu\)) and the comparison value (\(m_0\)) is not equal to zero.
  • • The upper-tailed alternative hypothesis (\(H_1\)) assumes that the true mean (\(\mu\)) of the sample is greater than the comparison value (\(m_0\)).
  • • The lower-tailed alternative hypothesis (\(H_1\)) assumes that the true mean (\(\mu\)) of the sample is less than the comparison value (\(m_0\)).

The mathematical representations of the null and alternative hypotheses are defined below:

  • \(H_0:\ \mu\ =\ m_0\)
  • \(H_1:\ \mu\ \ne\ m_0\)    (two-tailed)
  • \(H_1:\ \mu\ >\ m_0\)    (upper-tailed)
  • \(H_1:\ \mu\ <\ m_0\)    (lower-tailed)

Note. It is important to remember that hypotheses are never about data, they are about the processes which produce the data. If you are interested in knowing whether the mean weight of a sample of laptops is equal to five pounds, the real question being asked is whether the process that produced those laptops has a mean of five.

Need help with your analysis?

Schedule a time to speak with an expert using the calendar below.

User-friendly Software

Transform raw data into written, interpreted, APA formatted t-test results in seconds.

Assumptions

As a parametric procedure (a procedure which estimates unknown parameters), the one sample t -test makes several assumptions. Although t -tests are quite robust, it is good practice to evaluate the degree of deviation from these assumptions in order to assess the quality of the results. The one sample t -test has four main assumptions:

  • The dependent variable must be continuous (interval/ratio).
  • The observations are independent of one another.
  • The dependent variable should be approximately normally distributed.
  • The dependent variable should not contain any outliers.

Level of Measurement

The one sample t -test requires the sample data to be numeric and continuous, as it is based on the normal distribution. Continuous data can take on any value within a range (income, height, weight, etc.). The opposite of continuous data is discrete data, which can only take on a few values (Low, Medium, High, etc.). Occasionally, discrete data can be used to approximate a continuous scale, such as with Likert-type scales.

Independence

Independence of observations is usually not testable, but can be reasonably assumed if the data collection process was random without replacement. In our example, we would want to select laptop computers at random, compared to using any systematic pattern. This ensures minimal risk of collecting a biased sample that would yield inaccurate results.

To test the assumption of normality, a variety of methods are available, but the simplest is to inspect the data visually using a histogram or a Q-Q scatterplot. Real-world data are almost never perfectly normal, so this assumption can be considered reasonably met if the shape looks approximately symmetric and bell-shaped. The data in the example figure below is approximately normally distributed.

one sample hypothesis test formula

An outlier is a data value which is too extreme to belong in the distribution of interest. Let’s suppose in our example that the assembly machine ran out of a particular component, resulting in a laptop that was assembled at a much lower weight. This is a condition that is outside of our question of interest, and therefore we can remove that observation prior to conducting the analysis. However, just because a value is extreme does not make it an outlier. Let’s suppose that our laptop assembly machine occasionally produces laptops which weigh significantly more or less than five pounds, our target value. In this case, these extreme values are absolutely essential to the question we are asking and should not be removed. Box-plots are useful for visualizing the variability in a sample, as well as locating any outliers. The boxplot on the left shows a sample with no outliers. The boxplot on the right shows a sample with one outlier.

boxplot of a normally distributed variable

The procedure for a one sample t-test can be summed up in four steps. The symbols to be used are defined below:

  • \(Y\ =\ \)Random sample
  • \(y_i\ =\ \)The \(i^{th}\) observation in \(Y\)
  • \(n\ =\ \)The sample size
  • \(m_0\ =\ \)The hypothesized value
  • \(\overline{y}\ =\ \)The sample mean
  • \(\hat{\sigma}\ =\ \)The sample standard deviation
  • \(T\ =\)The critical value of a t -distribution with (\(n\ -\ 1\)) degrees of freedom
  • \(t\ =\ \)The t -statistic ( t -test statistic) for a one sample t -test
  • \(p\ =\ \)The \(p\)-value (probability value) for the t -statistic.

The four steps are listed below:

  • 1. Calculate the sample mean.
  • \(\overline{y}\ =\ \frac{y_1\ +\ y_2\ +\ \cdots\ +\ y_n}{n}\)
  • 2. Calculate the sample standard deviation.
  • \(\hat{\sigma}\ =\ \sqrt{\frac{(y_1\ -\ \overline{y})^2\ +\ (y_2\ -\ \overline{y})^2\ +\ \cdots\ +\ (y_n\ -\ \overline{y})^2}{n\ -\ 1}}\)
  • 3. Calculate the test statistic.
  • \(t\ =\ \frac{\overline{y}\ -\ m_0}{\hat{\sigma}/\sqrt{n}}\)
  • 4. Calculate the probability of observing the test statistic under the null hypothesis. This value is obtained by comparing t to a t -distribution with (\(n\ -\ 1\)) degrees of freedom. This can be done by looking up the value in a table, such as those found in many statistical textbooks, or with statistical software for more accurate results.
  • \(p\ =\ 2\ \cdot\ Pr(T\ >\ |t|)\)    (two-tailed)
  • \(p\ =\ Pr(T\ >\ t)\)    (upper-tailed)
  • \(p\ =\ Pr(T\ <\ t)\)    (lower-tailed)

Once the assumptions have been verified and the calculations are complete, all that remains is to determine whether the results provide sufficient evidence to reject the null hypothesis in favor of the alternative hypothesis.

Interpretation

There are two types of significance to consider when interpreting the results of a one sample t -test, statistical significance and practical significance.

Statistical Significance

Statistical significance is determined by looking at the p -value. The p -value gives the probability of observing the test results under the null hypothesis. The lower the p -value, the lower the probability of obtaining a result like the one that was observed if the null hypothesis was true. Thus, a low p -value indicates decreased support for the null hypothesis. However, the possibility that the null hypothesis is true and that we simply obtained a very rare result can never be ruled out completely. The cutoff value for determining statistical significance is ultimately decided on by the researcher, but usually a value of .05 or less is chosen. This corresponds to a 5% (or less) chance of obtaining a result like the one that was observed if the null hypothesis was true.

Practical Significance

Practical significance depends on the subject matter. In general, a result is practically significant if the size of the effect is large (or small) enough to be relevant to the research questions being investigated.  It is not uncommon, especially with large sample sizes, to observe a result that is statistically significant but not practically significant.  Returning to the example of laptop weights, an average difference of .002 pounds might be statistically significant.  However, a difference this small is unlikely to be of any interest.  In most cases, both practical and statistical significance are required to draw meaningful conclusions.

Statistics Solutions can assist with your quantitative analysis by assisting you to develop your methodology and results chapters. The services that we offer include:

Data Analysis Plan

  • Edit your research questions and null/alternative hypotheses
  • Write your data analysis plan; specify specific statistics to address the research questions, the assumptions of the statistics, and justify why they are the appropriate statistics; provide references
  • Justify your sample size/power analysis, provide references
  • Explain your data analysis plan to you so you are comfortable and confident
  • Two hours of additional support with your statistician

Quantitative Results Section (Descriptive Statistics, Bivariate and Multivariate Analyses, Structural Equation Modeling , Path analysis, HLM, Cluster Analysis )

  • Clean and code dataset
  • Conduct descriptive statistics (i.e., mean, standard deviation, frequency and percent, as appropriate)
  • Conduct analyses to examine each of your research questions
  • Write-up results
  • Provide APA 7 th edition tables and figures
  • Explain Chapter 4 findings
  • Ongoing support for entire results chapter statistics

Please call 727-442-4290 to request a quote based on the specifics of your research, schedule using the calendar on this page, or email [email protected]

Logo for University of Washington Libraries

Want to create or adapt books like this? Learn more about how Pressbooks supports open publishing practices.

11 Hypothesis Testing with One Sample

Student learning outcomes.

By the end of this chapter, the student should be able to:

  • Be able to identify and develop the null and alternative hypothesis
  • Identify the consequences of Type I and Type II error.
  • Be able to perform an one-tailed and two-tailed hypothesis test using the critical value method
  • Be able to perform a hypothesis test using the p-value method
  • Be able to write conclusions based on hypothesis tests.

Introduction

Now we are down to the bread and butter work of the statistician: developing and testing hypotheses. It is important to   put this material in a broader context so that the method by which a hypothesis is formed is understood completely. Using textbook examples often clouds the real source of statistical hypotheses.

Statistical testing is part of a much larger process known as the scientific method. This method was developed more than two centuries ago as the accepted way that new knowledge could be created. Until then, and unfortunately even today, among some, “knowledge” could be created simply by some authority saying something was so, ipso dicta . Superstition and conspiracy theories were (are?) accepted uncritically.

The scientific method, briefly, states that only by following a careful and specific process can some assertion be included in the accepted body of knowledge. This process begins with a set of assumptions upon which a theory, sometimes called a model, is built. This theory, if it has any validity, will lead to predictions; what we call hypotheses.

As an example, in Microeconomics the theory of consumer choice begins with certain assumption concerning human behavior. From these assumptions a theory of how consumers make choices using indifference curves and the budget line. This theory gave rise to a very important prediction, namely, that there was an inverse relationship between price and quantity demanded. This relationship was known as the demand curve. The negative slope of the demand curve is really just a prediction, or a hypothesis, that can be tested with statistical tools.

Unless hundreds and hundreds of statistical tests of this hypothesis had not confirmed this relationship, the so-called Law of Demand would have been discarded years ago. This is the role of statistics, to test the hypotheses of various theories to determine if they should be admitted into the accepted body of knowledge; how we understand our world. Once admitted, however, they may be later discarded if new theories come along that make better predictions.

Not long ago two scientists claimed that they could get more energy out of a process than was put in. This caused a tremendous stir for obvious reasons. They were on the cover of Time and were offered extravagant sums to bring their research work to private industry and any number of universities. It was not long until their work was subjected to the rigorous tests of the scientific method and found to be a failure. No other lab could replicate their findings. Consequently they have sunk into obscurity and their theory discarded. It may surface again when someone can pass the tests of the hypotheses required by the scientific method, but until then it is just a curiosity. Many pure frauds have been attempted over time, but most have been found out by applying the process of the scientific method.

This discussion is meant to show just where in this process statistics falls. Statistics and statisticians are not necessarily in the business of developing theories, but in the business of testing others’ theories. Hypotheses come from these theories based upon an explicit set of assumptions and sound logic. The hypothesis comes first, before any data are gathered. Data do not create hypotheses; they are used to test them. If we bear this in mind as we study this section the process of forming and testing hypotheses will make more sense.

One job of a statistician is to make statistical inferences about populations based on samples taken from the population. Confidence intervals are one way to estimate a population parameter. Another way to make a statistical inference is to make a decision about the value of a specific parameter. For instance, a car dealer advertises that its new small truck gets 35 miles per gallon, on average. A tutoring service claims that its method of tutoring helps 90% of its students get an A or a B. A company says that women managers in their company earn an average of $60,000 per year.

A statistician will make a decision about these claims. This process is called ” hypothesis testing .” A hypothesis test involves collecting data from a sample and evaluating the data. Then, the statistician makes a decision as to whether or not there is sufficient evidence, based upon analyses of the data, to reject the null hypothesis.

In this chapter, you will conduct hypothesis tests on single means and single proportions. You will also learn about the errors associated with these tests.

Null and Alternative Hypotheses

The actual test begins by considering two hypotheses . They are called the null hypothesis and the alternative hypothesis . These hypotheses contain opposing viewpoints.

H_0

Since the null and alternative hypotheses are contradictory, you must examine evidence to decide if you have enough evidence to reject the null hypothesis or not. The evidence is in the form of sample data.

Table 1 presents the various hypotheses in the relevant pairs. For example, if the null hypothesis is equal to some value, the alternative has to be not equal to that value.

equal (=) not equal (≠)
greater than or equal to (≥) less than (<)
less than or equal to (≤) more than (>)

NOTE                                                                             

We want to test whether the mean GPA of students in American colleges is different from 2.0 (out of 4.0). The null and alternative hypotheses are:

\mu

We want to test if college students take less than five years to graduate from college, on the average. The null and alternative hypotheses are:

Outcomes and the Type I and Type II Errors

True False
Correct Outcome Type II error
Type I Error Correct Outcome

The four possible outcomes in the table are:

Each of the errors occurs with a particular probability. The Greek letters α and β represent the probabilities.

\alpha

By way of example, the American judicial system begins with the concept that a defendant is “presumed innocent”. This is the status quo and is the null hypothesis. The judge will tell the jury that they can not find the defendant guilty unless the evidence indicates guilt beyond a “reasonable doubt” which is usually defined in criminal cases as 95% certainty of guilt. If the jury cannot accept the null, innocent, then action will be taken, jail time. The burden of proof always lies with the alternative hypothesis. (In civil cases, the jury needs only to be more than 50% certain of wrongdoing to find culpability, called “a preponderance of the evidence”).

The example above was for a test of a mean, but the same logic applies to tests of hypotheses for all statistical parameters one may wish to test.

The following are examples of Type I and Type II errors.

Type I error : Frank thinks that his rock climbing equipment may not be safe when, in fact, it really is safe.

Type II error : Frank thinks that his rock climbing equipment may be safe when, in fact, it is not safe.

Notice that, in this case, the error with the greater consequence is the Type II error. (If Frank thinks his rock climbing equipment is safe, he will go ahead and use it.)

This is a situation described as “accepting a false null”.

Type I error : The emergency crew thinks that the victim is dead when, in fact, the victim is alive. Type II error : The emergency crew does not know if the victim is alive when, in fact, the victim is dead.

The error with the greater consequence is the Type I error. (If the emergency crew thinks the victim is dead, they will not treat him.)

Distribution Needed for Hypothesis Testing

Particular distributions are associated with hypothesis testing.We will perform hypotheses tests of a population mean using a normal distribution or a Student’s t -distribution. (Remember, use a Student’s t -distribution when the population standard deviation is unknown and the sample size is small, where small is considered to be less than 30 observations.) We perform tests of a population proportion using a normal distribution when we can assume that the distribution is normally distributed. We consider this to be true if the sample proportion, p ‘ , times the sample size is greater than 5 and 1- p ‘ times the sample size is also greater then 5. This is the same rule of thumb we used when developing the formula for the confidence interval for a population proportion.

Hypothesis Test for the Mean

Going back to the standardizing formula we can derive the test statistic for testing hypotheses concerning means.

Z_c=\frac{\bar{x}-\mu}{\frac{\sigma}{\sqrt{n}}}

This gives us the decision rule for testing a hypothesis for a two-tailed test:

If
If

P-Value Approach

one sample hypothesis test formula

Both decision rules will result in the same decision and it is a matter of preference which one is used.

One and Two-tailed Tests

\mu\neq100

The claim would be in the alternative hypothesis. The burden of proof in hypothesis testing is carried in the alternative. This is because failing to reject the null, the status quo, must be accomplished with 90 or 95 percent significance that it cannot be maintained. Said another way, we want to have only a 5 or 10 percent probability of making a Type I error, rejecting a good null; overthrowing the status quo.

Figure 5 shows the two possible cases and the form of the null and alternative hypothesis that give rise to them.

one sample hypothesis test formula

Effects of Sample Size on Test Statistic

\sigma

Table 3 summarizes test statistics for varying sample sizes and population standard deviation known and unknown.

< 30 (σ unknown)
< 30 (σ known)
> 30 (σ unknown)
> 30 (σ known)

A Systematic Approach for Testing A Hypothesis

A systematic approach to hypothesis testing follows the following steps and in this order. This template will work for all hypotheses that you will ever test.

  • Set up the null and alternative hypothesis. This is typically the hardest part of the process. Here the question being asked is reviewed. What parameter is being tested, a mean, a proportion, differences in means, etc. Is this a one-tailed test or two-tailed test? Remember, if someone is making a claim it will always be a one-tailed test.
  • Decide the level of significance required for this particular case and determine the critical value. These can be found in the appropriate statistical table. The levels of confidence typical for the social sciences are 90, 95 and 99. However, the level of significance is a policy decision and should be based upon the risk of making a Type I error, rejecting a good null. Consider the consequences of making a Type I error.
  • Take a sample(s) and calculate the relevant parameters: sample mean, standard deviation, or proportion. Using the formula for the test statistic from above in step 2, now calculate the test statistic for this particular case using the parameters you have just calculated.
  • Compare the calculated test statistic and the critical value. Marking these on the graph will give a good visual picture of the situation. There are now only two situations:

a.     The test statistic is in the tail: Cannot Accept the null, the probability that this sample mean (proportion) came from the hypothesized distribution is too small to believe that it is the real home of these sample data.

b.   The test statistic is not in the tail: Cannot Reject the null, the sample data are compatible with the hypothesized population parameter.

  • Reach a conclusion. It is best to articulate the conclusion two different ways. First a formal statistical conclusion such as “With a 95 % level of significance we cannot accept the null hypotheses that the population mean is equal to XX (units of measurement)”. The second statement of the conclusion is less formal and states the action, or lack of action, required. If the formal conclusion was that above, then the informal one might be, “The machine is broken and we need to shut it down and call for repairs”.

All hypotheses tested will go through this same process. The only changes are the relevant formulas and those are determined by the hypothesis required to answer the original question.

Full Hypothesis Test Examples

Tests on means.

Jeffrey, as an eight-year old, established a mean time of 16.43 seconds for swimming the 25-yard freestyle, with a standard deviation of 0.8 seconds . His dad, Frank, thought that Jeffrey could swim the 25-yard freestyle faster using goggles. Frank bought Jeffrey a new pair of expensive goggles and timed Jeffrey for 15 25-yard freestyle swims . For the 15 swims, Jeffrey’s mean time was 16 seconds. Frank thought that the goggles helped Jeffrey to swim faster than the 16.43 seconds. Conduct a hypothesis test using a preset α = 0.05.

Solution – Example 6

Set up the Hypothesis Test:

Since the problem is about a mean, this is a test of a single population mean . Set the null and alternative hypothesis:

In this case there is an implied challenge or claim. This is that the goggles will reduce the swimming time. The effect of this is to set the hypothesis as a one-tailed test. The claim will always be in the alternative hypothesis because the burden of proof always lies with the alternative. Remember that the status quo must be defeated with a high degree of confidence, in this case 95 % confidence. The null and alternative hypotheses are thus:

For Jeffrey to swim faster, his time will be less than 16.43 seconds. The “<” tells you this is left-tailed. Determine the distribution needed:

Distribution for the test statistic:

The sample size is less than 30 and we do not know the population standard deviation so this is a t-test and the proper formula is:

t_c=\frac{\bar{x}-{\mu_0}}{\frac{s}{\sqrt{n}}}

Our step 2, setting the level of significance, has already been determined by the problem, .05 for a 95 % significance level. It is worth thinking about the meaning of this choice. The Type I error is to conclude that Jeffrey swims the 25-yard freestyle, on average, in less than 16.43 seconds when, in fact, he actually swims the 25-yard freestyle, on average, in 16.43 seconds. (Reject the null hypothesis when the null hypothesis is true.) For this case the only concern with a Type I error would seem to be that Jeffery’s dad may fail to bet on his son’s victory because he does not have appropriate confidence in the effect of the goggles.

To find the critical value we need to select the appropriate test statistic. We have concluded that this is a t-test on the basis of the sample size and that we are interested in a population mean. We can now draw the graph of the t-distribution and mark the critical value (Figure 6). For this problem the degrees of freedom are n-1, or 14. Looking up 14 degrees of freedom at the 0.05 column of the t-table we find 1.761. This is the critical value and we can put this on our graph.

Step 3 is the calculation of the test statistic using the formula we have selected.

t_c=\frac{16-16.43}{\frac{0.8}{\sqrt{15}}}

We find that the calculated test statistic is 2.08, meaning that the sample mean is 2.08 standard deviations away from the hypothesized mean of 16.43.

one sample hypothesis test formula

Step 4 has us compare the test statistic and the critical value and mark these on the graph. We see that the test statistic is in the tail and thus we move to step 4 and reach a conclusion. The probability that an average time of 16 minutes could come from a distribution with a population mean of 16.43 minutes is too unlikely for us to accept the null hypothesis. We cannot accept the null.

Step 5 has us state our conclusions first formally and then less formally. A formal conclusion would be stated as: “With a 95% level of significance we cannot accept the null hypothesis that the swimming time with goggles comes from a distribution with a population mean time of 16.43 minutes.” Less formally, “With 95% significance we believe that the goggles improves swimming speed”

If we wished to use the p-value system of reaching a conclusion we would calculate the statistic and take the additional step to find the probability of being 2.08 standard deviations from the mean on a t-distribution. This value is .0187. Comparing this to the α-level of .05 we see that we cannot accept the null. The p-value has been put on the graph as the shaded area beyond -2.08 and it shows that it is smaller than the hatched area which is the alpha level of 0.05. Both methods reach the same conclusion that we cannot accept the null hypothesis.

Jane has just begun her new job as on the sales force of a very competitive company. In a sample of 16 sales calls it was found that she closed the contract for an average value of $108 with a standard deviation of 12 dollars. Test at 5% significance that the population mean is at least $100 against the alternative that it is less than 100 dollars. Company policy requires that new members of the sales force must exceed an average of $100 per contract during the trial employment period. Can we conclude that Jane has met this requirement at the significance level of 95%?

Solution – Example 7

STEP 1 : Set the Null and Alternative Hypothesis.

STEP 2 : Decide the level of significance and draw the graph (Figure 7) showing the critical value.

t_a = 1.753

STEP 3 : Calculate sample parameters and the test statistic.

t_c=\frac{108-100}{\frac{12}{\sqrt{16}}} = 2.67

STEP 4 : Compare test statistic and the critical values

STEP 5 : Reach a Conclusion

The test statistic is a Student’s t because the sample size is below 30; therefore, we cannot use the normal distribution. Comparing the calculated value of the test statistic and the critical value of t ( t a ) at a 5% significance level, we see that the calculated value is in the tail of the distribution. Thus, we conclude that 108 dollars per contract is significantly larger than the hypothesized value of 100 and thus we cannot accept the null hypothesis. There is evidence that supports Jane’s performance meets company standards.

s^2

Again we will follow the steps in our analysis of this problem.

Solution – Example 8

STEP 1 : Set the Null and Alternative Hypothesis. The random variable is the quantity of fluid placed in the bottles. This is a continuous random variable and the parameter we are interested in is the mean. Our hypothesis therefore is about the mean. In this case we are concerned that the machine is not filling properly. From what we are told it does not matter if the machine is over-filling or under-filling, both seem to be an equally bad error. This tells us that this is a two-tailed test: if the machine is malfunctioning it will be shutdown regardless if it is from over-filling or under-filling. The null and alternative hypotheses are thus:

STEP 2 : Decide the level of significance and draw the graph showing the critical value.

This problem has already set the level of significance at 99%. The decision seems an appropriate one and shows the thought process when setting the significance level. Management wants to be very certain, as certain as probability will allow, that they are not shutting down a machine that is not in need of repair. To draw the distribution and the critical value, we need to know which distribution to use. Because this is a continuous random variable and we are interested in the mean, and the sample size is greater than 30, the appropriate distribution is the normal distribution and the relevant critical value is 2.575 from the normal table or the t-table at 0.005 column and infinite degrees of freedom. We draw the graph and mark these points (Figure 8).

one sample hypothesis test formula

STEP 3 : Calculate sample parameters and the test statistic. The sample parameters are provided, the sample mean is 7.91 and the sample variance is .03 and the sample size is 35. We need to note that the sample variance was provided not the sample standard deviation, which is what we need for the formula. Remembering that the standard deviation is simply the square root of the variance, we therefore know the sample standard deviation, s, is 0.173. With this information we calculate the test statistic as -3.07, and mark it on the graph.

Z_c=\frac{\bar{x}-{\mu_0}}{\frac{s}{\sqrt{n}}} = Z_c=\frac{7.91-8}{\frac{.173}{\sqrt{35}}}=-3.07

STEP 4 : Compare test statistic and the critical values Now we compare the test statistic and the critical value by placing the test statistic on the graph. We see that the test statistic is in the tail, decidedly greater than the critical value of 2.575. We note that even the very small difference between the hypothesized value and the sample value is still a large number of standard deviations. The sample mean is only 0.08 ounces different from the required level of 8 ounces, but it is 3 plus standard deviations away and thus we cannot accept the null hypothesis.

Three standard deviations of a test statistic will guarantee that the test will fail. The probability that anything is within three standard deviations is almost zero. Actually it is 0.0026 on the normal distribution, which is certainly almost zero in a practical sense. Our formal conclusion would be “ At a 99% level of significance we cannot accept the hypothesis that the sample mean came from a distribution with a mean of 8 ounces” Or less formally, and getting to the point, “At a 99% level of significance we conclude that the machine is under filling the bottles and is in need of repair”.

Media Attributions

  • Type1Type2Error
  • HypTestFig2
  • HypTestFig3
  • HypTestPValue
  • OneTailTestFig5
  • HypTestExam7
  • HypTestExam8

Quantitative Analysis for Business Copyright © by Margo Bergman is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License , except where otherwise noted.

Share This Book

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

To log in and use all the features of Khan Academy, please enable JavaScript in your browser.

Unit 12: Significance tests (hypothesis testing)

About this unit.

Significance tests give us a formal process for using sample data to evaluate the likelihood of some claim about a population value. Learn how to conduct significance tests and calculate p-values to see how likely a sample result is to occur by random chance. You'll also see how we use p-values to make conclusions about hypotheses.

The idea of significance tests

  • Simple hypothesis testing (Opens a modal)
  • Idea behind hypothesis testing (Opens a modal)
  • Examples of null and alternative hypotheses (Opens a modal)
  • P-values and significance tests (Opens a modal)
  • Comparing P-values to different significance levels (Opens a modal)
  • Estimating a P-value from a simulation (Opens a modal)
  • Using P-values to make conclusions (Opens a modal)
  • Simple hypothesis testing Get 3 of 4 questions to level up!
  • Writing null and alternative hypotheses Get 3 of 4 questions to level up!
  • Estimating P-values from simulations Get 3 of 4 questions to level up!

Error probabilities and power

  • Introduction to Type I and Type II errors (Opens a modal)
  • Type 1 errors (Opens a modal)
  • Examples identifying Type I and Type II errors (Opens a modal)
  • Introduction to power in significance tests (Opens a modal)
  • Examples thinking about power in significance tests (Opens a modal)
  • Consequences of errors and significance (Opens a modal)
  • Type I vs Type II error Get 3 of 4 questions to level up!
  • Error probabilities and power Get 3 of 4 questions to level up!

Tests about a population proportion

  • Constructing hypotheses for a significance test about a proportion (Opens a modal)
  • Conditions for a z test about a proportion (Opens a modal)
  • Reference: Conditions for inference on a proportion (Opens a modal)
  • Calculating a z statistic in a test about a proportion (Opens a modal)
  • Calculating a P-value given a z statistic (Opens a modal)
  • Making conclusions in a test about a proportion (Opens a modal)
  • Writing hypotheses for a test about a proportion Get 3 of 4 questions to level up!
  • Conditions for a z test about a proportion Get 3 of 4 questions to level up!
  • Calculating the test statistic in a z test for a proportion Get 3 of 4 questions to level up!
  • Calculating the P-value in a z test for a proportion Get 3 of 4 questions to level up!
  • Making conclusions in a z test for a proportion Get 3 of 4 questions to level up!

Tests about a population mean

  • Writing hypotheses for a significance test about a mean (Opens a modal)
  • Conditions for a t test about a mean (Opens a modal)
  • Reference: Conditions for inference on a mean (Opens a modal)
  • When to use z or t statistics in significance tests (Opens a modal)
  • Example calculating t statistic for a test about a mean (Opens a modal)
  • Using TI calculator for P-value from t statistic (Opens a modal)
  • Using a table to estimate P-value from t statistic (Opens a modal)
  • Comparing P-value from t statistic to significance level (Opens a modal)
  • Free response example: Significance test for a mean (Opens a modal)
  • Writing hypotheses for a test about a mean Get 3 of 4 questions to level up!
  • Conditions for a t test about a mean Get 3 of 4 questions to level up!
  • Calculating the test statistic in a t test for a mean Get 3 of 4 questions to level up!
  • Calculating the P-value in a t test for a mean Get 3 of 4 questions to level up!
  • Making conclusions in a t test for a mean Get 3 of 4 questions to level up!

More significance testing videos

  • Hypothesis testing and p-values (Opens a modal)
  • One-tailed and two-tailed tests (Opens a modal)
  • Z-statistics vs. T-statistics (Opens a modal)
  • Small sample hypothesis test (Opens a modal)
  • Large sample proportion hypothesis testing (Opens a modal)
  • Prompt Library
  • DS/AI Trends
  • Stats Tools
  • Interview Questions
  • Generative AI
  • Machine Learning
  • Deep Learning

One Sample T-test: Formula & Examples

One sample test test - One tailed t test rejection region

Last updated: 16th Dec, 2023

In statistics , the t-test is often used in research when the researcher wants to know if there is a significant difference between the mean of sample and the population , or whether there is a significant difference between the means of two groups (unpaired / independent or paired). There are three types of t-tests : the one sample t-test,   two samples or independent samples t-test , and paired samples t-test . In this blog post, we will focus on the one sample t-test and explain with formula and examples . As data scientists , it is important for us to understand the concepts of t-test and how to use it in our data analysis. Check out our one-sample t-test calculator tool for means.

Table of Contents

What is One-sample T-test?

One-sample T-test is a statistical hypothesis testing technique in which the mean of a sample is tested against a hypothesized value, e.g., a population mean. The t-test is used to determine whether the difference between the sample mean and the hypothesized value, e.g., the population mean is statistically significant or not. This test is particularly useful when the population standard deviation is unknown and the sample size is small (typically less than 30) . The distribution used is T-distribution with certain degrees of freedom . 

Steps in Conducting a One-Sample T-Test:

We will understand the steps in conducting one-sample t-test with an example .

Assume that the national average score ( population mean ) for a high school mathematics exam is known to be 70 out of 100. A school wants to evaluate whether its new teaching approach has significantly changed the performance of its students in mathematics compared to the national average. The school selects a random sample of 20 students ( sample size ) who have been taught using the new teaching method. The average score of these 30 students is calculated to be 75 ( sample mean ).

State the Hypotheses :

  • Null Hypothesis ($H_0$ ​ ): There is no difference between the sample mean and the population mean.  Considering the example, the mean score of the students (sample mean) is equal to the national average (population mean), i.e., μ = 70 .
  • Alternative Hypothesis ($ H_ 1$ ​ ): There is a significant difference. The mean score of the students is not equal to the national average, i.e., μ ≠ 70 .

Calculate the T-Statistic : Using the formula and the data from the sample.

Determine the Critical Value : This value is obtained from the t-distribution table based on the desired significance level (commonly 0.05 for a 95% confidence level) and the degrees of freedom ( n − 1 ).

Make a Decision : If the calculated t-statistic is greater than the critical value, reject the null hypothesis; otherwise, fail to reject the null hypothesis.

Interpret the Results : If the null hypothesis is rejected, it suggests that the teaching method significantly impacts the students’ scores compared to the national average.

One-sample T-test Formula

The following is one-sample t-test formula / equation of t-statistics :

T = (X̄ – μ) / S/√n

Where, X̄ is the sample mean, μ is the hypothesized population mean, S is the standard deviation of the sample and n is the number of sample observations.

When working with T-test, T-distribution is used in place of the normal distribution. The t-distribution is a family of curves that are symmetrical about the mean, and have increasing variability as the degrees of freedom increase. The t-test statistic (T) follows a t-distribution with n – 1 degrees of freedom, where n is the number of observations in the sample.

One-sample T-test Example

In this section, we will learn about how to calculate t-statistics in one-sample t-test.

Suppose a claim is made that the average number of days a person spends on vacation is more than or equal to 5 days (hypothesized population mean) based on a sample of 16 people whose mean came out to be 9 days. As a first step, we will formulate the null and alternate hypothesis.

In hypothesis testing, we start by formulating the null hypothesis ( H 0 ​ ) and the alternative hypothesis ( H a ​ or H 1 ​ ). The null hypothesis represents a position of no change, no effect, or no difference—it is the hypothesis that the researcher tries to disprove. The alternative hypothesis represents a new theory or the proposition that there is an effect, a change, or a difference.

Based on the claim that the average number of days a person spends on vacation is more than or equal to 5 days, the hypotheses can be formulated as follows:

For a One-Tailed Test:

Null Hypothesis ( H 0 ​ ) : The average number of days a person spends on vacation is equal to 5 days. Mathematically, H 0 ​ : μ = 5 .

Alternative Hypothesis ( H a ​ ) : The average number of days a person spends on vacation is more than 5 days. Mathematically, H a ​ : μ > 5 .

Here, we are specifically looking to see if there is evidence to support the claim that people spend more than 5 days on vacation on average, which is why the alternative hypothesis is set up as greater than 5 days.

For a Two-Tailed Test:

If, however, you wanted to test the hypothesis that the average number of vacation days is not equal to 5 (either less than or more than 5), the hypotheses would be formulated differently:

Alternative Hypothesis ( H a ​ ) : The average number of days a person spends on vacation is not equal to 5 days. Mathematically, H a ​ : μ is not equal to 5 .

In this case, the alternative hypothesis is testing for any significant difference, regardless of direction (more or fewer vacation days than 5).

One-tailed or a Two-tailed test? Which one to use? For the data we have, where the sample mean is 9 days, and we are testing against the claim that the average number of vacation days is more than or equal to 5, a one-tailed test is most appropriate.

We will use one-sample t-test to test this hypothesis. A one-tailed test will be performed.

Where, X̄ is the sample mean, μ is the hypothesized population mean, S is the standard deviation of the sample and n is the number of observations in the sample.

A sample size of 16 persons is taken. The mean number of days spent on vacation by the persons in sample is found to be 9 days with a sample standard deviation is found to be 3 days.

= (9 – 5)/(3/ √16)

If the calculated t-value is 5.33 and the critical t-value for a one-tailed test at the alpha level of 0.05 is 1.753, you can make the following conclusions about the null hypothesis:

Since the calculated t-value (5.33) is greater than the critical t-value (1.753), you have sufficient evidence to reject the null hypothesis at the 0.05 significance level. This means that there is a statistically significant difference between the sample mean and the hypothesized population mean, and the sample provides enough evidence to support the claim that the average number of days a person spends on vacation is more than 5 days. The following plot can help you visualize the rejection of null hypothesis:

One sample test test - One tailed t test rejection region

Calculating T-Statistics, Critical Value, P-Value using Python

Calculating the t-statistic, critical value, and p-value is central to this test, providing evidence to support or refute hypotheses. Python, with its simplicity and the powerful scipy.stats library, offers a streamlined approach to these calculations. By learning Python code for these purposes, one can efficiently automate the iterative process of hypothesis testing, reduce the potential for manual errors, and focus more on interpreting results rather than getting bogged down in calculations.

The following python code helps you calculate standard error and t-statistics value as 0.75 and 5.33 respectively.

The following gets printed:

Standard Error : 0.75 T-statistic : 5.333333333333333 P-value for one-tailed test : 4.1794868572493856e-05

The following Python code helps calculate critical value:

The critical t-value comes out to be ~1.753. The t-statistics is much larger than this. This is why we can reject the null hypothesis.

Check out our one-sample t-test calculator tool .

T-score / T-statistics for Estimating Population Mean

The population mean can be estimated as a function of the t-score using the following equation:

Population mean = Sample mean + T*( Standard error of the mean)

Where T is a statistic that has a T-distribution with known properties. The standard error of the mean (SE) is an estimate of the standard deviation of the sampling distribution of the t-statistic. The T-statistic can be used to calculate confidence intervals for population means given the sample size is small and the population standard deviation is unknown. When the population standard deviation is know, we use Z-statistics and Z-distribution instead of T-statistics.

The value of standard error of the mean can be calculated as :

SE of the mean = S/√n

Where, S is the standard deviation of the sample and n is the number of observations in the sample.

The one-sample t-test is a statistical test that can be used to determine whether there is a significant difference between the sample mean and the population mean. The t-test statistic (T) follows a t-distribution with n – 1 degrees of freedom, where n is the number of observations in the sample. T-statistics can be used to estimate the population mean when the population standard deviation is unknown. The t-test can be used to calculate confidence intervals for population means when the sample size is small and the population standard deviation is unknown.

Recent Posts

Ajitesh Kumar

  • Completion Model vs Chat Model: Python Examples - June 30, 2024
  • LLM Hosting Strategy, Options & Cost: Examples - June 30, 2024
  • Application Architecture for LLM Applications: Examples - June 25, 2024

Ajitesh Kumar

5 responses.

Question: In the One-sample T-test example wouldn’t the hypotheses as stated denote a two-tailed test? Therefore the critical value would be 2.131

Null hypothesis, H0: There is no difference between the sample mean and the population mean. Thus H0 x-bar = u

Alternate hypothesis, Ha: There is a significant difference between the sample mean and the population mean. Thus H0 x-bar u

If the alternate hypothesis, Ha was stated differently such as: There is a significant positive difference between the sample mean and the population mean. Thus H0 x-bar > u; denoting a right hand one-tailed test then the critical value would be 1.75. [1] I will note that in either case the 5.33 value does exceed the critical values both the one-tailed and two-tailed.

Thanks, Dave

Source: [1] https://www.nipissingu.ca/sites/default/files/One-tailed-Test-or-Two-tailed-Test.pdf

You are correct in pointing out that the hypotheses mentioned in the example denote a two-tailed test, which tests for the possibility of the sample mean being significantly greater or less than the hypothesized population mean.

For a two-tailed test with α = 0.05 and 15 degrees of freedom (n-1), the critical t-value is approximately 2.131. This value will reject the null hypothesis if the calculated t-statistic is either less than -2.131 or greater than 2.131. Since 5.33 is greater than 2.131, we can reject the null hypothesis.

Made the appropriate changes.

Hello. May I ask, the problem states that that the average number of days on vacation is more than or equal to 16, so shouldn’t that mean that µ≥5 is the null hypothesis while the alternative hypothesis is µ<5?

Please answer speedily. God bless and thanks!

As the claim is made about average number of days spent on vacation is greater than or equal to 5 days, we are talking about establishing a new truth such as µ≥5. The null hypothesis would rather be µ<5. Read my post on hypothesis testing for more details ( https://vitalflux.com/data-science-how-to-formulate-hypothesis-for-hypothesis-testing/ )

[…] test is a non-parametric test which is often seen as a cousin to the one-sample t-test, allows us to infer information about a whole population based on a small, paired sample. It is […]

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

  • Search for:
  • Excellence Awaits: IITs, NITs & IIITs Journey

ChatGPT Prompts (250+)

  • Generate Design Ideas for App
  • Expand Feature Set of App
  • Create a User Journey Map for App
  • Generate Visual Design Ideas for App
  • Generate a List of Competitors for App
  • Completion Model vs Chat Model: Python Examples
  • LLM Hosting Strategy, Options & Cost: Examples
  • Application Architecture for LLM Applications: Examples
  • Python Pickle Security Issues / Risk
  • Pricing Analytics in Banking: Strategies, Examples

Data Science / AI Trends

  • • Prepend any arxiv.org link with talk2 to load the paper into a responsive chat application
  • • Custom LLM and AI Agents (RAG) On Structured + Unstructured Data - AI Brain For Your Organization
  • • Guides, papers, lecture, notebooks and resources for prompt engineering
  • • Common tricks to make LLMs efficient and stable
  • • Machine learning in finance

Free Online Tools

  • Create Scatter Plots Online for your Excel Data
  • Histogram / Frequency Distribution Creation Tool
  • Online Pie Chart Maker Tool
  • Z-test vs T-test Decision Tool
  • Independent samples t-test calculator

Recent Comments

I found it very helpful. However the differences are not too understandable for me

Very Nice Explaination. Thankyiu very much,

in your case E respresent Member or Oraganization which include on e or more peers?

Such a informative post. Keep it up

Thank you....for your support. you given a good solution for me.

An open portfolio of interoperable, industry leading products

The Dotmatics digital science platform provides the first true end-to-end solution for scientific R&D, combining an enterprise data platform with the most widely used applications for data analysis, biologics, flow cytometry, chemicals innovation, and more.

one sample hypothesis test formula

Statistical analysis and graphing software for scientists

Bioinformatics, cloning, and antibody discovery software

Plan, visualize, & document core molecular biology procedures

Electronic Lab Notebook to organize, search and share data

Proteomics software for analysis of mass spec data

Modern cytometry analysis platform

Analysis, statistics, graphing and reporting of flow cytometry data

Software to optimize designs of clinical trials

POPULAR USE CASES

  • One sample t test

A one sample t test compares the mean with a hypothetical value. In most cases, the hypothetical value comes from theory. For example, if you express your data as 'percent of control', you can test whether the average differs significantly from 100. The hypothetical value can also come from previous data. For example, compare whether the mean systolic blood pressure differs from 135, a value determined in a previous study.

1. Choose data entry format

Caution: Changing format will erase your data.

2. Specify the hypothetical mean value

3. enter data, 4. view the results, learn more about the one sample t test.

In this article you will learn the requirements and assumptions of a one sample t test, how to format and interpret the results of a one sample t test, and when to use different types of t tests.

One sample t test: Overview

The one sample t test, also referred to as a single sample t test, is a statistical hypothesis test used to determine whether the mean calculated from sample data collected from a single group is different from a designated value specified by the researcher. This designated value does not come from the data itself, but is an external value chosen for scientific reasons. Often, this designated value is a mean previously established in a population, a standard value of interest, or a mean concluded from other studies. Like all hypothesis testing, the one sample t test determines if there is enough evidence reject the null hypothesis (H0) in favor of an alternative hypothesis (H1). The null hypothesis for a one sample t test can be stated as: "The population mean equals the specified mean value." The alternative hypothesis for a one sample t test can be stated as: "The population mean is different from the specified mean value."

Single sample t test

The one sample t test differs from most statistical hypothesis tests because it does not compare two separate groups or look at a relationship between two variables. It is a straightforward comparison between data gathered on a single variable from one population and a specified value defined by the researcher. The one sample t test can be used to look for a difference in only one direction from the standard value (a one-tailed t test ) or can be used to look for a difference in either direction from the standard value (a two-tailed t test ).

Requirements and Assumptions for a one sample t test

A one sample t test should be used only when data has been collected on one variable for a single population and there is no comparison being made between groups. For a valid one sample t test analysis, data values must be all of the following:

The one sample t test assumes that all "errors" in the data are independent. The term "error" refers to the difference between each value and the group mean. The results of a t test only make sense when the scatter is random - that whatever factor caused a value to be too high or too low affects only that one value. Prism cannot test this assumption, but there are graphical ways to explore data to verify this assumption is met.

A t test is only appropriate to apply in situations where data represent variables that are continuous measurements. As they rely on the calculation of a mean value, variables that are categorical should not be analyzed using a t test.

The results of a t test should be based on a random sample and only be generalized to the larger population from which samples were drawn.

As with all parametric hypothesis testing, the one sample t test assumes that you have sampled your data from a population that follows a normal (or Gaussian) distribution. While this assumption is not as important with large samples, it is important with small sample sizes, especially less than 10. If your data do not come from a Gaussian distribution , there are three options to accommodate this. One option is to transform the values to make the distribution more Gaussian, perhaps by transforming all values to their reciprocals or logarithms. Another choice is to use the Wilcoxon signed rank nonparametric test instead of the t test. A final option is to use the t test anyway, knowing that the t test is fairly robust to departures from a Gaussian distribution with large samples.

How to format a one sample t test

Ideally, data for a one sample t test should be collected and entered as a single column from which a mean value can be easily calculated. If data is entered on a table with multiple subcolumns, Prism requires one of the following choices to be selected to perform the analysis:

  • Each subcolumn of data can be analyzed separately
  • An average of the values in the columns across each row can be calculated, and the analysis conducted on this new stack of means, or
  • All values in all columns can be treated as one sample of data (paying no attention to which row or column any values are in).

How the one sample t test calculator works

Prism calculates the t ratio by dividing the difference between the actual and hypothetical means by the standard error of the actual mean. The equation is written as follows, where x is the calculated mean, μ is the hypothetical mean (specified value), S is the standard deviation of the sample, and n is the sample size:

t test ratio

A p value is computed based on the calculated t ratio and the numbers of degrees of freedom present (which equals sample size minus 1). The one sample t test calculator assumes it is a two-tailed one sample t test, meaning you are testing for a difference in either direction from the specified value.

How to interpret results of a one sample t test

As discussed, a one sample t test compares the mean of a single column of numbers against a hypothetical mean. This hypothetical mean can be based upon a specific standard or other external prediction. The test produces a P value which requires careful interpretation.

The p value answers this question: If the data were sampled from a Gaussian population with a mean equal to the hypothetical value you entered, what is the chance of randomly selecting N data points and finding a mean as far (or further) from the hypothetical value as observed here?

If the p value is large (usually defined to mean greater than 0.05), the data do not give you any reason to conclude that the population mean differs from the designated value to which it has been compared. This is not the same as saying that the true mean equals the hypothetical value, but rather states that there is no evidence of a difference. Thus, we cannot reject the null hypothesis (H0).

If the p value is small (usually defined to mean less than or equal to 0.05), then it is unlikely that the discrepancy observed between the sample mean and hypothetical mean is due to a coincidence arising from random sampling. There is evidence to reject the idea that the difference is coincidental and conclude instead that the population has a mean that is different from the hypothetical value to which it has been compared. The difference is statistically significant, and the null hypothesis is therefore rejected.

If the null hypothesis is rejected, the question of whether the difference is scientifically important still remains. The confidence interval can be a useful tool in answering this question. Prism reports the 95% confidence interval for the difference between the actual and hypothetical mean. In interpreting these results, one can be 95% sure that this range includes the true difference. It requires scientific judgment to determine if this difference is truly meaningful.

Performing t tests? We can help.

Sign up for more information on how to perform t tests and other common statistical analyses.

When to use different types of t tests

There are three types of t tests which can be used for hypothesis testing:

  • Independent two-sample (or unpaired) t test
  • Paired sample t test

As described, a one sample t test should be used only when data has been collected on one variable for a single population and there is no comparison being made between groups. It only applies when the mean value for data is intended to be compared to a fixed and defined number.

In most cases involving data analysis, however, there are multiple groups of data either representing different populations being compared, or the same population being compared at different times or conditions. For these situations, it is not appropriate to use a one sample t test. Other types of t tests are appropriate for these specific circumstances:

Independent Two-Sample t test (Unpaired t test)

The independent sample t test, also referred to as the unpaired t test, is used to compare the means of two different samples. The independent two-sample t test comes in two different forms:

  • the standard Student's t test, which assumes that the variance of the two groups are equal.
  • the Welch's t test , which is less restrictive compared to the original Student's test. This is the test where you do not assume that the variance is the same in the two groups, which results in fractional degrees of freedom.

The two methods give very similar results when the sample sizes are equal and the variances are similar.

Paired Sample t test

The paired sample t test is used to compare the means of two related groups of samples. Put into other words, it is used in a situation where you have two values (i.e., a pair of values) for the same group of samples. Often these two values are measured from the same samples either at two different times, under two different conditions, or after a specific intervention.

You can perform multiple independent two-sample comparison tests simultaneously in Prism. Select from parametric and nonparametric tests and specify if the data are unpaired or paired. Try performing a t test with a 30-day free trial of Prism .

Watch this video to learn how to choose between a paired and unpaired t test.

Example of how to apply the appropriate t test

"Alkaline" labeled bottled drinking water has become fashionable over the past several years. Imagine we have collected a random sample of 30 bottles of "alkaline" drinking water from a number of different stores to represent the population of "alkaline" bottled water for a particular brand available to the general consumer. The labels on each of the bottles claim that the pH of the "alkaline" water is 8.5. A laboratory then proceeds to measure the exact pH of the water in each bottle.

Table 1: pH of water in random sample of "alkaline bottled water"

If you look at the table above, you see that some bottles have a pH measured to be lower than 8.5, while other bottles have a pH measured to be higher. What can the data tell us about the actual pH levels found in this brand of "alkaline" water bottles marketed to the public as having a pH of 8.5? Statistical hypothesis testing provides a sound method to evaluate this question. Which specific test to use, however, depends on the specific question being asked.

Is a t test appropriate to apply to this data?

Let's start by asking: Is a t test an appropriate method to analyze this set of pH data? The following list reviews the requirements and assumptions for using a t test:

  • Independent sampling : In an independent sample t test, the data values are independent. The pH of one bottle of water does not depend on the pH of any other water bottle. (An example of dependent values would be if you collected water bottles from a single production lot. A sample from a single lot is representative only of that lot, not of alkaline bottled water in general).
  • Continuous variable : The data values are pH levels, which are numerical measurements that are continuous.
  • Random sample : We assume the water bottles are a simple random sample from the population of "alkaline" water bottles produced by this brand as they are a mix of many production lots.
  • Normal distribution : We assume the population from which we collected our samples has pH levels that are normally distributed. To verify this, we should visualize the data graphically. The figure below shows a histogram for the pH measurements of the water bottles. From a quick look at the histogram, we see that there are no unusual points, or outliers. The data look roughly bell-shaped, so our assumption of a normal distribution seems reasonable. The QQ plot can also be used to graphically assess normality and is the preferred choice when the sample size is small.

QQplot ph measurements

Based upon these features and assumptions being met, we can conclude that a t test is an appropriate method to be applied to this set of data.

Which t test is appropriate to use?

The next decision is which t test to apply, and this depends on the exact question we would like our analysis to answer. This example illustrates how each type of t test could be chosen for a specific analysis, and why the one sample t test is the correct choice to determine if the measured pH of the bottled water samples match the advertised pH of 8.5.

We could be interested in determining whether a certain characteristic of a water bottle is associated with having a higher or lower pH, such as whether bottles are glass or plastic. For this questions, we would effectively be dividing the bottles into 2 separate groups and comparing the means of the pH between the 2 groups. For this analysis, we would elect to use a two sample t test because we are comparing the means of two independent groups.

We could also be interested in learning if pH is affected by a water bottle being opened and exposed to the air for a week. In this case, each original sample would be tested for pH level after a week had elapsed and the water had been exposed to the air, creating a second set of sample data. To evaluate whether this exposure affected pH, we would again be comparing two different groups of data, but this time the data are in paired samples each having an original pH measurement and a second measurement from after the week of exposure to the open air. For this analysis, it is appropriate to use a paired t test so that data for each bottle is assembled in rows, and the change in pH is considered bottle by bottle.

Returning to the original question we set out to answer-whether bottled water that is advertised to have a pH of 8.5 actually meets this claim-it is now clear that neither an independent two sample t test or a paired t test would be appropriate. In this case, all 30 pH measurements are sampled from one group representing bottled drinking water labeled "alkaline" available to the general consumer. We wish to compare this measured mean with an expected advertised value of 8.5. This is the exact situation for which one should employ a one sample t test!

From a quick look at the descriptive statistics, we see that the mean of the sample measurements is 8.513, slightly above 8.5. Does this average from our sample of 30 bottles validate the advertised claim of pH 8.5? By applying Prism's one sample t test analysis to this data set, we will get results by which we can evaluate whether the null hypothesis (that there is no difference between the mean pH level in the water bottles and the pH level advertised on the bottles) should be accepted or rejected.

How to Perform a One Sample T Test in Prism

In prior versions of Prism, the one sample t test and the Wilcoxon rank sum tests were computed as part of Prism's Column Statistics analysis. Now, starting with Prism 8, performing one sample t tests is even easier with a separate analysis in Prism.

Steps to perform a one sample t test in Prism

  • Create a Column data table.
  • Enter each data set in a single Y column so all values from each group are stacked into a column. Prism will perform a one sample t test (or Wilcoxon rank sum test) on each column you enter.
  • Click Analyze, look in the list of Column analyses, and choose one sample t test and Wilcoxon test.

It's that simple! Prism streamlines your t test analysis so you can make more accurate and more informed data interpretations. Start your 30-day free trial of Prism and try performing your first one sample t test in Prism.

Watch this video for a step-by-step tutorial on how to perform a t test in Prism.

We Recommend:

Analyze, graph and present your scientific work easily with GraphPad Prism. No coding required.

Have a language expert improve your writing

Run a free plagiarism check in 10 minutes, generate accurate citations for free.

  • Knowledge Base

Hypothesis Testing | A Step-by-Step Guide with Easy Examples

Published on November 8, 2019 by Rebecca Bevans . Revised on June 22, 2023.

Hypothesis testing is a formal procedure for investigating our ideas about the world using statistics . It is most often used by scientists to test specific predictions, called hypotheses, that arise from theories.

There are 5 main steps in hypothesis testing:

  • State your research hypothesis as a null hypothesis and alternate hypothesis (H o ) and (H a  or H 1 ).
  • Collect data in a way designed to test the hypothesis.
  • Perform an appropriate statistical test .
  • Decide whether to reject or fail to reject your null hypothesis.
  • Present the findings in your results and discussion section.

Though the specific details might vary, the procedure you will use when testing a hypothesis will always follow some version of these steps.

Table of contents

Step 1: state your null and alternate hypothesis, step 2: collect data, step 3: perform a statistical test, step 4: decide whether to reject or fail to reject your null hypothesis, step 5: present your findings, other interesting articles, frequently asked questions about hypothesis testing.

After developing your initial research hypothesis (the prediction that you want to investigate), it is important to restate it as a null (H o ) and alternate (H a ) hypothesis so that you can test it mathematically.

The alternate hypothesis is usually your initial hypothesis that predicts a relationship between variables. The null hypothesis is a prediction of no relationship between the variables you are interested in.

  • H 0 : Men are, on average, not taller than women. H a : Men are, on average, taller than women.

Receive feedback on language, structure, and formatting

Professional editors proofread and edit your paper by focusing on:

  • Academic style
  • Vague sentences
  • Style consistency

See an example

one sample hypothesis test formula

For a statistical test to be valid , it is important to perform sampling and collect data in a way that is designed to test your hypothesis. If your data are not representative, then you cannot make statistical inferences about the population you are interested in.

There are a variety of statistical tests available, but they are all based on the comparison of within-group variance (how spread out the data is within a category) versus between-group variance (how different the categories are from one another).

If the between-group variance is large enough that there is little or no overlap between groups, then your statistical test will reflect that by showing a low p -value . This means it is unlikely that the differences between these groups came about by chance.

Alternatively, if there is high within-group variance and low between-group variance, then your statistical test will reflect that with a high p -value. This means it is likely that any difference you measure between groups is due to chance.

Your choice of statistical test will be based on the type of variables and the level of measurement of your collected data .

  • an estimate of the difference in average height between the two groups.
  • a p -value showing how likely you are to see this difference if the null hypothesis of no difference is true.

Based on the outcome of your statistical test, you will have to decide whether to reject or fail to reject your null hypothesis.

In most cases you will use the p -value generated by your statistical test to guide your decision. And in most cases, your predetermined level of significance for rejecting the null hypothesis will be 0.05 – that is, when there is a less than 5% chance that you would see these results if the null hypothesis were true.

In some cases, researchers choose a more conservative level of significance, such as 0.01 (1%). This minimizes the risk of incorrectly rejecting the null hypothesis ( Type I error ).

Here's why students love Scribbr's proofreading services

Discover proofreading & editing

The results of hypothesis testing will be presented in the results and discussion sections of your research paper , dissertation or thesis .

In the results section you should give a brief summary of the data and a summary of the results of your statistical test (for example, the estimated difference between group means and associated p -value). In the discussion , you can discuss whether your initial hypothesis was supported by your results or not.

In the formal language of hypothesis testing, we talk about rejecting or failing to reject the null hypothesis. You will probably be asked to do this in your statistics assignments.

However, when presenting research results in academic papers we rarely talk this way. Instead, we go back to our alternate hypothesis (in this case, the hypothesis that men are on average taller than women) and state whether the result of our test did or did not support the alternate hypothesis.

If your null hypothesis was rejected, this result is interpreted as “supported the alternate hypothesis.”

These are superficial differences; you can see that they mean the same thing.

You might notice that we don’t say that we reject or fail to reject the alternate hypothesis . This is because hypothesis testing is not designed to prove or disprove anything. It is only designed to test whether a pattern we measure could have arisen spuriously, or by chance.

If we reject the null hypothesis based on our research (i.e., we find that it is unlikely that the pattern arose by chance), then we can say our test lends support to our hypothesis . But if the pattern does not pass our decision rule, meaning that it could have arisen by chance, then we say the test is inconsistent with our hypothesis .

If you want to know more about statistics , methodology , or research bias , make sure to check out some of our other articles with explanations and examples.

  • Normal distribution
  • Descriptive statistics
  • Measures of central tendency
  • Correlation coefficient

Methodology

  • Cluster sampling
  • Stratified sampling
  • Types of interviews
  • Cohort study
  • Thematic analysis

Research bias

  • Implicit bias
  • Cognitive bias
  • Survivorship bias
  • Availability heuristic
  • Nonresponse bias
  • Regression to the mean

Hypothesis testing is a formal procedure for investigating our ideas about the world using statistics. It is used by scientists to test specific predictions, called hypotheses , by calculating how likely it is that a pattern or relationship between variables could have arisen by chance.

A hypothesis states your predictions about what your research will find. It is a tentative answer to your research question that has not yet been tested. For some research projects, you might have to write several hypotheses that address different aspects of your research question.

A hypothesis is not just a guess — it should be based on existing theories and knowledge. It also has to be testable, which means you can support or refute it through scientific research methods (such as experiments, observations and statistical analysis of data).

Null and alternative hypotheses are used in statistical hypothesis testing . The null hypothesis of a test always predicts no effect or no relationship between variables, while the alternative hypothesis states your research prediction of an effect or relationship.

Cite this Scribbr article

If you want to cite this source, you can copy and paste the citation or click the “Cite this Scribbr article” button to automatically add the citation to our free Citation Generator.

Bevans, R. (2023, June 22). Hypothesis Testing | A Step-by-Step Guide with Easy Examples. Scribbr. Retrieved July 30, 2024, from https://www.scribbr.com/statistics/hypothesis-testing/

Is this article helpful?

Rebecca Bevans

Rebecca Bevans

Other students also liked, choosing the right statistical test | types & examples, understanding p values | definition and examples, what is your plagiarism score.

  • Skip to secondary menu
  • Skip to main content
  • Skip to primary sidebar

Statistics By Jim

Making statistics intuitive

Test Statistic: Definition, Types & Formulas

By Jim Frost 10 Comments

What is a Test Statistic?

A test statistic assesses how consistent your sample data are with the null hypothesis in a hypothesis test. Test statistic calculations take your sample data and boil them down to a single number that quantifies how much your sample diverges from the null hypothesis. As a test statistic value becomes more extreme, it indicates larger differences between your sample data and the null hypothesis.

When your test statistic indicates a sufficiently large incompatibility with the null hypothesis, you can reject the null and state that your results are statistically significant—your data support the notion that the sample effect exists in the population . To use a test statistic to evaluate statistical significance, you either compare it to a critical value or use it to calculate the p-value .

Statisticians named the hypothesis tests after the test statistics because they’re the quantity that the tests actually evaluate. For example, t-tests assess t-values, F-tests evaluate F-values, and chi-square tests use, you guessed it, chi-square values.

In this post, learn about test statistics, how to calculate them, interpret them, and evaluate statistical significance using the critical value and p-value methods.

How to Find Test Statistics

Each test statistic has its own formula. I present several common test statistics examples below. To see worked examples for each one, click the links to my more detailed articles.

Formulas for Test Statistics

T-value for 1-sample t-test Take the sample mean, subtract the hypothesized mean, and divide by the .
T-value for 2-sample t-test Take one sample mean, subtract the other, and divide by the pooled standard deviation.
F-value for F-tests and ANOVA Calculate the ratio of two .
Chi-squared value (χ ) for a Chi-squared test Sum the squared differences between observed and expected values divided by the expected values.

Understanding the Null Values and the Test Statistic Formulas

In the formulas above, it’s helpful to understand the null condition and the test statistic value that occurs when your sample data match that condition exactly. Also, it’s worthwhile knowing what causes the test statistics to move further away from the null value, potentially becoming significant. Test statistics are statistically significant when they exceed a critical value.

All these test statistics are ratios, which helps you understand their null values.

T-Tests, Null = 0

When a t-value equals 0, it indicates that your sample data match the null hypothesis exactly.

For a 1-sample t-test, when the sample mean equals the hypothesized mean, the numerator is zero, which causes the entire t-value ratio to equal zero. As the sample mean moves away from the hypothesized mean in either the positive or negative direction, the test statistic moves away from zero in the same direction.

A similar case exists for 2-sample t-tests. When the two sample means are equal, the numerator is zero, and the entire test statistic ratio is zero. As the two sample means become increasingly different, the absolute value of the numerator increases, and the t-value becomes more positive or negative.

Related post : How T-tests Work

F-tests including ANOVA, Null = 1

When an F-value equals 1, it indicates that the two variances in the numerator and denominator are equal, matching the null hypothesis.

As the numerator and denominator become less and less similar, the F-value moves away from one in either direction.

Related post : The F-test in ANOVA

Chi-squared Tests, Null = 0

When a chi-squared value equals 0, it indicates that the observed values always match the expected values. This condition causes the numerator to equal zero, making the chi-squared value equal zero.

As the observed values progressively fail to match the expected values, the numerator increases, causing the test statistic to rise from zero.

Related post : How a Chi-Squared Test Works

You’ll never see a test statistic that equals the null value precisely in practice. However, trivial differences been sample values and the null value are not uncommon.

Interpreting Test Statistics

Test statistics are unitless. This fact can make them difficult to interpret on their own. You know they evaluate how well your data agree with the null hypothesis. If your test statistic is extreme enough, your data are so incompatible with the null hypothesis that you can reject it and conclude that your results are statistically significant. But how does that translate to specific values of your test statistic? Where do you draw the line?

For instance, t-values of zero match the null value. But how far from zero should your t-value be to be statistically significant? Is 1 enough? 2? 3? If your t-value is 2, what does it mean anyway? In this case, we know that the sample mean doesn’t equal the null value, but how exceptional is it? To complicate matters, the dividing line changes depending on your sample size and other study design issues.

Similar types of questions apply to the other test statistics too.

To interpret individual values of a test statistic, we need to place them in a larger context. Towards this end, let me introduce you to sampling distributions for test statistics!

Sampling Distributions for Test Statistics

Performing a hypothesis test on a sample produces a single test statistic. Now, imagine you carry out the following process:

  • Assume the null hypothesis is true in the population.
  • Repeat your study many times by drawing many random samples of the same size from this population.
  • Perform the same hypothesis test on all these samples and save the test statistics.
  • Plot the distribution of the test statistics.

This process produces the distribution of test statistic values that occurs when the effect does not exist in the population (i.e., the null hypothesis is true). Statisticians refer to this type of distribution as a sampling distribution, a kind of probability distribution.

Why would we need this type of distribution?

It provides the larger context required for interpreting a test statistic. More specifically, it allows us to compare our study’s single test statistic to values likely to occur when the null is true. We can quantify our sample statistic’s rareness while assuming the effect does not exist in the population. Now that’s helpful!

Fortunately, we don’t need to collect many random samples to create this distribution! Statisticians have developed formulas allowing us to estimate sampling distributions for test statistics using the sample data.

To evaluate your data’s compatibility with the null hypothesis, place your study’s test statistic in the distribution.

Related post : Understanding Probability Distributions

Example of a Test Statistic in a Sampling Distribution

Suppose our t-test produces a t-value of two. That’s our test statistic. Let’s see where it fits in.

The sampling distribution below shows a t-distribution with 20 degrees of freedom, equating to a 1-sample t-test with a sample size of 21. The distribution centers on zero because it assumes the null hypothesis is correct. When the null is true, your analysis is most likely to obtain a t-value near zero and less likely to produce t-values further from zero in either direction.

Sampling distribution for the t-value test statistic.

The sampling distribution indicates that our test statistic is somewhat rare when we assume the null hypothesis is correct. However, the chances of observing t-values from -2 to +2 are not totally inconceivable. We need a way to quantify the likelihood.

From this point, we need to use the sampling distributions’ ability to calculate probabilities for test statistics.

Related post : Sampling Distributions Explained

Test Statistics and Critical Values

The significance level uses critical values to define how far the test statistic must be from the null value to reject the null hypothesis. When the test statistic exceeds a critical value, the results are statistically significant.

The percentage of the area beneath the sampling distribution curve that is shaded represents the probability that the test statistic will fall in those regions when the null is true. Consequently, to depict a significance level of 0.05, I’ll shade 5% of the sampling distribution furthest away from the null value.

The two shaded areas are equidistant from the null value in the center. Each region has a likelihood of 0.025, which sums to our significance level of 0.05. These shaded areas are the critical regions for a two-tailed hypothesis test. Let’s return to our example t-value of 2.

Related post : What are Critical Values?

Sampling distribution that displays the critical values for our t-value.

In this example, the critical values are -2.086 and +2.086. Our test statistic of 2 is not statistically significant because it does not exceed the critical value.

Other hypothesis tests have their own test statistics and sampling distributions, but their processes for critical values are generally similar.

Learn how to find critical values for test statistics using tables:

  • T-distribution table
  • Chi-square table

Related post : Understanding Significance Levels

Using Test Statistics to Find P-values

P-values are the probability of observing an effect at least as extreme as your sample’s effect if you assume no effect exists in the population.

Test statistics represent effect sizes in hypothesis tests because they denote the difference between your sample effect and no effect —the null hypothesis. Consequently, you use the test statistic to calculate the p-value for your hypothesis test.

The above p-value definition is a bit tortuous. Fortunately, it’s much easier to understand how test statistics and p-values work together using a sampling distribution graph.

Let’s use our hypothetical test statistic t-value of 2 for this example. However, because I’m displaying the results of a two-tailed test, I need to use t-values of +2 and -2 to cover both tails.

Related post : One-tailed vs. Two-Tailed Hypothesis Tests

The graph below displays the probability of t-values less than -2 and greater than +2 using the area under the curve. This graph is specific to our t-test design (1-sample t-test with N = 21).

Graph of t-distribution that displays the probability for a t-value of 2.

The sampling distribution indicates that each of the two shaded regions has a probability of 0.02963—for a total of 0.05926. That’s the p-value! The graph shows that the test statistic falls within these areas almost 6% of the time when the null hypothesis is true in the population.

While this likelihood seems small, it’s not low enough to justify rejecting the null under the standard significance level of 0.05. P-value results are always consistent with the critical value method. Learn more about using test statistics to find p values .

While test statistics are a crucial part of hypothesis testing, you’ll probably let your statistical software calculate the p-value for the test. However, understanding test statistics will boost your comprehension of what a hypothesis test actually assesses.

Related post : Interpreting P-values

Share this:

one sample hypothesis test formula

Reader Interactions

' src=

July 5, 2024 at 8:21 am

“As the observed values progressively fail to match the observed values, the numerator increases, causing the test statistic to rise from zero”.

Sir, this sentence is written in the Chi-squared Test heading. There the observed value is written twice. I think the second one to be replaced with ‘expected values’.

' src=

July 5, 2024 at 4:10 pm

Thanks so much, Dr. Raj. You’re correct about the typo and I’ve made the correction.

' src=

May 9, 2024 at 1:40 am

Thank you very much (great page on one and two-tailed tests)!

May 6, 2024 at 12:17 pm

I would like to ask a question. If only positive numbers are the possible values in a sample (e.g. absolute values without 0), is it meaningful to test if the sample is significantly different from zero (using for example a one sample t-test or a Wilcoxon signed-rank test) or can I assume that if given a large enough sample, the result will by definition be significant (even if a small or very variable sample results in a non-significant hypothesis test).

Thank you very much,

May 6, 2024 at 4:35 pm

If you’re talking about the raw values you’re assessing using a one-sample t-test, it doesn’t make sense to compare them to zero given your description of the data. You know that the mean can’t possibly equal zero. The mean must be some positive value. Yes, in this scenario, if you have a large enough sample size, you should get statistically significant results. So, that t-test isn’t tell you anything that you don’t already know!

However, you should be aware of several things. The 1-sample test can compare your sample mean to values other than zero. Typically, you’ll need to specify the value of the null hypothesis for your software. This value is the comparison value. The test determines whether your sample data provide enough evidence to conclude that the population mean does not equal the null hypothesis value you specify. You’ll need to specify the value because there is no obvious default value to use. Every 1-sample t-test has its subject-area context with a value that makes sense for its null hypothesis value and it is frequently not zero.

I suspect that you’re getting tripped up with the fact that t-tests use a t-value of zero for its null hypothesis value. That doesn’t mean your 1-sample t-test is comparing your sample mean to zero. The test converts your data to a single t-value and compares the t-value to zero. But your actual null hypothesis value can be something else. It’s just converting your sample to a standardized value to use for testing. So, while the t-test compares your sample’s t-value to zero, you can actually compare your sample mean to any value you specify. You need to use a value that makes sense for your subject area.

I hope that makes sense!

May 8, 2024 at 8:37 am

Thank you very much Jim, this helps a lot! Actually, the value I would like to compare my sample to is zero, but I just couldn’t find the right way to test it apparently (it’s about EEG data). The original data was a sample of numbers between -1 and +1, with the question if they are significantly different from zero in either direction (in which case a one sample t-test makes sense I guess, since the sample mean can in fact be zero). However, since a sample mean of 0 can also occur if half of the sample differs in the negative, and the other half in the positive direction, I also wanted to test if there is a divergence from 0 in ‘absolute’ terms – that’s how the absolute valued numbers came about (I know that absolute values can also be zero, but in this specific case, they were all positive numbers) And a special thanks for the last paragraph – I will definitely keep in mind, it is a potential point of confusion.

May 8, 2024 at 8:33 pm

You can use a 1-sample t test for both cases but you’ll need to set them up slightly different. To detect a positive or negative difference from zero, use a 2-tailed test. For the case with absolute values, use a one-tailed test with a critical region in the positive end. To learn more, read about One- and Two-Tailed Tests Explained . Use zero for the comparison value in both cases.

' src=

February 12, 2024 at 1:00 am

Very helpful and well articulated! Thanks Jim 🙂

' src=

September 18, 2023 at 10:01 am

Thank you for brief explanation.

' src=

July 25, 2022 at 8:32 am

the content was helpful to me. thank you

Comments and Questions Cancel reply

Back to blog home

Hypothesis testing explained in 4 parts, yuzheng sun, phd.

As data scientists, Hypothesis Testing is expected to be well understood, but often not in reality. It is mainly because our textbooks blend two schools of thought – p-value and significance testing vs. hypothesis testing – inconsistently.

For example, some questions are not obvious unless you have thought through them before:

Are power or beta dependent on the null hypothesis?

Can we accept the null hypothesis? Why?

How does MDE change with alpha holding beta constant?

Why do we use standard error in Hypothesis Testing but not the standard deviation?

Why can’t we be specific about the alternative hypothesis so we can properly model it?

Why is the fundamental tradeoff of the Hypothesis Testing about mistake vs. discovery, not about alpha vs. beta?

Addressing this problem is not easy. The topic of Hypothesis Testing is convoluted. In this article, there are 10 concepts that we will introduce incrementally, aid you with visualizations, and include intuitive explanations. After this article, you will have clear answers to the questions above that you truly understand on a first-principle level and explain these concepts well to your stakeholders.

We break this article into four parts.

Set up the question properly using core statistical concepts, and connect them to Hypothesis Testing, while striking a balance between technically correct and simplicity. Specifically, 

We emphasize a clear distinction between the standard deviation and the standard error, and why the latter is used in Hypothesis Testing

We explain fully when can you “accept” a hypothesis, when shall you say “failing to reject” instead of “accept”, and why

Introduce alpha, type I error, and the critical value with the null hypothesis

Introduce beta, type II error, and power with the alternative hypothesis

Introduce minimum detectable effects and the relationship between the factors with power calculations , with a high-level summary and practical recommendations

Part 1 - Hypothesis Testing, the central limit theorem, population, sample, standard deviation, and standard error

In Hypothesis Testing, we begin with a null hypothesis , which generally asserts that there is no effect between our treatment and control groups. Commonly, this is expressed as the difference in means between the treatment and control groups being zero.

The central limit theorem suggests an important property of this difference in means — given a sufficiently large sample size, the underlying distribution of this difference in means will approximate a normal distribution, regardless of the population's original distribution. There are two notes:

1. The distribution of the population for the treatment and control groups can vary, but the observed means (when you observe many samples and calculate many means) are always normally distributed with a large enough sample. Below is a chart, where the n=10 and n=30 correspond to the underlying distribution of the sample means.

Central Limit Theorem

2. Pay attention to “the underlying distribution”. Standard deviation vs. standard error is a potentially confusing concept. Let’s clarify.

Standard deviation vs. Standard error

Let’s declare our null hypothesis as having no treatment effect. Then, to simplify, let’s propose the following normal distribution with a mean of 0 and a standard deviation of 1 as the range of possible outcomes with probabilities associated with this null hypothesis.

Standard Deviation v Standard Error

The language around population, sample, group, and estimators can get confusing. Again, to simplify, let’s forget that the null hypothesis is about the mean estimator, and declare that we can either observe the mean hypothesis once or many times. When we observe it many times, it forms a sample*, and our goal is to make decisions based on this sample.

* For technical folks, the observation is actually about a single sample, many samples are a group, and the difference in groups is the distribution we are talking about as the mean hypothesis. The red curve represents the distribution of the estimator of this difference, and then we can have another sample consisting of many observations of this estimator. In my simplified language, the red curve is the distribution of the estimator, and the blue curve with sample size is the repeated observations of it. If you have a better way to express these concepts without causing confusiongs, please suggest.

This probability density function means if there is one realization from this distribution, the realitization can be anywhere on the x-axis, with the relative likelihood on the y-axis.

If we draw multiple observations , they form a sample . Each observation in this sample follows the property of this underlying distribution – more likely to be close to 0, and equally likely to be on either side, which makes the odds of positive and negative cancel each other out, so the mean of this sample is even more centered around 0.

We use the standard error to represent the error of our “sample mean” . 

The standard error = the standard deviation of the observed sample / sqrt (sample size). 

For a sample size of 30, the standard error is roughly 0.18. Compared with the underlying distribution, the distribution of the sample mean is much narrower.

Standard Deviation and Standard Error 2 Images

In Hypothesis Testing, we try to draw some conclusions – is there a treatment effect or not? – based on a sample. So when we talk about alpha and beta, which are the probabilities of type I and type II errors , we are talking about the probabilities based on the plot of sample means and standard error .

Part 2, The null hypothesis: alpha and the critical value

From Part 1, we stated that a null hypothesis is commonly expressed as the difference in means between the treatment and control groups being zero.

Without loss of generality*, let’s assume the underlying distribution of our null hypothesis is mean 0 and standard deviation 1

Then the sample mean of the null hypothesis is 0 and the standard error of 1/√ n, where n is the sample size.

When the sample size is 30, this distribution has a standard error of ≈0.18 looks like the below. 

Null Hypothesis YZ

*: A note for the technical readers: The null hypothesis is about the difference in means, but here, without complicating things, we made the subtle change to just draw the distribution of this “estimator of this difference in means”. Everything below speaks to this “estimator”.

The reason we have the null hypothesis is that we want to make judgments, particularly whether a  treatment effect exists. But in the world of probabilities, any observation, and any sample mean can happen, with different probabilities. So we need a decision rule to help us quantify our risk of making mistakes.

The decision rule is, let’s set a threshold. When the sample mean is above the threshold, we reject the null hypothesis; when the sample mean is below the threshold, we accept the null hypothesis.

Accepting a hypothesis vs. failing to reject a hypothesis

It’s worth noting that you may have heard of “we never accept a hypothesis, we just fail to reject a hypothesis” and be subconsciously confused by it. The deep reason is that modern textbooks do an inconsistent blend of Fisher’s significance testing and Neyman-Pearson’s Hypothesis Testing definitions and ignore important caveats ( ref ). To clarify:

First of all, we can never “prove” a particular hypothesis given any observations, because there are infinitely many true hypotheses (with different probabilities) given an observation. We will visualize it in Part 3.

Second, “accepting” a hypothesis does not mean that you believe in it, but only that you act as if it were true. So technically, there is no problem with “accepting” a hypothesis.

But, third, when we talk about p-values and confidence intervals, “accepting” the null hypothesis is at best confusing. The reason is that “the p-value above the threshold” just means we failed to reject the null hypothesis. In the strict Fisher’s p-value framework, there is no alternative hypothesis. While we have a clear criterion for rejecting the null hypothesis (p < alpha), we don't have a similar clear-cut criterion for "accepting" the null hypothesis based on beta.

So the dangers in calling “accepting a hypothesis” in the p-value setting are:

Many people misinterpret “accepting” the null hypothesis as “proving” the null hypothesis, which is wrong; 

“Accepting the null hypothesis” is not rigorously defined, and doesn’t speak to the purpose of the test, which is about whether or not we reject the null hypothesis. 

In this article, we will stay consistent within the Neyman-Pearson framework , where “accepting” a hypothesis is legal and necessary. Otherwise, we cannot draw any distributions without acting as if some hypothesis was true.

You don’t need to know the name Neyman-Pearson to understand anything, but pay attention to our language, as we choose our words very carefully to avoid mistakes and confusion.

So far, we have constructed a simple world of one hypothesis as the only truth, and a decision rule with two potential outcomes – one of the outcomes is “reject the null hypothesis when it is true” and the other outcome is “accept the null hypothesis when it is true”. The likelihoods of both outcomes come from the distribution where the null hypothesis is true.

Later, when we introduce the alternative hypothesis and MDE, we will gradually walk into the world of infinitely many alternative hypotheses and visualize why we cannot “prove” a hypothesis.

We save the distinction between the p-value/significance framework vs. Hypothesis Testing in another article where you will have the full picture.

Type I error, alpha, and the critical value

We’re able to construct a distribution of the sample mean for this null hypothesis using the standard error. Since we only have the null hypothesis as the truth of our universe, we can only make one type of mistake – falsely rejecting the null hypothesis when it is true. This is the type I error , and the probability is called alpha . Suppose we want alpha to be 5%. We can calculate the threshold required to make it happen. This threshold is called the critical value . Below is the chart we further constructed with our sample of 30.

Type I Error Alpha Critical Value

In this chart, alpha is the blue area under the curve. The critical value is 0.3. If our sample mean is above 0.3, we reject the null hypothesis. We have a 5% chance of making the type I error.

Type I error: Falsely rejecting the null hypothesis when the null hypothesis is true

Alpha: The probability of making a Type I error

Critical value: The threshold to determine whether the null hypothesis is to be rejected or not

Part 3, The alternative hypothesis: beta and power

You may have noticed in part 2 that we only spoke to Type I error – rejecting the null hypothesis when it is true. What about the Type II error – falsely accepting the null hypothesis when it is not true?

But it is weird to call “accepting” false unless we know the truth. So we need an alternative hypothesis which serves as the alternative truth. 

Alternative hypotheses are theoretical constructs

There is an important concept that most textbooks fail to emphasize – that is, you can have infinitely many alternative hypotheses for a given null hypothesis, we just choose one. None of them are more special or “real” than the others. 

Let’s visualize it with an example. Suppose we observed a sample mean of 0.51, what is the true alternative hypothesis?

Alternative hypotheses theoretical

With this visualization, you can see why we have “infinitely many alternative hypotheses” because, given the observation, there is an infinite number of alternative hypotheses (plus the null hypothesis) that can be true, each with different probabilities. Some are more likely than others, but all are possible.

Remember, alternative hypotheses are a theoretical construct. We choose one particular alternative hypothesis to calculate certain probabilities. By now, we should have more understanding of why we cannot “accept” the null hypothesis given an observation. We can’t prove that the null hypothesis is true, we just fail to accept it given the observation and our pre-determined decision rule. 

We will fully reconcile this idea of picking one alternative hypothesis out of the world of infinite possibilities when we talk about MDE. The idea of “accept” vs. “fail to reject” is deeper, and we won’t cover it fully in this article. We will do so when we have an article about the p-value and the confidence interval.

Type II error and Beta

For the sake of simplicity and easy comparison, let’s choose an alternative hypothesis with a mean of 0.5, and a standard deviation of

1. Again, with a sample size of 30, the standard error ≈0.18. There are now two potential “truths” in our simple universe.

Type II Error and Beta

Remember from the null hypothesis, we want alpha to be 5% so the corresponding critical value is 0.30. We modify our rule as follows:

If the observation is above 0.30, we reject the null hypothesis and accept the alternative hypothesis ; 

If the observation is below 0.30, we accept the null hypothesis and reject the alternative hypothesis .

Reject alternative and accept null

With the introduction of the alternative hypothesis, the alternative “(hypothesized) truth”, we can call “accepting the null hypothesis and rejecting the alternative hypothesis” a mistake – the Type II error. We can also calculate the probability of this mistake. This is called beta, which is illustrated by the red area below.

Null hypothesis alternative hypothesis

From the visualization, we can see that beta is conditional on the alternative hypothesis and the critical value. Let’s elaborate on these two relationships one by one, very explicitly, as both of them are important.

First, Let’s visualize how beta changes with the mean of the alternative hypothesis by setting another alternative hypothesis where mean = 1 instead of 0.5

Sample Size 30 for Null and Alternative Hypothesis

Beta change from 13.7% to 0.0%. Namely, beta is the probability of falsely rejecting a particular alternative hypothesis when we assume it is true. When we assume a different alternative hypothesis is true, we get a different beta. So strictly speaking, beta only speaks to the probability of falsely rejecting a particular alternative hypothesis when it is true . Nothing else. It’s only under other conditions, that “rejecting the alternative hypothesis” implies “accepting” the null hypothesis or “failing to accept the null hypothesis”. We will further elaborate when we talk about p-value and confidence interval in another article. But what we talked about so far is true and enough for understanding power.

Second, there is a relationship between alpha and beta. Namely, given the null hypothesis and the alternative hypothesis, alpha would determine the critical value, and the critical value determines beta. This speaks to the tradeoff between mistake and discovery. 

If we tolerate more alpha, we will have a smaller critical value, and for the same beta, we can detect a smaller alternative hypothesis

If we tolerate more beta, we can also detect a smaller alternative hypothesis. 

In short, if we tolerate more mistakes (either Type I or Type II), we can detect a smaller true effect. Mistake vs. discovery is the fundamental tradeoff of Hypothesis Testing.

So tolerating more mistakes leads to more chance of discovery. This is the concept of MDE that we will elaborate on in part 4.

Finally, we’re ready to define power. Power is an important and fundamental topic in statistical testing, and we’ll explain the concept in three different ways.

Three ways to understand power

First, the technical definition of power is 1−β. It represents that given an alternative hypothesis and given our null, sample size, and decision rule (alpha = 0.05), the probability is that we accept this particular hypothesis. We visualize the yellow area below.

Understand Power Hypothesis

Second, power is really intuitive in its definition. A real-world example is trying to determine the most popular car manufacturer in the world. If I observe one car and see one brand, my observation is not very powerful. But if I observe a million cars, my observation is very powerful. Powerful tests mean that I have a high chance of detecting a true effect.

Third, to illustrate the two concepts concisely, let’s run a visualization by just changing the sample size from 30 to 100 and see how power increases from 86.3% to almost 100%.

Same size from 30 to 100

As the graph shows, we can easily see that power increases with sample size . The reason is that the distribution of both the null hypothesis and the alternative hypothesis became narrower as their sample means got more accurate. We are less likely to make either a type I error (which reduces the critical value) or a type II error.  

Type II error: Failing to reject the null hypothesis when the alternative hypothesis is true

Beta: The probability of making a type II error

Power: The ability of the test to detect a true effect when it’s there

Part 4, Power calculation: MDE

The relationship between mde, alternative hypothesis, and power.

Now, we are ready to tackle the most nuanced definition of them all: Minimum detectable effect (MDE). First, let’s make the sample mean of the alternative hypothesis explicit on the graph with a red dotted line.

Relationship between MDE

What if we keep the same sample size, but want power to be 80%? This is when we recall the previous chapter that “alternative hypotheses are theoretical constructs”. We can have a different alternative that corresponds to 80% power. After some calculations, we discovered that when it’s the alternative hypothesis with mean = 0.45 (if we keep the standard deviation to be 1).

MDE Alternative Hypothesis pt 2

This is where we reconcile the concept of “infinitely many alternative hypotheses” with the concept of minimum detectable delta. Remember that in statistical testing, we want more power. The “ minimum ” in the “ minimum detectable effect”, is the minimum value of the mean of the alternative hypothesis that would give us 80% power. Any alternative hypothesis with a mean to the right of MDE gives us sufficient power.

In other words, there are indeed infinitely many alternative hypotheses to the right of this mean 0.45. The particular alternative hypothesis with a mean of 0.45 gives us the minimum value where power is sufficient. We call it the minimum detectable effect, or MDE.

Not enough power MDE

The complete definition of MDE from scratch

Let’s go through how we derived MDE from the beginning:

We fixed the distribution of sample means of the null hypothesis, and fixed sample size, so we can draw the blue distribution

For our decision rule, we require alpha to be 5%. We derived that the critical value shall be 0.30 to make 5% alpha happen

We fixed the alternative hypothesis to be normally distributed with a standard deviation of 1 so the standard error is 0.18, the mean can be anywhere as there are infinitely many alternative hypotheses

For our decision rule, we require beta to be 20% or less, so our power is 80% or more. 

We derived that the minimum value of the observed mean of the alternative hypothesis that we can detect with our decision rule is 0.45. Any value above 0.45 would give us sufficient power.

How MDE changes with sample size

Now, let’s tie everything together by increasing the sample size, holding alpha and beta constant, and see how MDE changes.

How MDE changes with sample size

Narrower distribution of the sample mean + holding alpha constant -> smaller critical value from 0.3 to 0.16

+ holding beta constant -> MDE decreases from 0.45 to 0.25

This is the other key takeaway:  The larger the sample size, the smaller of an effect we can detect, and the smaller the MDE.

This is a critical takeaway for statistical testing. It suggests that even for companies not with large sample sizes if their treatment effects are large, AB testing can reliably detect it.

Statistical Power Curve

Summary of Hypothesis Testing

Let’s review all the concepts together.

Assuming the null hypothesis is correct:

Alpha: When the null hypothesis is true, the probability of rejecting it

Critical value: The threshold to determine rejecting vs. accepting the null hypothesis

Assuming an alternative hypothesis is correct:

Beta: When the alternative hypothesis is true, the probability of rejecting it

Power: The chance that a real effect will produce significant results

Power calculation:

Minimum detectable effect (MDE): Given sample sizes and distributions, the minimum mean of alternative distribution that would give us the desired alpha and sufficient power (usually alpha = 0.05 and power >= 0.8)

Relationship among the factors, all else equal: Larger sample, more power; Larger sample, smaller MDE

Everything we talk about is under the Neyman-Pearson framework. There is no need to mention the p-value and significance under this framework. Blending the two frameworks is the inconsistency brought by our textbooks. Clarifying the inconsistency and correctly blending them are topics for another day.

Practical recommendations

That’s it. But it’s only the beginning. In practice, there are many crafts in using power well, for example:

Why peeking introduces a behavior bias, and how to use sequential testing to correct it

Why having multiple comparisons affects alpha, and how to use Bonferroni correction

The relationship between sample size, duration of the experiment, and allocation of the experiment?

Treat your allocation as a resource for experimentation, understand when interaction effects are okay, and when they are not okay, and how to use layers to manage

Practical considerations for setting an MDE

Also, in the above examples, we fixed the distribution, but in reality, the variance of the distribution plays an important role. There are different ways of calculating the variance and different ways to reduce variance, such as CUPED, or stratified sampling.

Related resources:

How to calculate power with an uneven split of sample size: https://blog.statsig.com/calculating-sample-sizes-for-a-b-tests-7854d56c2646

Real-life applications: https://blog.statsig.com/you-dont-need-large-sample-sizes-to-run-a-b-tests-6044823e9992

Create a free account

2m events per month, free forever..

Sign up for Statsig and launch your first experiment in minutes.

Build fast?

Try statsig today.

one sample hypothesis test formula

Recent Posts

Controlling your type i errors: bonferroni and benjamini-hochberg.

The Benjamini-Hochberg procedure on Statsig reduces false positives in experiments by adjusting significance levels for multiple comparisons, ensuring reliable results.

Top 8 common experimentation mistakes and how to fix them

I discussed 8 A/B testing mistakes with Allon Korem (Bell Statistics) and Tyler VanHaren (Statsig). Learn fixes to improve accuracy and drive better business outcomes.

Introducing Differential Impact Detection

Introducing Differential Impact Detection: Identify how different user groups respond to treatments and gain useful insights from varied experiment results.

Identifying and experimenting with Power Users using Statsig

Identify power users to drive growth and engagement. Learn to pinpoint and leverage these key players with targeted experiments for maximum impact.

How to Ingest Data Into Statsig

Simplify data pipelines with Statsig. Use SDKs, third-party integrations, and Data Warehouse Native Solution for effortless data ingestion at any stage.

A/B Testing performance wins on NestJS API servers

Learn how we use Statsig to enhance our NestJS API servers, reducing request processing time and CPU usage through performance experiments.

COMMENTS

  1. One Sample t-test: Definition, Formula, and Example

    Fortunately, a one sample t-test allows us to answer this question. One Sample t-test: Formula. A one-sample t-test always uses the following null hypothesis: H 0: μ = μ 0 (population mean is equal to some hypothesized value μ 0) The alternative hypothesis can be either two-tailed, left-tailed, or right-tailed:

  2. One Sample T Test: Definition, Using & Example

    One Sample T Test Hypotheses. A one sample t test has the following hypotheses: Null hypothesis (H 0): The population mean equals the hypothesized value (µ = H 0).; Alternative hypothesis (H A): The population mean does not equal the hypothesized value (µ ≠ H 0).; If the p-value is less than your significance level (e.g., 0.05), you can reject the null hypothesis.

  3. 8.2.3.1

    When testing hypotheses about a mean or mean difference, a \ (t\) distribution is used to find the \ (p\)-value. These \ (t\) distributions are indexed by a quantity called degrees of freedom, calculated as \ (df = n - 1\) for the situation involving a test of one mean or test of mean difference. The \ (p\)-value can be found using Minitab.

  4. One-Sample t-Test

    Figure 8: One-sample t-test results for energy bar data using JMP software. The software shows the null hypothesis value of 20 and the average and standard deviation from the data. The test statistic is 3.07. This matches the calculations above. The software shows results for a two-sided test and for one-sided tests.

  5. t-test Calculator

    Choose the type of t-test you wish to perform: A one-sample t-test (to test the mean of a single group against a hypothesized mean); A two-sample t-test (to compare the means for two groups); or. A paired t-test (to check how the mean from the same group changes after some intervention). Decide on the alternative hypothesis: Two-tailed; Left ...

  6. 8.2.3.1

    When testing hypotheses about a mean or mean difference, a \(t\) distribution is used to find the \(p\)-value. These \(t\) distributions are indexed by a quantity called degrees of freedom, calculated as \(df = n - 1\) for the situation involving a test of one mean or test of mean difference. The \(p\)-value can be found using Minitab.

  7. One Sample T Test: SPSS, By Hand, Step by Step

    Step 1: Write your null hypothesis statement ( How to state a null hypothesis ). The accepted hypothesis is that there is no difference in sales, so: H 0: μ = $100. Step 2: Write your alternate hypothesis. This is the one you're testing in the one sample t test. You think that there is a difference (that the mean sales increased), so:

  8. One Sample T Test

    Example: H0: Sample mean (x̅) = Hypothesized Population mean (µ) H1: Sample mean (x̅) != Hypothesized Population mean (µ) The alternate hypothesis can also state that the sample mean is greater than or less than the comparison mean. Step 2: Compute the test statistic (T) t = Z s = X ¯ - μ σ ^ n.

  9. T Test Overview: How to Use & Examples

    We'll use a two-sample t test to evaluate if the difference between the two group means is statistically significant. The t test output is below. In the output, you can see that the treatment group (Sample 1) has a mean of 109 while the control group's (Sample 2) average is 100. The p-value for the difference between the groups is 0.112.

  10. How t-Tests Work: 1-sample, 2-sample, and Paired t-Tests

    It's a simple calculation. In a 1-sample t-test, the sample effect is the sample mean minus the value of the null hypothesis. That's the top part of the equation. For example, if the sample mean is 20 and the null value is 5, the sample effect size is 15.

  11. One sample t-test • Simply explained

    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. The choice of which t-test to use depends on whether one or two samples are available.

  12. 5.3

    5.3 - Hypothesis Testing for One-Sample Mean. In the previous section, we learned how to perform a hypothesis test for one proportion. The concepts of hypothesis testing remain constant for any hypothesis test. In these next few sections, we will present the hypothesis test for one mean. We start with our knowledge of the sampling distribution ...

  13. One-Sample t-Test

    T1_TEST (R1, hyp, tails) = the p-value of the one-sample t-test for the data in array R1 based on the hypothetical mean hyp (default 0) where tails = 1 or 2 (default). For Example 2, the formula T1_TEST (A5:D14, 78, 2) will output the same value shown in cell Q56 of Figure 5, namely p-value = .000737.

  14. One Sample T Test (Easily Explained w/ 5+ Examples!)

    00:13:49 - Test the null hypothesis when population standard deviation is known (Example #2) 00:18:56 - Use a one-sample t-test to test a claim (Example #3) 00:26:50 - Conduct a hypothesis test and confidence interval when population standard deviation is unknown (Example #4) 00:37:16 - Conduct a hypothesis test by using a one-sample t ...

  15. An Introduction to the One Sample t-test

    The one 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.Suppose you are interested in determining whether an assembly line produces laptop computers that weigh five pounds. To test this hypothesis, you could collect a sample of laptop computers from the assembly line, measure their weights ...

  16. 8.3: Hypothesis Testing of Single Mean

    The \(p\)-value of a test of hypotheses for which the test statistic has Student's \(t\)-distribution can be computed using statistical software, but it is impractical to do so using tables, since that would require \(30\) tables analogous to Figure 7.1.5, one for each degree of freedom from \(1\) to \(30\).

  17. Hypothesis Testing with One Sample

    STEP 3: Calculate sample parameters and the test statistic. The sample parameters are provided, the sample mean is 7.91 and the sample variance is .03 and the sample size is 35. We need to note that the sample variance was provided not the sample standard deviation, which is what we need for the formula.

  18. Significance tests (hypothesis testing)

    Unit test. Significance tests give us a formal process for using sample data to evaluate the likelihood of some claim about a population value. Learn how to conduct significance tests and calculate p-values to see how likely a sample result is to occur by random chance. You'll also see how we use p-values to make conclusions about hypotheses.

  19. One Sample T-test: Formula & Examples

    We will use one-sample t-test to test this hypothesis. A one-tailed test will be performed. T = (X̄ - μ) / S/√n. Where, X̄ is the sample mean, μ is the hypothesized population mean, S is the standard deviation of the sample and n is the number of observations in the sample. A sample size of 16 persons is taken.

  20. One sample t test

    One sample t test: Overview. The one sample t test, also referred to as a single sample t test, is a statistical hypothesis test used to determine whether the mean calculated from sample data collected from a single group is different from a designated value specified by the researcher. This designated value does not come from the data itself ...

  21. Hypothesis Testing

    Though the specific details might vary, the procedure you will use when testing a hypothesis will always follow some version of these steps. Table of contents. Step 1: State your null and alternate hypothesis. Step 2: Collect data. Step 3: Perform a statistical test.

  22. Test Statistic: Definition, Types & Formulas

    A test statistic assesses how consistent your sample data are with the null hypothesis in a hypothesis test. Test statistic calculations take your sample data and boil them down to a single number that quantifies how much your sample diverges from the null hypothesis. As a test statistic value becomes more extreme, it indicates larger ...

  23. One Sample t-test Calculator

    A one sample t-test is used to test whether or not the mean of a population is equal to some value. To perform a one sample t-test, simply fill in the information below and then click the "Calculate" button. Enter raw data Enter summary data. 301, 298, 295, 297, 304, 305, 309, 298, 291, 299, 293, 304. μ0 (hypothesized population mean) t ...

  24. Hypothesis Testing explained in 4 parts

    Hypothesis Testing often confuses data scientists due to mixed teachings. This guide clarifies 10 key concepts with visuals and simple explanations for better understanding. ... It represents that given an alternative hypothesis and given our null, sample size, and decision rule (alpha = 0.05), the probability is that we accept this particular ...