T-Test Formula

Bookmark added to your notes.
View Notes

T-Test Statistics Formula

A t-test is a kind of inferential statistical test that is extensively used to compare the mean of two groups of samples. It is therefore to assess whether the means of the two sets of data are statistically considerably distinguished from each other which may be associated with certain characteristics. The t-test formula is as follows:-

t  = \[ \frac{\overline{x_1}-\overline{x_2}}{\sqrt{\frac{S_1^2}{N_1} + \frac{S_2^2}{N_2}}}\]

Where, “t” represents the t-value, “x1” and “x2” describes the means of the two groups (sample difference and hypothesized difference) being compared, “s2” stands for the pooled standard error of the two groups, and “n1” and “n2” refers to the number of observations in each of the groups.

\[\frac{signal}{noise}\] = \[\frac{\text{difference between group means}}{\text{variability of groups}}\]

=\[ \frac{\overline{x_T}-\overline{x_C}}{SE(\overline{x_T}-\overline{x_C})}\]


[Image will be uploaded soon]

T Test Example

Simply understand what the t statistic through an example is: Let’s say you have a sore throat and tried an ayurvedic remedy. The soreness lasts a couple of days. The next time you have a sore throat, you buy an Over the counter antibiotic medicine and the cold lasts a week. You survey your friends and they all tell you that their soreness was of a shorter duration (an average of 5 days) when they took the naturopathy remedy. What you really want to have knowledge of, are these results repeatable? A t test can significantly tell you by comparing the means of the two groups and making you aware of the probability of those results happening by chance.

Types of T test

There are a number of t test that are as given:

1. One-sample T-test Formula

The type of sample t-test is used to compare the mean of a population considering a specified theoretical value.

Let X describe a set of values with size ‘n’, with standard deviation ‘S’, and with observed mean ‘m’. The comparison of the observed mean of the population to a theoretical value μ is carried out with the formula as below:-

One sample T test Formula

T = m−μ / s/√n

Note: To assess whether the difference occurs to be statistically significant, you first have to go through t test table, the critical value of Student’s t distribution correlating to the significance level alpha of your choice (5%). The degrees of freedom (df) considered in this test are: df = n−1

2. Independent T-test

Independent or also known as unpaired two sample t-test is used to establish a comparison between the means of two unrelated groups of samples.

As an example, we have a division of 100 individuals (50 male and 50 female). The question is to test whether the average weight of females is significantly different from that of males?

Under this situation, we are available with two independent groups of samples and an independent t-test can be used to test whether the means are different.

Independent T-test Formula Describes 

Let A and B speak of the two groups to compare.

Let mA and mB speak of the means of groups A and B, respectively.

Let nA and nB speak of the sizes of groups A and B, respectively.

The t-test statistic value to evaluate if the means are different can be computed as follow:

t=mA−mB √S2/nA+S2/nB

Where S2 stands for an estimator of the variance of the two samples which can be further calculated as follow:

S2=∑(x−mA) 2+∑(x−mB) 2 nA+nB−2

3. ​Dependent Sample T-test

Also known as correlated or Paired Student’s t-test, it is put to use in order to compare the means of two associated samples. In such cases, you have a pair of values (two values) for the same samples.

Paired T-test Formula

For comparing the means of the two paired sets of data, it is necessary to first calculate the differences between all pairs.

Let ‘d’ denote the differences between all pairs. The mean of the difference ‘d’ is compared to 0. If there is any considerable difference between the two pairs of samples, then the mean of d is anticipated to be far from 0.

t test statistic value can be computed as given: t = m/s/√ n

Where ‘m’ and ‘s’ represent the mean and the standard deviation of the difference respectively and n is the size of d.

Solved Examples For T-test


Researchers conducted a study where they wanted to find out if people who meditate regularly have less anxiety issues than people who don't. They took a random sample of adult females and surveyed them about their meditation routine and their behavioral pattern. Here is a summary of the outcomes:



No Meditation




Standard Deviation



Number of females





Seeing that, the researchers want to utilize these results to test H0: μ Mediation – μ No Meditation =0 vs. Ha: μ Mediation – μ No Meditation

Assuming that all conditions have met\

We use the formula for test statistic i.e.

T = sample difference – hypothesized difference/ stand error of the difference

The difference μ1 −μ2 occurs from null hypotheses. In such type of test, we assume there is no difference in population mean, so we can take substitution for μ1 −μ2

Thus an appropriate test statistic comes out to be:

t= (7 - 6.5) – 0/ √1 2/ 180 + 1.5 2/190

FAQ (Frequently Asked Questions)

Q1. What is a T Score?

Ans. The t score refers to the ratio among the difference within the groups and difference between two groups and. The higher the t score, the greater the difference between groups. The lesser the t score, the greater the similarity between groups. A t score of 5 indicates that the groups are five times as different from each other as they are within each other. When you run a t test, the higher the t-value, more probable is that the results are repeatable.

  • Thus, a high t-score informs you that the groups are different.

  • A small t-score informs you that the groups are similar.

Q2. What does P-values and T-Values mean ?

Ans. Every t-value possesses a p-value to go with. A p-value is a likeliness that the outcomes from your sample data happened by chance. P-values vary from 0% to 100%. And are generally written in the form of a decimal. For example, a p-value of 10% is 0.10 Low p-values are considered to be good since they suggest that your data did not happen by chance.