A one-sample t-test is a statistical test used to compare the mean of a sample to a known population mean. It is used to test a hypothesis about the population mean and is based on the assumption that the sample is drawn from a normally distributed population.

## Steps in One Sample T Test

To conduct a one-sample t-test, the following steps are typically followed:

**Specify the null and alternative hypotheses.**The null hypothesis is usually that the population mean is equal to a specific value, while the alternative hypothesis is that the population mean is not equal to that value.**Select a sample**from the population and calculate the sample mean and standard deviation.**Calculate the test statistic,**which is the difference between the sample mean and the population mean, divided by the standard error of the mean.**Determine the critical value of the test statistic**based on the significance level (alpha) of the test and the degrees of freedom. The degrees of freedom are calculated as the sample size minus 1.**Compare the calculated test statistic to the critical value**to determine whether to reject or fail to reject the null hypothesis. If the calculated test statistic exceeds the critical value, the null hypothesis is rejected, and the alternative hypothesis is accepted.

## Conditions for T-Test

To conduct a valid t-test, the following conditions must be met:

- The sample must be drawn randomly from the population.
- Each observation in the sample must be independent of the others.
- The sampling must be done with replacement, OR
- If sampling without replacement, the sample size must be less than 10% of the population.

- The population distribution must approximate a normal distribution.
- The population standard deviation is unknown, and the sample size is small (less than 30).

## Typical Null and Alternate Hypothesis in one-sample T-test

**a) Two-Tail Test:** In a one-sample t-test, the null hypothesis is that there is no difference between the mean of the sample and the known population mean. This can be expressed as:

H0: μ = μ0

where μ is the mean of the sample and μ0 is the known population mean.

The alternate hypothesis is the opposite of the null hypothesis and is that there is a difference between the mean of the sample and the known population mean. This can be expressed as:

Ha: μ ≠ μ0

**b) Left Tail Test:** A left-tailed hypothesis is one in which the mean of the sample is less than the known population mean. This can be expressed as:

H0: μ >= μ0

Ha: μ < μ0

**c) Right Tail Test: **A right-tailed hypothesis is one in which the mean of the sample is greater than the known population mean. This can be expressed as:

H0: μ <= μ0

Ha: μ > μ0

## Calculating Test Statistic

The t-score represents the number of standard errors that the sample mean is from the population mean. It is used to determine whether the difference between the sample mean and the population mean is statistically significant. The formula for calculating the t-score in a one-sample t-test is as follows:

$$\LARGE{t = \frac{(\bar{x} - \mu)}{(s / \sqrt{n})}}$$

Where \(\bar{x}\) is the sample mean, \(\mu\) is the population mean, \(s\) is the sample standard deviation, and \(n\) is the sample size.

## Calculating Critical Values

The critical values for the t-score in a one-sample t-test depend on the degrees of freedom and the significance level of the test. The degrees of freedom are calculated as the sample size minus 1. Using these two values (significance level and degrees of freedom), you can find out the value of critical test statistic.

In addition, you can use Microsoft Excel (or other statistical software) to find out the critical value. In Excel, you can use =T.INV(probability, deg_freedom) for left tail value or =T.INV.2T(probability, deg_freedom) for two tail values.

For example, if you are performing a left-tail t-test with a 95% confidence level (that means the alpha value of 0.05) and in the experiment you had 4 samples (that means 3 degrees of freedom), you can use =T.INV.2T(0.05, 3) to find the critical value. That comes out to be - 3.1824. Since this is a two-tail test, the rejection area will be less than -3.18 or more than +3.18. We fail to reject the null hypothesis in the above example as the calculated value (+1.00) falls in the fail-to-reject area.