“ T Test (Student’s T-Test)”


  1. What is a T Test?
  2. The T Score
  3. T Values and P Values
  4. Calculating the T Test
  5. What is a Paired T Test (Paired Samples T Test)?

What is a T test?

The t test tells you how significant the differences between groups are; In other words it lets you know if those differences (measured in means/averages) could have happened by chance. A very simple example: Let’s say you have a cold and you try a naturopathic remedy. Your cold lasts a couple of days. The next time you have a cold, you buy an over-the-counter pharmaceutical and the cold lasts a week. You survey your friends and they all tell you that their colds were of a shorter duration (an average of 3 days) when they took the homeopathic remedy. What you really want to know is, are these results repeatable? A t test can tell you by comparing the means of the two groups and letting you know the probability of those results happening by chance.

Another example: Student’s T-tests can be used in real life to compare means. For example, a drug company may want to test a new cancer drug to find out if it improves life expectancy. In an experiment, there’s always a control group (a group who are given a placebo, or “sugar pill”). The control group may show an average life expectancy of +5 years, while the group taking the new drug might have a life expectancy of +6 years. It would seem that the drug might work. But it could be due to a fluke. To test this, researchers would use a Student’s t-test to find out if the results are repeatable for an entire population.

The T Score.

The t score is a ratio between the difference between two groups and the difference within the groups. The larger the t score, the more difference there is between groups. The smaller the t score, the more similarity there is between groups. A t score of 3 means that the groups are three times as different from each other as they are within each other. When you run a t test, the bigger the t-value, the more likely it is that the results are repeatable.

A large t-score tells you that the groups are different. A small t-score tells you that the groups are similar.

T-Values and P-values

How big is “big enough”? Every t-value has a p-value to go with it. A p-value is the probability that the results from your sample data occurred by chance. P-values are from 0% to 100%. They are usually written as a decimal. For example, a p value of 5% is 0.05. Low p-values are good; They indicate your data did not occur by chance. For example, a p-value of .01 means there is only a 1% probability that the results from an experiment happened by chance. In most cases, a p-value of 0.05 (5%) is accepted to mean the data is valid.

Calculating the Statistic / Test Types

There are three main types of t-test:

  1. An Independent Samples t-test compares the means for two groups.
  2. A Paired sample t-test compares means from the same group at different times (say, one year apart).
  3. A One sample t-test tests the mean of a single group against a known mean.

What is a Paired T Test (Paired Samples T Test / Dependent Samples T Test)?

A paired t test (also called a correlated pairs t-test, a paired samples t test or dependent samples t test) is where you run a t test on dependent samples. Dependent samples are essentially connected — they are tests on the same person or thing. For example:

Knee MRI costs at two different hospitals, Two tests on the same person before and after training, Two blood pressure measurements on the same person using different equipment.

Paired Samples T Test fomula

[t=\frac{\left(\sum D\right) / N}{\sqrt{\frac{\sum D^{2}-\left(\frac{\left(\sum D\right)^{2} )}{N}\right)}{(N-1)(N)}}}]

\(\Sigma D\): Sum of the differences

\(\Sigma D^{2}\): Sum of the squared differences

\((\Sigma D)^{2}\): Sum of the differences, squared.

Find the p-value in the t-table, If you don’t have a specified alpha level, use 0.05 (5%). For example, with df=10, the t-value is 2.228.

Compare your t-table value from above step (2.228) to your calculated t-value (let’s say -2.74). The calculated t-value is greater than the table value at an alpha level of .05. The p-value is less than the alpha level: p <.05. We can reject the null hypothesis that there is no difference between means.



Hi, I'm Yong Huang. I've recently graduated from Cornell Tech and obtained my master's degree, I shall start my Ph.D. in Computer Science this fall at UC Irvine. Thank you for visiting my site.