t-Test: How to Run It Online and Report It in APA7
A t-test compares means. Which version you need depends on the design: one sample against a known value, two independent groups, or two related measurements.
What is t-Test?
A t-test compares means. Which version you need depends on the design: one sample against a known value, two independent groups, or two related measurements.
When to use it
Use a t-test to compare one or two means on a continuous outcome. For three or more groups use ANOVA instead.
Example question: Do the two groups differ in mean exam score?
Preparing your data
Independent groups: one row per participant with a group column and an outcome column. Paired data: one row per participant with two columns (before and after). One sample: one outcome column and the value to test against.
Example dataset (simulated; first rows of 70): id, group (Treatment or Control), anxiety (scale score); long format.
| id | group | anxiety |
|---|---|---|
| 1 | Treatment | 20.6 |
| 2 | Treatment | 11.7 |
| 3 | Treatment | 19.2 |
| 4 | Treatment | 14.0 |
| 5 | Treatment | 18.1 |
| 6 | Treatment | 20.0 |
Download the full example CSV to practise. If the tool asks for a different layout, follow the instructions on its page.
How to run it on StatFas
- Open the t-Test tool. You do not need an account to run an analysis.
- Enter your data or upload your file, laid out as described in Preparing your data.
- Select your variables. Pick the version that matches your data, then select the outcome and, for independent groups, the grouping variable.
- Choose any options the tool offers (for example the confidence level, a post hoc test or the error bar type) and run the analysis.
- Read the results on the page. Check the assumptions first, then the test statistic, the p-value and the effect size.
- To save your results, log in or create a free account. Every analysis stays free; the account is only needed to download.
Assumptions and checks
- The outcome is continuous (interval or ratio).
- Observations are independent within and between groups, except in a paired design.
- The outcome is roughly normal in each group, or the sample is large (about 30 or more per group).
- For the independent test, Welch's version does not require equal variances and is a safe default.
Key numbers to look at
- t statistic, degrees of freedom and p-value.
- Means and standard deviations for each group.
- Mean difference with 95% CI.
- Cohen's d as the effect size.
Effect size
Cohen's d: about 0.2 small, 0.5 medium, 0.8 large. Report it with a confidence interval where possible.
Benchmarks such as small, medium and large are conventions (Cohen, 1988), not rules. Interpret size in the context of your field.
Reporting t-Test in APA7 style
Template
Paired: scores increased from pre-test to post-test, t(df) = X.XX, p = .XXX, dz = X.XX.
One sample: scores differed from the benchmark, t(df) = X.XX, p = .XXX, d = X.XX.
Worked example (simulated data)
The numbers below were computed from the example CSV above, so you can reproduce them. They illustrate the format and are not real findings.
APA7 reminders: italicise statistical symbols (M, SD, t, F, p, r), report exact p-values to two or three decimals (use p < .001 for very small values), omit the leading zero for values that cannot exceed 1 (.45, not 0.45), and put degrees of freedom in parentheses. See the APA7 cheat sheet.
Common mistakes
- Running several t-tests for three or more groups; use ANOVA.
- Using an independent test for the same people measured twice.
- Reporting only the p-value without means and effect size.
Related analyses and alternatives
- Independent t-Test: Two separate groups.
- Paired t-Test: The same people measured twice.
- One sample t-Test: One group against a known value.
- Mann-Whitney U-test: Non-normal data and two independent groups.
Not sure which analysis you need? Use the test chooser.
Frequently asked questions
Which t-test should I use?
One group versus a known value: one-sample. Two different groups: independent. The same people (or matched pairs) measured twice: paired.
What if my data are not normal?
With large samples the t-test is fairly robust. For small samples or strong skew use the Mann–Whitney U test (independent) or the Wilcoxon signed-rank test (paired).
References
American Psychological Association. (2020). Publication manual of the American Psychological Association (7th ed.). https://doi.org/10.1037/0000165-000
Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
This guide is for learning and for preparing results for your own reports. You remain responsible for choosing an appropriate analysis, checking its assumptions and interpreting the results. Follow the formatting rules of your journal or institution where they differ from APA7.