The t-test: When you use it When you wish to compare the difference between two groups for a continuous (or discrete) variable Examples Blood pressure comparing men to women Caloric intake comparing anorexics to non-anorexics Change in LDL comparing treatment group to placebo group
The t-distribution family
Example t-test 1. Establish alpha. α = Write H 0 : μ cases = μ controls 3. Calculate t-ratio or t-score
Interpret results of t-test 4. Compare t obs (3.495) with known t-distribution to obtain p-value. p ≈ *(Note: d.f. = sample size – 2) 5. Since p < α, we reject H 0 and conclude that there is a statistically significant difference in age between the cases and controls. i.e. cases, on average, are older than controls. … *Note: For very large samples, the t-distribution is almost identical to the normal distribution.
For a test statistic of 3.495, the p-value is less than alpha. Note: two-sided 2.5% Test statistic (3.495) P-value Visualizing the p-value
Caveats to the t-test 1. Requires normally distributed data If not, use Wilcoxon Rank Sum (Mann-Whitney) test. 2. Observations must be independent If they’re paired (e.g. pre-post), use a paired t-test. 3. The t-test works only for comparisons of two groups. If there are 3 or more groups, use analysis of variance (ANOVA).
Confidence interval method Analog to the t-test 1. Calculate 95% confidence intervals for the two group means. 2. If the confidence interval of one group includes the mean of the other, then the difference is not statistically significant. Not a stat. sig. difference (p > 0.05) Stat. sig. difference (p < 0.05) Group A Group B