One-way ANOVA with Tukey, and exporting the results
On this page
Goal
Compare three treatment groups. By the end you will have an ordinary one-way ANOVA with Tukey comparisons, know how to switch to Dunnett, Welch, or Kruskal–Wallis when the data call for it, and have a graph with significance brackets or Compact Letter Display (CLD) letters, ready to export.
You need: CurveBook installed and the basics from the first curve-fit tutorial.
Seeded dataset
Clean-room synthetic cytokine measurements (pg/mL, n = 6 replicates per group) in a Column table (Cytokine Assay):
Vehicle | Low Dose | High Dose |
|---|---|---|
10.2 | 14.8 | 24.1 |
11.1 | 15.5 | 25.8 |
9.8 | 14.2 | 23.4 |
10.6 | 16.0 | 26.2 |
10.4 | 15.1 | 24.9 |
10.9 | 15.4 | 25.0 |
Desktop app steps
1. Create the column table
- On Welcome to CurveBook, click New Data Table, then Column, then Create Table.
- Name the columns
Vehicle,Low Dose, andHigh Dose. - Paste the dataset above into the grid.
You should see: three filled columns, plus a linked column graph in the Navigator under Graphs.
2. Run the one-way ANOVA
- Click Analyze on the toolbar (
Cmd/Ctrl+Shift+A). - Type
anovain the search box, choose One-Way ANOVA and Nonparametric Alternatives, and click OK.
You should see: a results sheet with an ordinary one-way ANOVA. No post-hoc test is applied yet.
3. Add Tukey comparisons
- With the results sheet open, choose Analyze › Change Analysis Parameters… (
Cmd/Ctrl+Alt+P). - On the Multiple Comparisons tab, choose Tukey HSD (all-pairwise equal variance).
- Click OK.
You should see: a multiple-comparisons table with the mean difference, 95% confidence interval, and adjusted P value for every pair.
4. Check assumptions, and switch test if needed
Read the assumption banner at the top of the results sheet. It reports normality and equal-variance checks but never switches the test for you. Open Analyze › Change Analysis Parameters… again and pick the case that fits:
- Compare each dose with Vehicle only: on Multiple Comparisons, choose Dunnett (every group vs. control column).
- Group variances look unequal: on Experimental Design, click Welch.
- Data are skewed or ordinal: on Experimental Design, clear Assume Gaussian (Parametric). Then, on Multiple Comparisons, choose Dunn's rank-sum comparisons (nonparametric).
Click OK. You should see: the results sheet recalculated with the new method.
5. Add significance brackets or CLD letters
- Open the column graph from the Navigator.
- Choose Graph › Pairwise Comparisons….
- Click Auto-Add Comparisons.
- Under Display Mode, choose Brackets Only, CLD Only, or Brackets + CLD. Under Labels, choose Stars or Numeric p/q.
You should see: brackets or letters (A, B, …) above the bars. Change a value in the table and they update by themselves.
CLI and MCP steps
Save the dataset as cytokine.csv and run this curvebook.batch.v1 manifest (anova-workflow.json):
{
"schema": "curvebook.batch.v1",
"inputs": [
{
"path": "cytokine.csv",
"sheet": "data-1",
"kind": "column"
}
],
"commands": [
{
"cmd": "stats.run",
"params": {
"sheet_id": "anova-tukey",
"source_sheet_id": "data-1",
"kind": "one_way_anova",
"multiplicity": "tukey",
"title": "One-way ANOVA (Tukey)"
}
},
{
"cmd": "stats.run",
"params": {
"sheet_id": "anova-dunnett",
"source_sheet_id": "data-1",
"kind": "one_way_anova",
"multiplicity": "dunnett",
"title": "One-way ANOVA (Dunnett vs Vehicle)"
}
},
{
"cmd": "stats.run",
"params": {
"sheet_id": "anova-welch",
"source_sheet_id": "data-1",
"kind": "welch_anova",
"title": "Welch ANOVA"
}
},
{
"cmd": "stats.run",
"params": {
"sheet_id": "kruskal-dunn",
"source_sheet_id": "data-1",
"kind": "kruskal_wallis",
"multiplicity": "dunn",
"title": "Kruskal-Wallis (Dunn)"
}
},
{
"cmd": "graph.create",
"params": {
"sheet_id": "graph-anova",
"data_sheet_id": "data-1",
"kind": "column",
"title": "Cytokine response by dose"
}
},
{
"cmd": "graph.addComparisonBrackets",
"params": {
"sheet_id": "graph-anova",
"result_sheet_id": "anova-tukey",
"significant_only": true
}
},
{
"cmd": "graph.setCompactLetterDisplay",
"params": {
"sheet_id": "graph-anova",
"result_sheet_id": "anova-tukey",
"enabled": true,
"pairwise_display_mode": "brackets_and_cld"
}
},
{
"cmd": "analysis.exportCsv",
"params": {
"sheet_id": "anova-tukey",
"path": "anova-tukey-results.csv"
}
},
{
"cmd": "analysis.exportJson",
"params": {
"sheet_id": "anova-tukey",
"path": "anova-tukey-results.json",
"pretty": true
}
},
{
"cmd": "result.generateReport",
"params": {
"result_sheet_id": "anova-tukey",
"format": "markdown",
"path": "anova-methods.md"
}
}
],
"exports": [
{ "out": "anova-study.curvebook", "format": "curvebook" },
{ "sheet": "graph-anova", "out": "anova-figure.svg", "format": "svg" },
{ "sheet": "graph-anova", "out": "anova-figure.pdf", "format": "pdf" }
]
}
Execute the workflow from the terminal:
curvebook-cli batch anova-workflow.json --workdir . --json
In an MCP client, send the same command sequence through command_run (or table.importCsv followed by stats.run, graph.create, graph.addComparisonBrackets, graph.setCompactLetterDisplay, analysis.exportCsv, analysis.exportJson, result.generateReport, and export.svg / export.pdf).
Reading the results
- Omnibus ANOVA tab: Check the F statistic, numerator and denominator degrees of freedom, P value, and effect sizes (R2, η2, ω2).
- Multiple Comparisons tab: Read each pair's mean difference, family-wise 95% confidence interval, multiplicity-adjusted P value, and significance summary.
- Diagnostics banner: Brown–Forsythe tests variance equality using medians (more robust to non-normality than Bartlett's test). If variance equality is doubtful, compare the Welch ANOVA W statistic and P value alongside the ordinary ANOVA.
- CLD letters: Groups that do not share a letter differ at the chosen family-wise α (default
0.05). - For formulas, degrees-of-freedom rules, and literature references, see Statistical analyses reference and Graphs and page layouts.
Exporting
- Results tables: open the results sheet and choose File › Export › Results (CSV)…. Pick one tab or all tabs, the delimiter, and the decimal separator.
- Full results as JSON: File › Export › Results (JSON)….
- Methods paragraph: File › Export › Methods Report… (
.md,.txt, or.tex). - Figure: open the graph, choose File › Export › Figure…, pick SVG (Vector) or PDF (Vector), and click Export.