Академический Документы
Профессиональный Документы
Культура Документы
A t-test is a statistical test that is used to compare the means of two groups. It is often
used in hypothesis testing to determine whether a process or treatment actually has an
effect on the population of interest, or whether two groups are different from one
another.
You want to know whether the mean petal length of iris flowers differs according to their
species. You find two different species of irises growing in a garden and measure 25
petals of each species. You can test the difference between these two groups using a t-
test.
The null hypothesis (H0) is that the true difference between these group means is
zero.
The alternate hypothesis (Ha) is that the true difference is different from zero.
Table of contents
1.
2.
3.
4.
5.
6.
The t-test is a parametric test of difference, meaning that it makes the same
assumptions about your data as other parametric tests. The t-test assumes your data:
1. are independent
2. are (approximately) normally distributed.
3. have a similar amount of variance within each group being compared (a.k.a.
homogeneity of variance)
If your data do not fit these assumptions, you can try a nonparametric alternative to the
t-test, such as the Wilcoxon Signed-Rank test for data with unequal variances.
If the groups come from a single population (e.g. measuring before and after an
experimental treatment), perform a paired t-test.
If the groups come from two different populations (e.g. two different species, or
people from two separate cities), perform a two-sample t-
test (a.k.a. independent t-test).
If there is one group being compared against a standard value (e.g. comparing
the acidity of a liquid to a neutral pH of 7), perform a one-sample t-test.
If you only care whether the two populations are different from one another,
perform a two-tailed t-test.
If you want to know whether one population mean is greater than or less than the
other, perform a one-tailed t-test.
Performing a t-test
The t-test estimates the true difference between two group means using the ratio of the
difference in group means over the pooled standard error of both groups. You can
calculate it manually using a formula, or use statistical analysis software.
T-test formula
The formula for the two-sample t-test (a.k.a. the Student’s t-test) is shown below.
In this formula, t is the t-value, x1 and x2 are the means of the two groups being
compared, s2 is the pooled standard error of the two groups, and n1 and n2 are the
number of observations in each of the groups.
A larger t-value shows that the difference between group means is greater than the
pooled standard error, indicating a more significant difference between the groups.
You can compare your calculated t-value against the values in a critical value chart to
determine whether your t-value is greater than what would be expected by chance. If
so, you can reject the null hypothesis and conclude that the two groups are in fact
different.
In your comparison of flower petal lengths, you decide to perform your t-test using R.
The code looks like this:
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) 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 averages. 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.
Still having trouble? Chegg.com will math you with a virtual tutor (and your first 30 minutes is free!).
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.