## What is T-Test?

A T-Test is a method used to derive an inference in statistics, which is aimed to find out if there is any major difference between two means wherein the two groups considered may be related to each other.

### Explanation

- It is aimed at hypothesis testingHypothesis TestingHypothesis Testing is the statistical tool that helps measure the probability of the correctness of the hypothesis result derived after performing the hypothesis on the sample data. It confirms whether the primary hypothesis results derived were correct.read more, which basically is used to test a hypothesis pertaining to a given population. A T-Test considers T statistic, T distributionT DistributionThe formula to calculate T distribution is T=x¯−μ/s√N. Where x̄ is the sample mean, μ is the population mean, s is the standard deviation, N is the size of the given sample.read more values, and degrees of freedom, which are used to determine the probability of difference between two data sets.
- The basic working behind T-Test is that it considers a sample from each of the two sets and builds a problem statement by considering a null hypothesisNull HypothesisNull hypothesis presumes that the sampled data and the population data have no difference or in simple words, it presumes that the claim made by the person on the data or population is the absolute truth and is always right. So, even if a sample is taken from the population, the result received from the study of the sample will come the same as the assumption.read more where both the means are stated to be equal.
- On the basis of equated formulas, values are drawn and compared with the standard values, which further leads to the acceptance or rejection of the null hypothesis. The rejection of the null hypothesis indicates that the data set is quite accurate and not by chance.

You are free to use this image on your website, templates etc, Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked

For eg:

Source: T-Test (wallstreetmojo.com)

### Types of T-Test

There are primarily four types of t-test, which are as follows:

#### #1 – 1-Sample T-Test

It is aimed for testing if the mean of the value one has targeted is equal to the mean of a single population, e.g., Testing whether the average weight of Class 5 students are more than 45kg

#### #2 – 2-Sample T-Test

It is aimed for testing if the mean of the value one has targeted is equal to the mean of two independent populations, e.g., Testing whether the average weight of Class 5 boy students is different from Class 5 girl students.

#### #3 – Paired T-Test

It is aimed at testing if the mean of the value one has targeted is equal to the mean of differences between the observations which are dependent. e.g., comparing the marks of students before and after taking tuitions for each subject helps us identify whether taking tuitions is significant enough to improve the marks of students.

#### #4 – T-Test in Regression Output

It takes into consideration the coefficient in the regressionRegressionRegression Analysis is a statistical approach for evaluating the relationship between 1 dependent variable & 1 or more independent variables. It is widely used in investing & financing sectors to improve the products & services further. read more equation and tests to what degree it differs from zero value. e.g., If the entrance exam score is a significant factor to determine whether a student will obtain a good final score.

### Assumptions of T-Test

- The first assumption for a t-test is related to the measurement scale. This is related to whether the scale follows a continuous or ordinal scale
- The second assumption can be regarding the random nature of the sample. This means that the data collected should be pure random in nature.
- The third assumption can be that when we plot the data related to t-test distribution, it should follow a normal distributionNormal DistributionNormal Distribution is a bell-shaped frequency distribution curve which helps describe all the possible values a random variable can take within a given range with most of the distribution area is in the middle and few are in the tails, at the extremes. This distribution has two key parameters: the mean (µ) and the standard deviation (σ) which plays a key role in assets return calculation and in risk management strategy.read more and bring about a bell-curved graph.
- The fourth assumption can be that for t-distribution and specifically to obtain a shape of the bell curveBell CurveBell Curve graph portrays a normal distribution which is a type of continuous probability. It gets its name from the shape of the graph which resembles to a bell. read more, we need to have a bigger sample size.
- The final assumption can be that for the t-test. The variance should be homogenous in nature. e. the standard deviations are almost equal.

### How to Calculate?

It works in two different scenarios, i.e., one for the independent sample and another for the dependent sample.

#### #1 – Independent Sample Scenario

- We need to calculate the sum, the sample size, which is determined by “N,” and the score value for the mean for each of the independent samples. After this, the degree of freedom needs to be calculated for every independent sample.
- This is represented by subtracting the sample by one, which we denote as “n-1”. After this, the variance and standard deviation need to be calculated.
- The degrees of freedom of the samples are added, and this is termed as “df-total.” Next, we need to multiply the degree of freedom of each sample with the variance of each. We need to add the resultants and then divide the total by “df-total.” The result obtained is called the pooled variance.
- The pooled variance is then divided by the n of the samples. The result obtained for all the samples is then added. The square root of this is taken, and this is termed as the standard error of the difference.
- Lastly, we need to subtract the lower mean of the sample from the greater mean of the sample. The difference obtained is then divided by the standard errorStandard ErrorStandard Error (SE) is a metric that measures the accuracy of a sample distribution that signifies a population by using standard deviation. In other words, it is a measure to the dispersion of a sample mean concerned with the population mean and is not standard deviation.read more of the difference, and the results obtained are called the T-value.

