T-Test

  • Assumptions to check:

    • Each sample has been randomly selected from the populations from which the samples are derived. 

    • The distribution of data in the underlying population from each of the samples is derived is normal. Normal distribution (testable by e.g. Kolmogorov–Smirnov test, Shapiro–Wilk test, the Anderson-Darling test, Q-Q plot)

    • The variances of the underlying population represented by populations are equal. Equal variances (homoscedasticity) of the group samples (testable by e.g. F-test, Levene’s test, Bartlett’s test, Brown-Forsythe test)

    • Group independence (for independent/unpaired test) or full dependence (for dependent/paired test)

  • Report design in methods section 

    • Is this a one or two group test?

    • For two groups: is it paired (dependent groups) or unpaired (independent groups) test? 

    • One or two tails? Justify the use of one tail test, if applicable. 

    • Name the statistical package or program used in the analysis

  • Report statistics in results section

    • The t-statistic, degrees of freedom and exact p-value. 

    • Strongly recommended: report effect size (e.g Cohen’s) with confidence intervals.

    • Report on assumptions.

Examples

  • One sample: 

    • Methods section:  The hypothesis was checked with one sample t-test with two tails. We used  SPSS (RRID:SCR_002865) to perform the  analysis. 

    • Results section: A one sample t-test showed a statistically significant difference between the cholesterol level of patients on the provided diet  compared to the norm of 200 mg/dL (t(28)=2.16, p=0.039, CI=[185, 194]). The effect size, as measured as Cohen’s d=0.61, indicates a medium effect. 

Static Degrees of freedom df Significance p-value Confidence interval Effect size
Factor t=2.16 df=28 p=0.039 CI=[185, 194] d=0.61

According to the Shapiro-Wilk and Levene tests, the normality (W=0.955, p=0.77) and homoscedasticity (F=2.428, p=0.122) assumptions were not violated.  

  • Two independent samples:

    • Methods section: Hypothesis was checked with an independent two-tailed t-test. We used GraphPad Prism (RRID:SCR_002798) to perform the  analysis. 

    • Results section: Hypothesis was checked with the  independent two-tailed t-test which indicated a statistically significant difference in measurements between the group getting placebo and the group getting the medicine(t(35)=2.52, p=0.022,  95% CI=[114, 183] with effect size measured with Cohen’s d=0.55 -medium effect)

Static Degrees of freedom df Significance p-value Confidence interval Effect size
Placebo/medicine t=2.52 df=35 p=0.022 [114,183] 95% 0.55 (Cohen)

According to the Shapiro-Wilk and Levene tests, the normality (W=0.955, p=0.77) and homoscedasticity (F=2.428, p=0.122) assumptions were not violated.  

  • Two dependent samples:

    • Methods section: To check significance of the difference for before and after treatment results we  used two tailed t-test for dependent samples. To perform the analysis we used Microsoft Excel  (RRID:SCR_016137).

    • Results section: We used two tails paired samples t-test, which indicated a significant difference between the groups before and after treatment (t=5.180, df=99, p=0.001, 95% CI=[0.17,1.83] with effect size measured with Cohen’s d=0.518 -medium effect)

Static Degrees of freedom df Significance p-value Confidence interval Effect size
Before/after t=5.180 df=99 p=0.001 [0.17,1.83] 95% 0.518 (Cohen)

According to the Shapiro-Wilk test, the normality assumption was not violated (W=0.976, p=0.063).