 ## Quick way to compare means using python’s library

Statistics play a vital role not only in the data analysis but also in decision making. There are a bunch of tests that statisticians use to get the most accurate information from the data. Here, I will discuss three basic statistical tests: t-test and Analysis of variance.

T-test:

T-test compares the mean between two groups of interest. If we ask an ordinary person to compare the means between the groups, he/she will simply calculate the mean of the first group and then the mean of the second group and finally compare but that is not what a statistician will do. When the difference between the means is calculated, the simple question arises. Is this difference between means statistically significant to conclude that the groups are different? In other words, there is no reference to compare the difference between the means if we proceed that way. T-test is the solution to that problem.

Let’s say, we have two sections of students: section A and section B. The mean scores in mathematics of sections are 95 and 90 respectively. Therefore, the difference is 5. The question is: does this difference of 5 provide enough evidence that the mean score between the two sections are different? Let’s dive into the T-test.

T-test was named like that because it was first introduced by a statistician named whose pen name was Student and he first introduced the concept of t-statistic. When he ran a hypothesis test, he generated a test statistic called t-statistic which was basically used as a cut-off point for comparison. T-statistic is calculated as below: