A hypothesis is an assumption of a scenario that is rejected or accepted based on the test result. There are two kinds of hypothesis testing method:

- Parametric test: variables are measured on an interval scale
- Non-parametric test: variables are measured on an ordinal scale

There are two types of tests in a parametric test – t-test, and z-test.

To a larger extent, both t-test and z-test are similar. Both are used to test a hypothesis to determine if there is a difference between two different population/sample groups. Let us first understand each of the tests. We later talk about when to use t-test and z-test, respectively.

**Basic Differences between t-test and z-test**

T-Test |
Z-Test |

A t-test analyses if the means of two datasets are different from each other when the standard deviation is unknown. | A z-test analyses if the means of two datasets are different from each other when the standard deviation is known. |

It is based on Student’s t-distribution. | It relies on the assumption that the sample means’ distribution is normal. |

When the data is plotted on a graph, it forms a symmetrical bell curve shape. However, the space is more in the tails and less in the center. | When the data is plotted on a graph, it forms a bell-curve shape which is symmetrical. |

Population variance is unknown. | Population variance is known. |

The sample size is small(n<30). The sample size should not be less than 5. | The sample size is large (n>30). |

**What is a t-test?**

A t-test is a kind of a univariate hypothesis test. It compares the mean of two samples. A t-test assumes a sample’s normal distribution. It determines if the means of the two data sets differ from one another. T-value is the result that we derive out of a t-test.

The formula for calculating a t-value is:

t=x-μs∕n

x = sample mean

= population mean

*s* = sample standard deviation

*n *= sample size

There are three kinds of t-tests that we can perform:

- One-sample t-test
- Independent two-sample t-test/ unpaired two-sample t-test
- Paired sample t-test

**When to use a t-test?**

- A T-test is conducted when the sample size is smaller than 30. The sample should not be lesser than 5.
- The data should be normally distributed, like in the case of a z-test. There is a slight difference in the bell curve.
- In the case of a t-test, the standard deviation of the population is assumed as unknown.
- A T-test is used when the data is assumed to be independent.
- We use a t-test when variance is homogeneous.
- We can perform a t-test when the sample sizes are equal.

**What is a z-test?**

A z-test is a statistical tool that is used in the case of a large sample size. It lets us check if there are any differences in the two population means when we know the variances.

Z-score is the result that we derive out of a z-test. It is a conversion of individual scores into a standard form. A z-score signifies the number of standard deviations of a result from its mean.

The formula for calculating z-score is:

z=x-μ/n

*x* = observed value

= population mean

σ/n = standard deviation of population

If the z-score is lower than the critical value, we accept the null hypothesis.

There are four kinds of z-tests that we can perform:

- One-sample location test
- Two-sample location test
- Paired difference test
- Maximum likelihood estimate

**When to use a z-test?**

- Z test is conducted when the sample size is larger than 30.
- The data should be normally distributed. It implies that it should form a symmetrical bell-curve shape when we plot the data on a graph. (clubdeportestolima.com.co)
- The data points need to be independent of one another. In simpler terms, one data point should not affect or relate to another data point.
- The data needs to be selected randomly from a population. It ensures an equal opportunity for each item to get selected.
- The sample sizes should be equal.
- In the case of the z-test, the standard deviation of the population is assumed as known.

*We have various comprehensive calculators that you can use online for free. You can choose from t-test calculator, graphing, matrix, the standard deviation to statistics, and scientific calculators. Check it here. *