ANOVA and t-Test Calculator for CSV
Operator: Abdulla Al Fahad. How tools are built and checked
Thirty plants, three treatments, and one question: are the average weights really different, or could the gap be chance? The t-test answers it for two groups and one-way ANOVA for three or more. This page runs both from a CSV or XLSX file, shows the working, and checks the assumptions that decide whether the answer can be trusted.
Alongside each test it reports what a careful analyst would look at next: an equal-variance check, an effect size, the pairwise comparisons that ANOVA alone does not give you, and a rank-based test that does not depend on normal data. It is not a replacement for a statistics course. It will not tell you whether the groups were randomised or whether the measurements are independent, and those matter more than any p-value. It sits beside the A/B Test Significance Calculator, which handles yes/no conversion counts, while this one is for continuous measurements.
Key features
- One-sample, Student, Welch and paired t-tests with p-values, intervals and mean differences
- One-way ANOVA table with sums of squares, mean squares, F and p, plus Welch's ANOVA for unequal variances
- Tukey HSD (Tukey-Kramer for unequal n) from the studentized range distribution, with adjusted p-values and intervals
- Levene's test in the median-centred Brown-Forsythe form or the original mean-centred form
- Effect sizes: Cohen's d, Hedges g, d_z for paired data, eta squared, omega squared and Cohen's f
- Mann-Whitney U (exact without ties up to 25 per group, normal approximation with tie and continuity corrections) and Kruskal-Wallis with tie correction
- Group means plot with confidence intervals and every observation visible
- Plain-language verdict lines, and warnings for small samples, skew, unequal variance and unequal n
- CSV and multi-sheet XLSX export of every table
Which test runs, what it assumes and what else is reported beside it
Choose one of four tests. One-way ANOVA with Tukey HSD takes three or more groups (up to 20). The independent t-test takes exactly two groups and reports both the Student (equal variance) and the Welch (unequal variance) version. The paired t-test takes two columns from the same subjects and uses only the rows where both have a number. The one-sample t-test compares each selected group's mean with a target value you enter.
Data can be long or wide. A long file has a group column and a value column, with one row per observation, for example group and weight; groups are taken in order of first appearance and you can untick groups you do not want. A wide file has one numeric column per group and groups of different sizes simply have empty cells. The layout and columns are guessed from the headers and the data, and you can change them. Rows with a blank or non-numeric value are skipped and counted in a note, never silently turned into zeros. Files can be up to 25 MB and 300,000 rows.
Every run shows descriptive statistics per group: n, mean, standard deviation, standard error, median, minimum, maximum, skewness (the adjusted Fisher-Pearson formula Excel uses) and a confidence interval for the mean at the level you choose, 95 percent by default. Warnings appear when a group has fewer than 10 values, when skewness exceeds 1 in size, when Levene's test rejects equal variances, and when group sizes differ so that the Tukey-Kramer adjustment is in force.
Results can be downloaded as a CSV that stacks every table one after another, or as an XLSX with one sheet per table. The plot shows every observation as a faint dot, the group mean as a solid dot and the confidence interval as a bar, with a dashed reference line at the target for a one-sample test.
How it works
The t statistics use the standard formulas: one-sample t is (mean minus target) over s over the square root of n with n minus 1 degrees of freedom; the Student test pools the variance; the Welch test uses the unpooled standard error and the Welch-Satterthwaite degrees of freedom, which are fractional; the paired test is a one-sample test on the differences. Two-sided p-values come from the incomplete beta function, accurate to about 1e-13.
The ANOVA F is the between-group mean square over the within-group mean square. Tukey HSD compares each pair with q = |difference| / the square root of (MSwithin / 2 times (1/ni + 1/nj)) and finds its p-value from the studentized range distribution, the range of k normal means scaled by an independent chi-square estimate of sigma. The distribution is evaluated as R's ptukey does it, by Gauss-Legendre quadrature of the range density following Copenhaver and Holland (1988), and critical values come from inverting it. Checked against published tables, the 95 percent critical q is 3.877 for 3 groups and 10 degrees of freedom, 3.958 for 4 and 20, 4.102 for 5 and 30, and for 2 groups it equals the square root of 2 times the t quantile, 3.151 at 10 degrees of freedom.
Levene's test runs an ANOVA on the absolute deviations from each group's centre; with the median as the centre it is the Brown-Forsythe variant, which holds up better on skewed data. Effect sizes: Cohen's d divides the mean difference by the pooled standard deviation, and Hedges g multiplies it by the small-sample correction 1 minus 3/(4 df minus 1). Eta squared is SSbetween over SStotal, omega squared subtracts the expected chance contribution and is the less biased estimate.
Mann-Whitney ranks both groups together, assigning tied values their average rank. Without ties and with each group at most 25 values the p-value is exact, from the full distribution of U. Otherwise it uses a normal approximation with the tie-corrected variance and a continuity correction. Kruskal-Wallis sums ranks per group, divides by the tie correction 1 minus the sum of (t cubed minus t) over N cubed minus N, and refers H to a chi-square distribution.
Common use cases
- Comparing yield, test scores or response times across three or more treatment groups from a lab or classroom spreadsheet
- Testing a before-and-after measurement on the same patients, machines or stores with a paired t-test
- Checking whether a sample mean differs from a specification target or a published benchmark
- Confirming that a significant ANOVA is driven by one pair and not all of them, using Tukey HSD
- Cross-checking a t-test with Mann-Whitney on small, skewed samples before reporting
How to use this tool
- Select the test, then upload the file or load one of the two textbook examples.
- Confirm the layout: for long data pick the group and value columns, for wide data tick the group columns, for paired data choose the two measurement columns.
- Read the verdict lines first, then the warnings, then the tables. Look at the plot for a sense of overlap.
- Download the CSV or XLSX to attach the tables to a report.
Example
R's PlantGrowth data: dry weight for a control and two treatments, 10 plants each (load example)
group,weight
ctrl,4.17
ctrl,5.58
... (30 rows: ctrl, trt1, trt2)One-way ANOVA, 95%
ANOVA F(2, 27) = 4.846, p = 0.0159; SSbetween 3.766, SSwithin 10.492, eta squared 0.264, omega squared 0.204
Levene median-centred F = 1.119, p = 0.341 (equal variances not rejected)
Welch ANOVA F = 5.181, df 2 and 17.13, p = 0.0174
Tukey HSD trt2 minus trt1 = 0.865 (0.174 to 1.556), adjusted p = 0.0120; ctrl vs trt1 p = 0.391; ctrl vs trt2 p = 0.198
Kruskal H = 7.988, df 2, p = 0.0184Tips for best results
- Report the effect size next to the p-value. In the example eta squared of 0.264 says group membership explains about a quarter of the variation in weight, which is more useful than p of 0.0159 alone.
- Treat the Mann-Whitney and Kruskal-Wallis rows as a sanity check. If they agree with the parametric test you are on safe ground; if they disagree, the data is probably skewed or has outliers and deserves a closer look.
- Do not run Tukey after a non-significant ANOVA hunting for a pair. The tool will compute it, but the family-wise error rate was designed around following up a significant overall test.
- For paired data keep the rows aligned. Pairing is by row position, so sorting one column in the sheet before upload destroys the pairs.
Common pitfalls
Independence is assumed and cannot be tested here. Repeated measures on the same subject analysed as independent groups give p-values that are far too small; use the paired test or a repeated-measures method.
A significant ANOVA does not say which groups differ, and a non-significant one does not prove they are equal. Absence of significance with n of 5 per group mostly reflects the small sample.
Normality matters most with small groups. With under 10 values per group the tool warns, because histograms and skewness cannot confirm a bell shape from so few points.
Many tests, many chances. Running ten t-tests on ten columns and reporting the one with p under 0.05 is a classic way to find a false effect; Tukey adjusts for pairs within one ANOVA, not for tests you ran separately.
Very large samples make trivial differences significant. A difference of 0.01 with n of 100,000 can have p under 0.0001 and d of 0.02, which is no practical difference at all.
Common errors and how to fix them
- "An independent t-test compares exactly two groups"
- You have selected more or fewer than two groups. Untick the extra groups, or switch the test to one-way ANOVA for three or more.
- "Fewer than 2 rows have a number in both columns"
- The two paired columns do not overlap on any row. Check that both are numeric and that the subjects share rows rather than sitting in separate blocks.
- Welch ANOVA and Levene are missing
- A group has a single value, so its variance is undefined. Those groups count toward the means but not the spread, so the variance-based checks are skipped.
Checking the tool against R and SPSS
The two bundled examples are standard teaching datasets with published answers. For PlantGrowth, R's aov gives F of 4.846 and p of 0.01591, and TukeyHSD gives trt2 minus trt1 as 0.865 with an adjusted p of 0.012 and an interval of 0.174 to 1.556: the same figures the tool prints. For the sleep study, a paired t-test of the two drugs on 10 patients gives t(9) of minus 4.062, p of 0.002833 and an interval of minus 2.46 to minus 0.70.
Treat the same 10-plus-10 sleep readings as independent groups and the tests disagree in an instructive way: Welch gives t of minus 1.861 on 17.78 degrees of freedom, p of 0.0794; Student gives p of 0.0792; and Mann-Whitney, with ties, gives U of 25.5 and p of 0.0693 by normal approximation. None reaches 0.05, which is exactly why the paired design is more powerful: it removes the patient-to-patient variation that the independent test has to absorb.
What a wrong column choice looks like
Load the sleep study, leave the test on paired and pick patient as the first measurement instead of drug_1. The patient column is just 1 to 10, so the tool pairs a row number with a reading and returns t(9) = 5.58, a confident but meaningless result. The right pair, drug_1 against drug_2, gives t(9) = -4.062. The tool skips id-like columns and counters when it guesses columns for you, but if you choose by hand it has no way to know a number is an identifier. When a t statistic looks too good, check that both columns are measurements of the same thing on the same subjects.
Frequently asked questions
Which t-test should I report when I have two groups?
The Welch test is a safe default because it does not assume equal variances and loses very little when they are equal. The summary line uses Welch when Levene's test rejects equal variances and Student otherwise; both rows are always shown.
Why are Tukey p-values larger than the plain t-test p-values?
Tukey adjusts for making every pairwise comparison at once, so the chance of at least one false positive across all pairs stays at your alpha. The price is that each single comparison needs a bigger difference to count.
What does omega squared add over eta squared?
Eta squared overstates the effect in the population because it counts chance variation between groups. Omega squared subtracts that expected chance amount, so it is smaller, notably with small samples, and a better estimate of the true effect.
Can I test more than one factor, such as two-way ANOVA?
No. This tool handles one grouping factor. Two-way ANOVA and repeated-measures designs need a different model, and results from forcing them into one-way groups would be misleading.