t-test formula - Derivation, Examples (2024)

The t-test formula helps us to compare the average values of two data sets and determine if they belong to the same population or are they different. The t-score is compared with the critical value obtained from the t-table. The large t-score indicates that the groups are different and a small t-score indicates that the groups are similar.

What Is the T-test Formula?

The t-test formula is applied to the sample population. The t-test formula depends on the mean, variance, andstandard deviation of the data being compared. There are 3 types of t-tests that could be performed on the n number of samples collected.

  • One-sample test,
  • Independent sample t-test and
  • Paired samples t-test

The critical value is obtained from the t-table looking for the degree of freedom(df = n-1) and the corresponding α value(usually 0.05 or 0.1). If the t-test obtained statistically > CV then the initial hypothesis is wrong and we conclude that the results are significantly different.

One-Sample T-Test Formula

For comparing the mean of a population \(\overline{x}\) from n samples, with a specified theoretical mean μ, we use a one-sample t-test.

\(t= \dfrac{\overline{x}- μ}{\dfrac{\sigma}{\sqrt{n}}}\)

whereσ/√n is the standard error

t-test formula - Derivation, Examples (1)

Independent Sample T-Test

Students t-test is used to compare the mean of two groups of samples. It helps evaluate if the means of the two sets of data are statistically significantly different from each other.

\(t = \dfrac{\overline{x_{1}}-\overline{x_{2}}}{\sqrt{(\dfrac{s_{1}^2}{n_{1}}+\dfrac{s_{2}^2}{{n_{2}}}})}\)

t-test formula - Derivation, Examples (2)

where

  • t = Student's t-test
  • \(x_{1}\) = mean of first group
  • \(x_{2}\)= mean of second group
  • \(s_{1}\) = standard deviation of group 1
  • \(s_{2}\) = standard deviation of group 1
  • \(n_{1}\)= number of observations in group 1
  • \(n_{2}\)= number of observations in group 2

Paired Samples T-Test

Whenever two distributions of the variables are highly correlated, they could be pre and post test results from the same people. In such cases, we use the paired samples t-test.

\(t = \dfrac{Σ(x_{1}-x_{2})}{\dfrac{s}{\sqrt{n}}}\)

where

t = Student's t-test

\(x_{1}-x_{2}\) = Difference mean of the pairs

s= standard deviation

n = sample size

t-test formula - Derivation, Examples (3)

Have questions on basic mathematical concepts?

Become a problem-solving champ using logic, not rules. Learn the why behind math with our certified experts

Book a Free Trial Class

Examples Using t-test Formula

Example 1: Calculate a t-test for the following data of the number of times people prefer coffee or tea in five time intervals.

CoffeeTea
43
58
76
64
97

Solution: let \(x_{1}\) be the sample of data that prefers coffee and \(x_{2}\) be the sample of data that prefers tea.

let us find the mean, variance and the SD

\(x_{1}\)(\(x_{1}-\overline{x_{1}})\)(\(x_{1}-\overline{x_{1}})^2\)\(x_{2}\)(\(x_{2}-\overline{x_{2}})\)(\(x_{2}-\overline{x_{2}})^2\)
4-2.24.843-2.66.76
5-1.21.4482.45.76
70.80.6460.40.16
6-0.20.044-1.62.56
92.87.8471.41.96
6.214.85.617.20

\(\overline{x_{1}}\) = 31/ 5 = 6.2

\(\overline{x_{2}}\) = 28/5 = 5.6

Σ(x1-\(\overline{x_{1}}\))2 = 14.8

Σ(x2-\(\overline{x_{2}}\))2= 17.2

S1= 14.8/4 = 3.7

S2 = 17.2/4 = 4.3

According to the t-test formula,

\(t = \dfrac{\overline{x_{1}}-\overline{x_{2}}}{\sqrt{(\dfrac{s_{1}^2}{n_{1}}+\dfrac{s_{2}^2}{{n_{2}}}})}\)

Applying the known values in the t-test formula, we get

\(t = \dfrac{6.2-5.6}{\sqrt{(\dfrac{3.7}{5}+\dfrac{4.3}{5})}}\)

