How to Conduct a One Sample t-Test in Excel


A one sample t-test is used to test whether or not the mean of a population is equal to some value.

This tutorial explains how to conduct a one sample t-test in Excel.

How to Conduct a One Sample t-Test in Excel

Suppose a botanist wants to know if the mean height of a certain species of plant is equal to 15 inches. She collects a random sample of 12 plants and records each of their heights in inches.

The following image shows the height (in inches) for each plant in the sample:

One sample in Excel

We can use the following steps to conduct a one sample t-test to determine if the mean height for this species of plant is actually equal to 15 inches.

Step 1: Find the sample size, sample mean, and sample standard deviation.

First, we need to find the sample size, sample mean, and sample standard deviation, which will all be used to conduct the one sample t-test.

The following image shows the formulas we can use to calculate these values:

How to set up a one sample t test in Excel

Step 2: Calculate the test statistic t.

Next, we will calculate the test statistic using the following formula:

= x – µ / (s/√n)

where:

x = sample mean

µ = hypothesized population mean

s = sample standard deviation

n = sample size

The following image shows how to calculate in Excel:

How to calculate the test statistic for one sample t test in Excel

The test statistic turns out to be -1.68485.

Step 3: Calculate the p-value of the test statistic.

Next, we need to calculate the p-value associated with the test statistic using the following function in Excel:

=T.DIST.2T(ABS(x), deg_freedom)

where:

x = test statistic t

deg_freedom = degrees of freedom for the test, which is calculated as n-1

NERD NOTES: 

 

The function T.DIST.2T() returns the p-value for a two-tailed t-test. If you’re instead conducting a left-tailed t-test or a right-tailed t-test, you would instead use the functions T.DIST() or T.DIST.RT(), respectively.

The following image shows how to calculate the p-value for our test statistic:

How to calculate the p-value for a test statistic in Excel

The p-value turns out to be 0.120145.

Step 4: Interpret the results.

The two hypotheses for this particular one sample t test are as follows:

H0µ = 15 (the mean height for this species of plant is 15 inches)

HAµ ≠15 (the mean height is not 15 inches)

Because the p-value of our test (0.120145) is greater than alpha = 0.05, we fail to reject the null hypothesis of the test. We do not have sufficient evidence to say that the mean height for this particular species of plant is different from 15 inches.

Further Reading:

How to Conduct a Two Sample t-Test in Excel
How to Conduct a Paired Samples t-Test in Excel

Leave a Reply

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