Comparing two groups: T-test
The t-test is a statistical test that compares the means of two groups of observations. The observations should be randomly assigned to the two groups, so that any difference in response is due to the treatment and not to other factors. For instance in a medical study patients with high blood pressure are randomly assigned to a placebo group and a treatment group. The patients in the placebo group receive an inactive pill and the patients in the treatment group receive a new drug that is expected to lower blood pressure. After treating the subjects, the t test is used to compare the average blood pressures level for the placebo group and the treatment group.
Consider the following fictitious data:
Group bloodpressure
treatment 88
treatment 83
treatment 82
treatment 101
treatment 99
treatment 85
treatment 87
treatment 89
treatment 88
placebo 88
placebo 82
placebo 101
placebo 106
placebo 96
placebo 92
placebo 112
placebo 120
placebo 97
There are two groups, treatment and placebo. The null hypothesis in the t-test is that mean of the treatment is equal to the mean of the placebo group.
| Group | N | Mean | | | placebo | 9.0 | 99.33333 | | | treatment | 9.0 | 89.11111 | |
| Test Statistic | df | p-value | | 2.25094 | 16.0 | 0.0388 |
|