Maths Formulas

T-test Formula

In the statistics t-test is a very important hypothesis test. In this test, statistician follows a student t-distribution. It is done under the null hypothesis. It can be used to determine whether two sets of data are significantly different from each other or not. And also it is most commonly applied when the test statistic would follow a normal distribution. In this article, we will discuss the t-test formula with an example. Let us learn the concept!                 

What is the T-test?

The t-test is a test that is mainly used to compare the mean of two groups of samples. It is meant for evaluating whether the means of the two sets of data are statistically significantly different from each other.

There are many types of t-test. Some of these are:

  • The one-sample t-test, which is used to compare the mean of a population with a theoretical value.
  • The unpaired two-sample t-test, which is used to compare the mean of two independent given samples.
  • The paired t-test, which is used to compare the means between two groups of samples that are related.T-test Formula

T-test Formula

The T-test formula is given below:

t = \(\frac{\bar{x_1}-\bar{x_2}}{\sqrt(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2})}\)

Where,

t t-test value
\(\bar{x_1}\) Mean of first set of values
\(\bar{x_2}\) Mean of second set of values
\(s_1\) Standard deviation of first set of values
\(s_2\) Standard deviation of second set of values
\(n_1\) Total number of values in first set
\(n_2\) Total number of values in second set.

Also,

The formula for standard deviation is given below:

\(s = \sqrt(\frac{\sum (x-\bar x)^2}{n-1})\)

Where,

s The standard deviation for a data set
x Values given in data set
\(\bar x\) Mean value of data set
n Total number of values in the data set

Solved Examples

Q.1: Find the t-test value for the following given two sets of values:

7, 2, 9, 8 and

1, 2, 3, 4?

Solution: For first data set:

Number of terms in first set i.e. n_1 = 4

Calculate mean value for first data set using formula:

\(\bar x_1 = \frac{\sum x_1}{n_1} \\\)

i.e. \(\bar x_1 = \frac{7+2+9+8}{4} \\\)

i.e. \(\bar x_1= 6.5\)

Construct the following table for standard deviation:

\(x_1\) \(x_1−\bar x_1\) \((x_1−\bar x_1)^2\)
7 0.5 0.25
2 -4.5 20.25
9 2.5 6.25
8 1.5 2.25

Thus ,  \(\sum((x_1−\bar x_1)^2 ) =29\)

Now,  compute the standard deviation usng formula as,

\(s_1 = \sqrt(\frac{\sum (x_1-\bar x_1)^2}{n_1-1}) \\\)

i.e. \(s_1 = \sqrt(\frac{29}{4-1}) \\\)

i.e. \(s_1= \sqrt(9.66) \\\)

\(s_1 = 3.11\)

Therefore, standard deviation for the first set of data: s_1 = 3.11

For second data set:

Number of terms in second set i.e. \(n_2 = 4\)

Calculate mean value for second data set using formula:

\(\bar x_2 = \frac{\sum x_2}{n_2} \\\)

i.e. \(\bar x_2 = \frac{1+2+3+4}{4} \\\)

i.e. \(\bar x_2= 2.5\)

Construct the following table for standard deviation:

\(x_2\) \(x_2−\bar x_2\) \((x_2−\bar x_2)^2\)
1 -1.5 2.25
2 -0.5 0.25
3 0.5 0.25
4 1.5 2.25

Thus, \(\sum((x_2−\bar x_2)^2 ) =5\)

Now, compute the standard deviation using formula as,

\(s_2 = \sqrt(\frac{\sum (x_2-\bar x_2)^2}{n_2-1}) \\\)

i.e. \(s_2 = \sqrt(\frac{5}{4-1}) \\\)

i.e. \(s_1= \sqrt(1.66) \\\)

\(s_1 = 1.29\)

Therefore, standard deviation for the second set of data: \(s_2 = 1.29\)

Now, apply the formula for t-test value:

\(t = \frac{\bar{x_1}-\bar{x_2}}{\sqrt(\frac{s_1^2}{n_1}+\frac{s_2^2}{n_2})}\\\)

\(t = \frac{6.5 – 2.5 }{\sqrt(\frac{3.11^2}{4}+\frac{1.29^2}{4})}\\\)

\(= \frac{4}{\sqrt(\frac{9.3667}{4}+\frac{1.667}{4})} \\\)

t = 2.38

Hence t-test value for the two data sets is = 2.38

Share with friends

Customize your course in 30 seconds

Which class are you in?
5th
6th
7th
8th
9th
10th
11th
12th
Get ready for all-new Live Classes!
Now learn Live with India's best teachers. Join courses with the best schedule and enjoy fun and interactive classes.
tutor
tutor
Ashhar Firdausi
IIT Roorkee
Biology
tutor
tutor
Dr. Nazma Shaik
VTU
Chemistry
tutor
tutor
Gaurav Tiwari
APJAKTU
Physics
Get Started

One response to “Equation Formula”

  1. KUCKOO B says:

    I get a different answer for first example.
    I got Q1 as 20.5
    median 23 and
    Q3 26

Leave a Reply

Your email address will not be published. Required fields are marked *

Download the App

Watch lectures, practise questions and take tests on the go.

Customize your course in 30 seconds

No thanks.