Settings

The test

The numbers

One value a line, or separated by spaces or commas. Paste a column straight from a spreadsheet.

The result

For the write-up


    
How it works

T-TEST works from two columns pasted from a spreadsheet, or from the summary figures printed in a paper. Levene's test sits beside the independent test so the choice between Student and Welch is in view, and every figure is held to SciPy. Nothing typed here leaves this tab.

What it does, and what it does not

A t-test asks whether a difference in means is larger than the scatter in the data would produce by chance. This page runs the four common versions: two independent groups with equal variances assumed (Student) or not (Welch), the same people measured twice (paired), and one group against a fixed value. The p-value is worked out from Student's t distribution directly, not looked up in a table, and the confidence interval uses the same distribution, so the two always agree.

It does not test three or more groups (that is an analysis of variance), and it does not run the rank-based tests, Mann–Whitney and Wilcoxon, that suit small samples far from normal. It does not check normality beyond what you can see, and it does not work out how many people a study needs. It does not correct for running many tests. Missing values are simply left out: in paired data a line with a value missing on either side is dropped, and the count says so.

The convention used for each figure is stated beside it. Cohen's d for two groups is over the pooled standard deviation whichever test is chosen, and Hedges' g is shown with it for small samples. The one-tailed p is in the direction the difference went, which is only fair if that direction was predicted. Every figure is held to SciPy in this site's own tests. To describe a single column first, FIGURES does that, and CHI-SQUARE tests counts rather than scores.

The guide: An SPSS alternative that opens .sav files in your browser

Questions people ask about T-TEST

Should I use Student’s t-test or Welch’s?

Welch’s, unless you have a reason not to. Student’s test assumes the two groups have the same variance; Welch’s does not, and when the variances are in fact equal it gives almost the same answer. When they are not, and especially when the smaller group has the larger spread, Student’s p-value can be badly wrong. Both are shown here side by side, with Levene’s test, so the choice is visible.

What is the difference between a one-tailed and a two-tailed p-value?

A two-tailed p asks how surprising a difference this large would be in either direction; a one-tailed p asks only about the direction you predicted, and is half the size when the result goes that way. A one-tailed test is honest only when the direction was fixed before the data were seen, which reviewers often doubt. The page gives both and labels which is which.

Can I run a t-test from a paper’s means and standard deviations?

Yes. Choose 'The n, mean and SD' and type them in. That is enough for Student’s and Welch’s tests, the confidence interval and Cohen’s d. Levene’s test needs the raw scores, so it is left out. For a paired test from a paper you need the mean and SD of the differences, which are not the same as the two means and SDs.

What does Cohen’s d mean here?

The difference in means divided by a standard deviation, so it says how big the difference is in units of spread rather than in the units of the scale. For two groups it is the pooled SD; for paired data it is the SD of the differences (often written d_z); for one sample, the sample’s SD. Cohen’s labels of 0.2 small, 0.5 medium and 0.8 large were offered as a last resort, not a rule.

Are the numbers right?

Each figure is checked against SciPy, the standard scientific library for Python, on a set of data sets including skewed ones, tiny ones and one whose p-value is about one in a quadrillion: t, degrees of freedom, both kinds of p, the confidence interval, Cohen’s d and Levene’s test agree to at least nine significant figures.

Doing this often? OBSCURA Gnosis runs t-tests on the columns of a whole data set, with ANOVA, the non-parametric tests and regression beside them, and APA tables saved to Word. On its own, US$2 a month; with everything else, US$5 a month or US$48 a year.