# Difference between T-test and ANOVA

The T test refers to a univariate hypothesis test based on the t statistic, in which the known average and population variance is approximated by the sample. On the other hand, Z-test also a univariate test based on normal standard distribution.

In simple terms, a hypothesis refers to an assumption that must be accepted or rejected. There are two hypothesis testing procedures, namely parametric and nonparametric tests, in which the parametric test is based on the fact that the variables are measured on an interval scale, while in the nonparametric test it is assumed that it is measured on a ordinal scale. Now, in the parametric test, there can be two types of tests, t-test and z-test.

This article will give you an understanding of the difference between T-test and Z-test in detail.

### Comparative chart

Basis for comparison T-testZ-test
Sense The T-test refers to a type of parametric test that is applied to identify, how the means of two sets of data differ from each other when variance is not provided. The Z test involves a hypothesis test that checks whether the means of two data sets are different from each other when the variance is provided.
Based on Distribution for students Normal distribution
Population variance Unknown Known
Test measurement Small Great

### Definition of T-test

A t-test a hypothesis test used by the researcher to compare population means for a variable, classified into two categories according to the variable of interval less than. More precisely, a t-test is used to examine how the media taken from two independent samples differ.

The T test follows the t distribution, which is appropriate when the small sample size and the standard deviation of the unknown population. The shape of a distribution t strongly influenced by the degree of freedom. The degree of freedom implies the number of independent observations in a given set of observations.

Hypothesis of the T test :

• All data points are independent.
• The small sample size. Generally, a sample size greater than 30 sample units considered large, otherwise small but should not be less than 5, to apply the t test.
• The sample values ​​must be taken and recorded precisely.

The test statistic:

x the sample mean s the sample standard deviation n the sample size the population mean

Coupled T-test : a statistical test applied when the two samples are dependent and the coupled observations are taken.

### Definition of the Z test.

The Z test refers to a univariate statistical analysis used to test the hypothesis that the proportions of two independent samples differ significantly. Determines how far a data point is away from the data set mean, in the standard deviation.

The researcher adopts z-test, when the population variance known, in essence, when there is a large sample size, the sample variance considered approximately equal to the population variance. In this way, it is assumed that it is known, although only sample data is available and therefore a normal test can be applied.

Hypothesis of the Z test :

• All sample observations are independent
• The sample size should be over 30.
• The normal Z distribution, with an average zero and a variance 1.

The test statistic:

x the sample mean the population standard deviation n the sample size the population mean

## Key differences between T-test and Z-test

The difference between t-test and z-test can be clearly traced for the following reasons:

1. The t-test can be understood as a statistical test that is used to compare and analyze whether the means of the two populations are different from each other or not when the standard deviation is not known. By contrast, Z-test is a parametric test, which is applied when the standard deviation is known, to determine whether the means of the two data sets differ from each other.
2. The t-test based on Student's t distribution. In contrast, the z test is based on the assumption that the distribution of the sample means is normal. The t distribution and normal distribution of both students appear equal, as both are symmetric and bell-shaped. However, they differ in the sense that in a t distribution, there is less space in the center and pi in the tail.
3. One of the important conditions for the adoption of the t test is that the population variance is not known. Conversely, the population variance should be known or assumed to be known in the case of a z test.
4. The Z test used when the large sample size, i.e. n> 30, and the appropriate t test when the small sample size, meaning n <30.

### Conclusion

In general, t-tests and z-tests are almost similar tests, but the conditions for their application are different, which means that the appropriate t test when the sample size does not exceed 30 units. However, if greater than 30 units, z-test must be performed. Likewise, there are other conditions, which make it clear which test should be performed in a given situation.