# Two-way ANOVA

`stats_two_way_anova` is a tool of the Drybench MCP server. It runs the same engine and reporting rules as Drybench Assay.

## What it answers

Required: unit (independent, technical, unspecified); type (2, 3). Two-way ANOVA for two crossed factors with replicates per cell: Type III or Type II sums of squares for A, B, and A:B, with optional simple effects of B within each level of A. Inference opens only for independent units.

**Limits:**

- A C50 estimated here describes this assay under these conditions and is not a binding constant.
- It computes from the inputs it receives. It does not check the person's data, design or sample.
- Every computed number a reply returns, other than an integer or an exact decimal, is rounded once to 12 significant figures: to the nearest, a change of at most 5 × 10⁻¹² of its value, except that a lower bound is rounded down and an upper bound up, a change of less than 1 × 10⁻¹¹; the method computes, and decides any pass or fail, on the unrounded value.

> Research and education software; not for diagnosis or treatment decisions.
>
> Not medical advice. Nothing here is advice about any medicine, treatment or condition, and nothing here is an assessment of any person's variant, sample or molecule. Decisions made with it are yours.
>
> Not a forecast. Stages, scores, rates, rankings and similarities shown here describe records as they stand, or historical averages; they are not a forecast for any molecule, trial, drug, company or target.

## What this page can and cannot show

Weakest level among this tool's methods: Checked against a reference. Reference kind not recorded for 1 of 1 methods.

Not fully recorded, and not independently reviewed. Items marked "Not recorded" are missing from this project's records for the version named. Apart from any worked example shown, the cases and their values are not printed, so a reader cannot re-run these checks. No independent scientist has yet reviewed these methods or checks.