#### #2 – Dependent Sample Scenario

- The scores obtained from each of the pairs of data set are noted, and we need to subtract it. The differences obtained are added and termed as “D.” The differences of each sample are squared and added to obtain a resultant called “D-Squared.” After this, we need to multiply the “N” or number of scores paired with the “D-squared.”
- The resultant obtained is subtracted from the square of total “D.” This result is further divided with “N-1”. The square root of the resultant is obtained and is termed as a divisor. Lastly, we need to divide the total “D” by the divisor, which gives us the final t-value.

### T-Test Examples

Let us consider we have scores for each subject in the examination held for two terms.

Subject | Mark Phase 1 | Mark Phase 2 |
---|---|---|

Maths | 45 | 62 |

Physics | 45 | 55 |

Chemistry | 45 | 55 |

Biology | 50 | 65 |

History | 55 | 68 |

Geography | 80 | 70 |

**Step 1:** Subtract Phase 1 from Phase 2

**Step 2:** Add up all the difference i.e. **-55**

**Step 3:** Square up the differences

**Step 4:** Add up all the squares of difference i.e. **983**

**Step 5:** Usage of formula to calculate the T value

**T = {(∑D)/N}/√{∑D ^{2} – (∑D)^{2}/N)}/(N-1) – N**

**=**-9.16/√{983-(-55)^{2}/6)}/(6-1)*6**=**-9.16/√15.96**=**-9.16/3.99**T Value = -2.29**

The T value obtained is then compared with the T value obtained from the table using p-value and degree of freedom. If the calculated t value is greater than the table value at a specific predefined alpha level, we can reject the null hypothesis saying there is a difference between the means.

### When It’s Used?

This is used to compare two means or proportions. Also, we use a t-test when the population parameters are unknown to the user. There are broadly three cases of t-test scenario usage, which are as follows:

- An independent sample t-test is used when we want to compare the mean of two groups.
- A paired sample t-test is used when we want to compare the mean of the same group but at different points of time.
- One sample t-test is used when we are in need of checking the mean of an individual group against an unknown mean.

### T-Test Usage in Excel

- In excel, the first and foremost thing we need is the installation of an add-in called Data Analysis. After this, we need to go to “Data” on the menu tab and click on it. The “Data Analysis” option will be visible there.
- To conduct a T-Test, we need to have our data in a columnar format. On click “Data Analysis,” we will get a number of statistical tests that we can perform, and from the list, we need to choose a t-test and click “Ok.”
- A dialog box comes up where we need to enter the data for trail 1 in the variable range 1 box and also the trial 2 data in the variable range 2 boxes. By default, the value of alpha remains at 0.05, but this can be changed based on our preference. When all if fine, click on “OK.”
- We can now see the result of our T-Test on the excel sheet. The most important value here to note is P-value. On what we have selected our alpha value, if our P-value in excelP-value In ExcelP-value is used in correlation and regression analysis in Excel to determine whether the result obtained is feasible or not and which data set from the result to work with. It's value ranges from 0 to 1.read more is less than the alpha value, we can conclude there is a statistical material difference between the means of our two sets of values.

### Conclusion

The T-Test is aimed at hypothesis testing, which basically is used to test a hypothesis pertaining to a given population. It tells us the level of significance of the difference between the groups, which are generally measured on the basis of the mean. Here we basically find out the difference between population meansPopulation MeansThe population mean is the mean or average of all values in the given population and is calculated by the sum of all values in population denoted by the summation of X divided by the number of values in population which is denoted by N.read more and a hypothesized value.

### Recommended Articles

This has been a guide to What is T-Test & its Definition. Here we discuss how to calculate the t-test, types, and assumptions along with examples and when it’s used. You can learn more about from the following articles –

- 16 Courses
- 15+ Projects
- 90+ Hours
- Full Lifetime Access
- Certificate of Completion

## Leave a Reply