\(=\dfrac{0.6}{\sqrt{1.6}}\)= 0.6/1.26 = 0.47

t = 0.47

Example 2: A company wants to improve its sales. The previous sales data indicated that the average sale of 25 salesmen was $50 per transaction. After training, the recent data showed an average sale of $80 per transaction. If the standard deviation is $15, find the t-score. Has the training provided improved the sales?

Solution:

\(H_{0}\)accepted hypothesis:the population mean = the claimed value⇒ μ = μ0

\(H_{0}\)alternate hypothesis:the population mean not equal to the claimed value⇒ μ ≠ μ0

t-test formula for independent test is \(t= \dfrac{m- μ}{\dfrac{s}{\sqrt{n}}}\)

Mean sale = 80, μ = 50, s= 15 and n= 25

substituting the values, we get t= (80-50)/(15/√25)

t = (30 ×5)/10 = 10

looking at the t-table we find 10 > 1.711 . (I.e. CV for α = 0.05). ∴ the accepted hypothesis is not true. Thus we conclude that the training boosted the sales.

Example 3: A pre-test and post-test conducted during a survey to find the study hours of Patrick on weekends. Calculate the t-score and determine (for α = 0.25) if the pre-test and post-test surveys are significantly different?

Pre-test(X)Post-test(Y)X-Y(X-Y)2
12-11
24-24

Solution:

According to the t-test formula, we know that \(t = \dfrac{ΣX-Y}{\dfrac{s}{\sqrt{n}}}\)

Σ(X-Y)= -3 = 3

s= Σ(X-Y)2/(n-1) = 52/1 = 25

t= 3/(25/2) = 6/25 = 0.24

here degree of freedom is n-1 = 2-1 =1 and the corresponidng critical value in the t-table forα= 0.25, is 1.

t < CV.

Therefore the scores are not significantly different.

FAQs on T-test Formula

How Do You Calculate The T-test?

The following steps are followed to calculate the t-test.

  • Get the data. Find the mean.
  • Subtract the mean score from each individual score
  • Square the differences.
  • Add up all the squared differences.
  • Find the variance and standard deviation.
  • Key-in the values in the formula: \(t = \dfrac{Σx_{1}- mean}{\dfrac{s}{\sqrt{n}}}\)

What is the Formula for Finding The Independent T-test?

Students t-test is used to compare the mean of two groups of samples.

\(t = \dfrac{\overline{x_{1}}-\overline{x_{2}}}{\sqrt{(\dfrac{s_{1}^2}{n_{1}}+\dfrac{s_{2}^2}{{n_{2}}}})}\)

where

t = Student's t-test score

\(x_{1}\) = mean of first group and \(x_{2}\)= mean of second group

\(s_{1}\) = standard deviation of group 1 and \(s_{2}\) = standard deviation of group 1

\(n_{1}\)= number of observations in group 1 and \(n_{2}\)= number of observations in group 2

What is a One-Sample t-test?

The one-sample t-test is the statistical test used to determine whether an unknown population mean is different from a specific value. For example, comparing the mean height of the students with respect to the national average height of an adult.

What is a T-test Formula Used For?

We use the T-test Formula to statistically determine if there is a significant difference between the means of two groups that are related in certain aspects. Examples: a gym center tests the weight loss from a few samples, a company hiring candidates is set to determine the skills of 2 candidates from two different universities at the interview, and so on.

t-test formula - Derivation, Examples (2024)

FAQs

What is the formula for the t-test result? ›

The t-score formula for an independent t-test is: t equals the mean of population 1 minus the mean of population 2 divided by the product of the pooled standard deviation and the square root of one over the sample size of sample 1 plus one over the sample size of sample 2.

How to interpret t-test results example? ›

To interpret the t-test results, all you need to find on the output is the p-value for the test. To do an hypothesis test at a specific alpha (significance) level, just compare the p-value on the output (labeled as a “Sig.” value on the SPSS output) to the chosen alpha level.

How do you derive a two sample t test? ›