[Open Drybench Assay](https://www.drybench.com/assay/app) · [Drybench Assay: methods and checks](https://www.drybench.com/methods/assay) · [What the levels mean](https://www.drybench.com/methods/levels) · [Every assistant tool](https://www.drybench.com/methods/tools)

## Inputs

An omitted input takes the default its description states; the reply's `inputsReceived` shows what was given. Any input not listed here is refused.

- `factorA` (array of string, required): Level names of factor A (rows).
- `factorB` (array of string, required): Level names of factor B (columns).
- `cells` (array of array of array of number, required): cells\[i\]\[j\]: replicate numbers for factor A level i and factor B level j.
- `unit` (string, required): Experimental unit: 'independent' (opens inference), 'technical', or 'unspecified'. One of `independent`, `technical`, `unspecified`.
- `type` (integer, required): Sums of squares convention: 3 (Type III) or 2 (Type II). One of `2`, `3`.
- `postHoc` (string, optional): Simple effects of B within each level of A, or 'none' (default). One of `tukey`, `dunnett`, `holm`, `sidak`, `bonferroni`, `none`.
- `control` (integer, optional): 0-based index of B's control level (required when postHoc is 'dunnett').
- `level` (number, optional): Confidence coverage level for intervals (0.9, 0.95 default, or 0.99). One of `0.9`, `0.95`, `0.99`.

## What it withholds or refuses

A refusal, a withheld value or another named status is an answer: the reply gives the reason and no number in its place; an absent value is not zero. Invalid input means nothing ran.

- `GROUPS_TOO_FEW`: Fewer than two levels of a factor (withheld). (`two-way-anova@1.0.1`)
- `EMPTY_CELL`: A cell with no value (withheld). (`two-way-anova@1.0.1`)
- `CELL_N_TOO_SMALL`: A cell with one value (withheld). (`two-way-anova@1.0.1`)
- `ZERO_VARIANCE_GROUP`: No cell spreads beyond rounding: the residual is rounding only (withheld). (`two-way-anova@1.0.1`)
- `SINGULAR_DESIGN`: The design is rank-deficient, or leaves no residual degree of freedom (withheld). (`two-way-anova@1.0.1`)
- `BEYOND_DOUBLE_RANGE`: A sum of squares or mean square in the data's unit is beyond the double range (above about 1.8e308, or nonzero and below about 2.2e-308): the table is withheld; simple effects whose values are representable are given (1.0.1). (`two-way-anova@1.0.1`)
- `UNIT_NOT_INDEPENDENT`: The replicates are not stated to be independent units: inference is withheld. (`two-way-anova@1.0.1`)
- `MISSING_ARGUMENT`: Dunnett comparisons asked without a control level of B. (`two-way-anova@1.0.1`)

## How to cite a number from it

Every reply carries a cite line. It names, in order: the tool and the server version; each method the call went through, with its version and level (and the limit beside a level where the method's record narrows it); the receipt, the first 12 characters of the hashes of the arguments and of the result; and the address where its methods are described. Quote it with any number taken from the reply.

The receipt identifies a computation; it is not a signature. It holds no time, so the same arguments on the same server and method versions give the same receipt, and anyone can call the tool again and compare; a later method version can change the output hash.

This page has no example for this tool yet. The cite line's form, with placeholders where a call's own values go:

```cite
stats_two_way_anova, server 1.0.0; status invalid-input, nothing ran; no method record; receipt <input hash, 12 characters>/<output hash, 12 characters>; methods https://www.drybench.com/methods/assay; page https://www.drybench.com/methods/tools/stats-two-way-anova. There is no result to quote; this line identifies the call and its receipt.
```

## Methods

Every method and reference the tool's replies cite, with its version and level. A reply names the methods that call went through.

### Two-way ANOVA with interaction (Type III default, Type II) and simple effects

- **Method:** `two-way-anova@1.0.1`
- **Level:** Checked against a reference; published cases balanced only, where Type II and III agree; unbalanced Type II and III checked against R only. Reference kind: not recorded. This level uses the apps' wider definition on the levels page.
- **How it was checked:** Checked against R 4.4.3 on 22 cases of the 0.11.0 fixture (car 3.1-5 Anova, Type III with sum contrasts and Type II): sums of squares and F within 1e-9 relative; simple effects as the post-hoc methods (2026-10-13). R only; SciPy not run.
- What was not checked: The simple effects (Tukey, Dunnett, Holm, Šidák and Bonferroni comparisons of B within each level of A) are part of this method and are not anchored on a source read here, nor worked by hand. The source's supplementary material, which defines the sigma-restricted coding, was not read; the engine's sum-to-zero contrasts are taken to be that coding, and the hand case confirms it numerically: Type III by model comparison in sum-to-zero coding equals the source's Q on equally weighted cell means exactly, and both equal R's values. The source read is a tutorial; the first sources of the Type II and Type III sums of squares (it cites Searle 1987 and Yates 1934 among others) were not read. The p values are not worked by hand. Every case is synthetic: values generated by this project from the model itself with a recorded noise vector. No measured data set from another party is among the cases. No published case set names two-way-anova\@1.0.1 by its exact key. The hand case is a draft worked by an AI session on 12 November 2026 from the source's equation; this session also ran it through the tool on this repository's head and the tool agreed, a check made once and not kept as a test. No case runs this method through the served tool on its production runtime. No person has worked these cases or read these sources; the reading and checks recorded here were made by AI sessions.
- [Method, sources and checks](https://www.drybench.com/methods/m/two-way-anova)
- [On Drybench Assay's methods page: Several groups: one factor](https://www.drybench.com/methods/assay#several-groups-one-factor)

No independent scientist has yet reviewed these checks. [What the levels mean](https://www.drybench.com/methods/levels).

## Changes to its methods

- [2026-11-21 · two-way-anova\@1.0.1](https://www.drybench.com/methods/corrections#2026-11-21-two-way-anova101-1)

## Where it runs

The local MCP server serves this tool; the hosted MCP connection does not.

## Methods and checks

- [Drybench Assay: methods and checks](https://www.drybench.com/methods/assay)
- [Reference checks: Drybench Assay](https://www.drybench.com/methods/assay/checks)
- [What the levels mean](https://www.drybench.com/methods/levels)
- [Every assistant tool](https://www.drybench.com/methods/tools)
