In statistics, a t-test is a location test consisting of two samples, which is used to test the assumption that two populations have the same means. The original t-test uses a complex formula that can be used to manually calculate the value of t. However, the same can also be automatically calculated in Google Sheets, using its simpler and more convenient formula:
T.TEST(range1, range2, tails, type)
- range1 – The first set of data (group of cells) to be considered for the t-test.
- range2 – The second set of data (group of cells) to be considered for the t-test.
- tails – Represents the number of distribution tails.
- If 1: uses a one-tailed distribution.
- If 2: uses a two-tailed distribution.
- type – Represents the type of t-test.
- If 1: a paired test is performed.
- If 2: a two-sample equal variance (homoscedastic) test is performed.
- If 3: a two-sample unequal variance (heteroscedastic) test is performed.
T.TEST(A1:A5, B1:B5, 2, 1)
- The first set of data includes the group of cells ranging from A1 to A5.
- The second set of data includes the group of cells ranging from B1 to B5.
- The sample represents a paired test, using a two-tailed distribution.
- range1 and range2 need to have the same number of data points.
- tails and type must always be numeric.
- TEST uses the provided data in range1 and range2 to calculate a non-negative test. If tails is set to 1, T.TEST returns the probability of a higher value of the t-statistic under the assumption that range1 and range2 are samples from populations with the same mean. When tails is set to 2, the value returned by T.TEST is double the one returned when tails is set to 1, and relates to the probability of a higher absolute value of the t-statistic under the assumption of the same population means.
- You can use both TEST and TTEST in order to perform this function.