The test statistic for a two-sample independent t-test is calculated by taking the difference in the two sample means and dividing by either the pooled or unpooled estimated standard error. The estimated standard error is an aggregate measure of the amount of variation in both groups.

How to calculate t value? ›

The t-score formula is: t = x ― − μ S n , where x ― is the sample mean, μ is the population mean, S is the standard deviation of the sample, and n is the sample size.

What is the formula for test statistic? ›

For a z-test, the test statistic is z = x ¯ − μ σ n and for a t-test, the test statistic is t = x ¯ − μ s n , where is the sample mean, is the population mean, is the population standard deviation, is the sample standard deviation, and is the sample size.

How do I report a t-test result? ›

T Tests are reported like chi-squares, but only the degrees of freedom are in parentheses. Following that, report the t statistic (rounded to two decimal places) and the significance level. There was a significant effect for gender, t(54) = 5.43, p < . 001, with men receiving higher scores than women.

How to write up paired t-test results? ›

Paired T-test Write Up

A Write-Up for a Paired T-test should look like this: A paired samples t-test showed that the participant's level of perceived social support increased from pre-program (M = 32.83, SD = 7.91) to post-program (M = 38.07, SD = 7.23; t = -14.07, p < . 001, d = -. 73).

What is a simple explanation of T scores? ›

A t-score (a.k.a. a t-value) is equivalent to the number of standard deviations away from the mean of the t-distribution. The t-score is the test statistic used in t-tests and regression tests. It can also be used to describe how far from the mean an observation is when the data follow a t-distribution.

What is the formula for the t-test one sample? ›

t = ¯y − m0ˆσ/√n. 4. Calculate the probability of observing the test statistic under the null hypothesis. This value is obtained by comparing t to a t-distribution with (n − 1) degrees of freedom.

What is the t-test easily explained? ›

The t-test is a statistical test procedure that tests whether there is a significant difference between the means of two groups. The two groups could be, for example, patients who received drug A once and drug B once, and you want to know if there is a difference in blood pressure between these two groups.

How to interpret t-test results? ›

If a p-value reported from a t test is less than 0.05, then that result is said to be statistically significant. If a p-value is greater than 0.05, then the result is insignificant.

How do you write the results of a two sample t test? ›

The format of the test result is: t(df) = t-statistic, p = significance value. Therefore, for the example above, you could report the result as t(7.001) = 2.233, p = 0.061.

How to interpret p-value? ›

These are as follows: if the P value is 0.05, the null hypothesis has a 5% chance of being true; a nonsignificant P value means that (for example) there is no difference between groups; a statistically significant finding (P is below a predetermined threshold) is clinically important; studies that yield P values on ...

What is the formula for the t-test coefficient? ›

The t-test is used for this purpose. For each coefficient, it tests that the coefficient differs significantly from zero value. Relevant test statistic is t = b1 /σb1, where σb1 is the standard error of b1. Relevant distribution is the t-distribution, with degrees of freedom = n − (k + 1).

What is the formula for the t-distribution score? ›

Definition. The Student t -distribution is the distribution of the t -statistic given by t=¯x−μs√n t = x ¯ − μ s n where ¯x is the sample mean, μ is the population mean, s is the sample standard deviation and n is the sample size.

How to calculate t-score from z score? ›

To eliminate thesecharacteristics, z scores often are converted to T scores. This isaccomplished using the simple formula: T score = 10(z score) + 50.

Top Articles
Latest Posts
Article information

Author: Foster Heidenreich CPA

Last Updated:

Views: 5895

Rating: 4.6 / 5 (56 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Foster Heidenreich CPA

Birthday: 1995-01-14

Address: 55021 Usha Garden, North Larisa, DE 19209

Phone: +6812240846623

Job: Corporate Healthcare Strategist

Hobby: Singing, Listening to music, Rafting, LARPing, Gardening, Quilting, Rappelling

Introduction: My name is Foster Heidenreich CPA, I am a delightful, quaint, glorious, quaint, faithful, enchanting, fine person who loves writing and wants to share my knowledge and understanding with you.