A t-te🐷st measu♚res the difference between the means of two samples.
What Is a T-Test?
A t-test is an inferential 澳洲幸运5开奖号码历史查询:statistical test used to determine if there is a significant difference between 🉐the means of two groups and how they are related.
T-tests are used when the d💧ata sets follow a normal distribution and have unk🅰nown variances, like the data set recorded from flipping a coin 100 times.
The t-test assists in hypothesis testing in statistics and uses the t-statistic, the 澳洲幸运5开奖号码历史查询:t-distribution values,🏅 and the degrees of freedom to determine stati🉐stical significance.
Key Takeaways
- A t-test can shed light on a statistically significant difference between the means of two data sets.
- It is used for hypothesis testing in statistics.
- Calculating a t-test requires the difference between the mean values from each data set, the standard deviation of each group, and the number of data values.
- T-tests can be dependent or independent.
:max_bytes(150000):strip_icc()/t-test_final2-d26bbb129cc441c192ccf8e784ae06a4.png)
Investopedia / Sabrina Jiang
Understanding the T-Test
A t-test compares the mean values of t🗹wo s🌠amples to determine a statistically significant difference.
For example, the grades of students from a physics class and those of a dꦺifferent group of s𝓀tudents from a writing class would not likely have the same mean and standard deviation.
Similarly, samples taken from the placebo-fed control group of a drཧug test and those taken from the drug-prescribed group should have a slightly different mean and standard deviation.
Four assumptions are made while using a t-test:
- The data collected must follow a continuous or ordinal scale, such as the scores for an IQ test.
- The data is collected from a randomly selected portion of the total population
- The data will result in a normal distribution of a bell-shaped curve.
- Equal or homogenous variance exists when the standard variations are equal.
Mathematically, the t-test takes a sample from each of the two sets and establishes the problem statement. It assumes a null hypothesis, which means that it assumes the two means are equal.
Using the t-test formulas, values are calculated and compared against the standard values. This comparison 澳洲幸运5ಌ开奖号码历史查询🐻:helps to determine the effect of chance on t🗹he𓆉 difference, and whether the difference is outside that chance range.
The t-test questions whether the difference between the groups represents a true diff𓂃erence in the study or merely a random differencꦰe.
Based on the results, the assumed null hypothesis is accepted or reject💖ed. If the null hypothesis is rejected, it indicates that data readings are strong and are probably not due to chance.
- Null hypothesis rejected: Differences are statistically significant
- Null hypothesis accepted: Differences are not statistically significant
The t-test is just one of many tests used for this purpose. Others may be more༒ appropriate depending on the number of varia🅠bles or the size of the sample.
For example, statisticians use a z-test for data sets with a large sample size. Other testing options include the ch🅺i-square test and the f-test.
Example of When a T-Test Would Be Useful
Imagine that a drug m🌞anufacturer tests a new medicine. Following standard procedure, the drug is given to one group of p𒆙atients, and a placebo is given to another group called the control group.
The placebo is a substance with no therapeutic value and serves as a benchmark to measure how the other group, administered the actual drug, responꦕds.
After the drug trial, the members of the control group reported an increase in average life expectancy of three years. Members of the group that was prescribed the new drug reported an increase in average life expe♐ctancy of four years.
Initial observation indica꧒tes that the drug is working. However, it is also possible that the observation may be due🤪 to chance.
A t-test could be used to determine if the results are significant and applicable to the entire population, or whether they are random and not due to the drug intervention.
Using the T-Test
Calculating a t-test requires three fundamental data v🌞alues:
- The difference between the mean values from each data set, also known as the mean difference
- The 澳洲幸运5开奖号码历史查询:standard deviation of each group
- The number of data values of each group
The t-test produces two values as its output: t-value and 澳洲幸运5开奖号码历史查询:degrees of freedom. The t-value, or t-score, is a ratio of the difference between the mean of the two samp🐻le sets andꦐ the variation that exists within the sample sets.
Tꦏhe numerator is the difference between the mean of the two sample sets. The denominator is the variation that exists within the sample sets and is a measurement of the dispersion or variability.
This calculated t-value is then compared against a value obtained from a critical value ♛table called the T-distribution table.
Higher val🅺ues of the t-score indicate that a la♛rge difference exists between the two sample sets. The smaller the t-value, the more similarity exists between the two sample sets.
Degrees of freedom ✃refers to the values in a study that have the freedom to vary and are essential for assessing the importance and the validity of the null hypothesis.
Computation of these values usually depends upon the number of data records available in🌱 the sample🌜 set.
Important
A large t-score, o✱r t-value, indicates that the groups are different while a small t-score indicates that the groups are siꩲmilar.
Types of T-Tests
Paired Sample T-Test Formula
The paired t-test, or correlated t-test, is a dependent type of test and is performed when the samples consist of matched pairs of similar units, or whenꦓ there are cases of repeated measur🍸es.
For example, there may be instances where the same patients are repeat𝔍edly tested beforeᩚᩚᩚᩚᩚᩚᩚᩚᩚ𒀱ᩚᩚᩚ and after receiving a particular treatment. Each patient is being used as a control sample against themselves.
This method also applies 🔥to cases where the samples are related or have matching characteristics, like a comparative analysis involving children, parents, or siblings.
The formula to compute the t-value an🍌d degrees of freedom for a paired ꧃t-test is:
T=(n)s(diff)mean1−mean2where:mean1 and mean2=The 🍎;average values of each of the samplꦫe setss(diff)=The standard deviওation of the differences of the paired data valuesn=The sample&nbsﷺp;size (the number of paired diಌfferences)n−1=The degrees of freedom
Equal Variance or Pooled T-Test Formula
The equal variance t-test is an independent t-test and is used when the number of samples in each group is the same, or the variance🌟 of the two data sets is similar.
The formula to calculate t-value and degrees of freedom for꧒ equal vaꩲriance t-test is:
T-value=n1+n2−2(n1−1)×var12+(n2−1)×var22×n11+n21mean1−mean2where:mean1 and mean2=Average values of eachof the sample setsvar1 and var2=Variance of eac▨h of the sample setsn1 and n2=Number of records in each sam🌠ple set
and,
Degrees of Freedom=n1+n2−2where:n1 and n2=Num🎶ber of records&🃏nbsp;in each sample set
Unequal Variance T-Test Formula
The unequal 澳洲幸运5开奖号码历史查询:variance t-test is an independent t-test and is used when the number of samꦺples in each group is different, and the variance of the two data sets is also different. This test is also called Welch's t-test.
The formula to calculate t-value and degrees of freedom for an unequ♈al variance t-test i𝓰s:
T-value=(n1var1+n2var2)mean1−mean2where:mean1 and mean2=Average values of eachof the sample setsvar1 and var2=Variance oඣf each of the&𝓰nbsp;sample setsn1 and n2=Number of records in each sample ﷽;set
and,
Degrees of Freedom=n1−1(n1var12)2+n2−1(n2var22)2(n1var12+n2var22)2where:var1 and var2=Variance of&nbs🌌p;each🥃 of the sample setsn1 and n2=Number&n🍰bsp;of records in each sample&🌊nbsp;set
Which T-Test to Use
The following𒈔 flowchart can determine which t-test to use based on the characteristics of the sample sets. The key items to consider include:
- The similarity of the sample records
- The number of data records in each sample set
- The variance of each sample set
:max_bytes(150000):strip_icc()/ttest2-147f89de0b384314812570db74f16b17.png)
Image by Julie Bang © Investopedia 2019
Example of an Unequal Variance T-Test
Assume that the diagonal measurement of paintings received in an art gallery is taken. One group of samples includes 10 paintings, while the other includes 20 paintings. The data sets, with the corresponding mean and variance values, are as follows:
Set 1 | Set 2 | |
---|---|---|
19.7 | 28.3 | |
20.4 | 26.7 | |
19.6 | 20.1 | |
17.8 | 23.3 | |
18.5 | 25.2 | |
18.9 | 22.1 | |
18.3 | 17.7 | |
18.9 | 27.6 | |
19.5 | 20.6 | |
21.95 | 13.7 | |
23.2 | ||
17.5 | ||
20.6 | ||
18 | ||
23.9 | ||
21.6 | ||
24.3 | ||
20.4 | ||
23.9 | ||
13.3 | ||
Mean | 19.4 | 21.6 |
Variance | 1.4 | 17.1 |
Is the diffe🎀rence from 19.4 to 21.6 due to chance alone, or do differences ex☂ist in the overall populations of all the paintings received in the art gallery?
We 🌃establish the problem by assuming the null hypothesis that the mean is the same between the two sample sets and conduct a t-test to test if the hypothesis is plausible.
Since the number of data records is different (n1 = 10 and n2 = 20) and the variance is also different, the t-value and degrees of freedom ⛎are computed for the above data set using the formula for the Unequal Variance ♌T-Test.
The t-value is -2.24787. Since the minus sign can be igno𓆉red when comparing 🌟the two t-values, the computed value is 2.24787.
The degrees of freedom value is 24.38 and is reduced to 24 (the formula definition requires rounding down the valu✅e to the least possible integer value).
One can specify a level of probability (alpha level, level of significance, p) as a criterion for𒁏 acceptance. In most cases, a 5% value can be assumed.
Using the degree of freedom value as 24 and a 5% level of significance, a look at the t-value distribution table give🎃s a value of 2.064.
Comparing this value against the computed value of 2.247 indicates that the calculated t-value is greater than the table value at🌳 a significance level of 5%.
Therefo🐟re, it is safe to reject the null hypothesis that there is no difference between means.
Rejecting the nul🦩l hypothesis means the population set has intrinsic differences, and they are not by chance.
How Is the T-Distribution Table Used?
The T-Distribution Table is available in one-tail and 澳洲幸运5开奖号码历史查询:two-tails formats. The one-tail format is used for assessing cases that have a fixed value or range with a clear direction, either positive or negative. For instance, what is the probability of the output value remaining below -3, or getting more than seven when rolling a pair of dice? The two-tails format is used for range-bound analysis, such as asking if the coordinates fall between -2 and +2.
What Is an Independent T-Test?
The samples of independent t-tests are selected independent of each other where the data sets in the two groups don’t refer to the same values. They may include a group of 100 randomly unrelated patients split into two groups of 50 patients e📖ach. One of the groups becomes the control group and is administered a placebo, while the other group receives a prescribed treatment. This constitutes two independent sample groups that are unp🌟aired and unrelated to each other.
What Does a T-Test Explain and How Is It Used?
A t-test is a statistical test that is use𒊎d to compare the means of two groups. It is often used in hypothesis testing to determine whether a process or treatment has an effect on the population of interest, or whether two groups are different from one another.
The Bottom Line
A t-test is used to determ⭕ine if there is a statistically significant difference between the means of two population samples. It is used in statistics for hypothesis testing and can indicate whether differences between two populations are meaningful or random.
The t-test calculation uses three data: the difference between the m🎉ean values from each data set, the standard deviation of each group, and the number🐓 of data values.
There are different variations of the t-🅰test formula. Which one to use depends on different factors. However, each🍷 variation is used to investigate the same statistical question.
Related Articles
:max_bytes(150000):strip_icc()/GettyImages-1129912181-52cfe35d575444f2bd3349718c7d6073.jpg)
:max_bytes(150000):strip_icc()/GettyImages-1314040262-96eb9cf394ac4f609aec9acf3a253a26.jpg)
:max_bytes(150000):strip_icc()/Financial-performance-4196424-Final-240df17e57f54106b5a92680ff2465ee.jpg)
:max_bytes(150000):strip_icc()/key-financial-ratios-to-analyze-tech-companies-ss-5bfc2b6946e0fb00260168db.jpg)
:max_bytes(150000):strip_icc()/Marginal-analysis_final-f9a1ee0a66434f409faed9388f00a5d9.png)
:max_bytes(150000):strip_icc()/GettyImages-958271424-f3ba20e3eed44d3789d442353cf9b5c9.jpg)
:max_bytes(150000):strip_icc()/graham-number.asp-final-ce508e6a898b4d2394792c6ac3708705.png)
:max_bytes(150000):strip_icc()/GettyImages-953844116-24b032c1aa4c4ccda29e710f6d869d48.jpg)
:max_bytes(150000):strip_icc()/Investopedia-terms-conditional-probability-f3cc2756d48049679c41b5ec03f4e9e0.jpg)
:max_bytes(150000):strip_icc()/Terms-s-sampling-distribution-resized-484f7bd60d624729b426ac9f68a80912.jpg)
:max_bytes(150000):strip_icc()/Stockholdersequity_Sketch_final-5230009146b749cc85d8b57339a52dad.png)
:max_bytes(150000):strip_icc()/Term-Definitions_hypothesistesting-4981dc2cf6024d7ca9f5497ab86cee73.jpg)
:max_bytes(150000):strip_icc()/5843577306_1a98149efb_o-0a8b0741787f46f29bda99134fe1d21a.jpg)
:max_bytes(150000):strip_icc()/Grosssales_final-ec3d34fc5f5c43ac867979882c47c807.png)
:max_bytes(150000):strip_icc()/GettyImages-1453639790-26a1e44e917648e288ea49102c95f515.jpg)
:max_bytes(150000):strip_icc()/Analysis-of-Variance-645cb3fcf9e540339e1c80d0e6528dce.jpg)