Methods
What every number on screen is, how it is computed, and what it has been tested against.
What the AI does and does not do
A language model (Claude) reads your description and proposes factor names, units, low and high levels, a response name and a goal. That proposal is validated and sanitized by code, shown to you, and editable before anything is built. If the AI service is unavailable, a built-in keyword parser is used instead. The model never generates the design matrix and never computes a statistic.
Designs
Factor levels are coded so the low setting is −1, the high setting is +1 and the midpoint is 0. All fitting is done in coded units.
- 2-level full factorial: every combination of low and high, 2k runs.
- Fractional factorial (4 to 6 factors): 24−1 with D = ABC (resolution IV), 25−1 with E = ABCD (resolution V), and 26−2 with E = ABC and F = BCD (resolution IV).
- Box-Behnken (3 or more factors): runs at the midpoints of the edges of the factor cube, 2k(k−1) runs plus centre points.
- Central composite: the full factorial corners, plus axial points on the faces of the cube at ±1 (a face-centred design), 2k + 2k runs plus centre points.
- Centre points: 1 to 10 replicates at the midpoint, 3 by default. They provide the pure-error estimate used by the lack-of-fit test.
- Run order: randomized with a seeded pseudo-random shuffle, so a given seed reproduces the same order. The standard order is kept alongside.
Up to six factors are supported. The design is chosen by deterministic rules from the number of factors and the kind of study, and you can change it.
The model
The fitted terms depend on the design:
- Full factorial: main effects and all two-factor interactions.
- Box-Behnken and central composite: main effects, two-factor interactions and pure quadratic terms (a full second-order model).
- Fractional factorial: main effects only, because its two-factor interactions are aliased with each other and cannot be separated.
Coefficients are ordinary least squares estimates, solved directly from the normal equations. The model is fitted to the runs that have a response entered, and updates as you add more.
The 95% range shown beside each coefficient is the estimate plus and minus a t value times its standard error, using the residual degrees of freedom. It is shown only when there are spare runs to estimate the noise from, and it excludes zero exactly when the coefficient's p-value is below 0.05.
Two checks warn when effects cannot be told apart. Aliasing compares the columns the runs give every effect of up to three factors: effects with identical columns (up to sign) share one estimate. Multicollinearity is measured by the variance inflation factor of each term, from the centred columns of the model matrix over the runs that have results; 5 and above is flagged as a caution and 10 and above as a problem, which are rules of thumb. Terms that are exactly the same pattern, or that do not vary, are named instead.
ANOVA and lack of fit
The ANOVA table splits variation into model and residual, with an F-test for the model as a whole. Where there are replicated runs (typically the centre points), the residual is split further into pure error, from the spread among replicates, and lack of fit, the part the model's shape cannot explain. A significant lack-of-fit F-test says the chosen model form is too simple for the data. Without replicates, lack of fit cannot be tested and is not reported.
p-values come from the F and t distributions, computed via the regularized incomplete beta function.
R², adjusted R² and predicted R²
R² is the share of variation the model explains. Adjusted R² penalizes terms that add little. Predicted R² is based on PRESS, the sum of squared leave-one-out prediction errors, and is the one to trust for judging how the model will do on new runs: it can be low or negative even when R² looks excellent, which is a sign of overfitting.
Residual diagnostics
Residuals are scaled to studentized residuals using each run's leverage, then plotted against fitted values (a pattern suggests a missing term or unequal variance), in run order (a trend suggests drift), and on a normal probability plot. Leverage is computed for every run.
The optimum
The optimum finder evaluates the fitted model on a grid across the coded factor space (41 points per factor for two factors, 21 for three, 11 for four, 7 for five or six) and reports the best predicted response for your goal: maximize, minimize, or get closest to a target value. It is a grid search of the fitted model, so it is only as good as the model, and it is restricted to the region you tested. Confirm any predicted optimum with a real run.
The history of changes
Once the first result is entered, every change to a result, a left-out run, a note, the set-up or the number of runs is recorded inside the experiment, with the time and what it was before and after. The record is worked out by comparing the experiment before and after each edit, so no kind of edit can be missed, and an experiment can be shown as it stood after any earlier change from the saved file alone. Edits to the same value within a minute are one entry. Each entry carries a fingerprint (SHA-256) of itself and the entry before it, so a corrupted file or an entry changed by mistake is noticed and flagged.
It is a record for you and the people you share the file with, not legal evidence: it is kept in your own data, so anyone who holds the whole file could rewrite all of it. Set-up changes can be read but not rewound, and a history longer than 1,000 changes keeps the latest 1,000 and summarises the earlier ones.
Predictions and their ranges
For settings you choose, the model's prediction comes with two ranges. The range for the average response is the prediction plus and minus a t value times the square root of the residual mean square times h, where h = x(XᵀX)⁻¹x is how far the settings are from the centre of the data, in the model's own terms. The range for the next run adds the run-to-run noise: the square root is of the residual mean square times (1/m + h), where m is the number of new runs being averaged (1 for a single run). It is therefore always wider, and it never gets narrower than the range for the average. The t value uses the residual degrees of freedom, so neither range is given when there are no spare runs.
Settings are flagged as outside what your runs tested when h is larger than the largest h among the runs themselves. This catches combinations no run came near even when each factor is within its range. The ranges assume independent errors of similar size, roughly normal, and a model of the right form. With blocks, the prediction is for a run in one of the blocks used, or the average over them.
Confirmation runs
A confirmation run checks a prediction in the lab. When it is planned, the model's prediction at the chosen settings is frozen: the best guess and the range for the average of the planned number of runs, which is the prediction plus and minus a t value times the square root of the residual mean square times (1/m + h), with m runs and h as above. Later results do not move it. Once the runs are done, the average of what was measured is compared with that range. Inside it, the model held; outside it, the model missed, and the two-sided p-value says how often a result that far from the prediction would happen if the model were right.
This is a check of one prediction, not a proof of the model. A wide range is easy to pass, and a single run is a weak test, so three runs are suggested. Confirmation runs are kept out of the fit, so they cannot flatter the model they test; after a miss, adding them to the experiment refits the model with them, and the experiment records that. The check inherits the assumptions of the ranges above.
Checks on entered results
As results are typed, pasted or imported, they are checked for a few things that are usually mistakes. A response whose name says it cannot be negative (a yield, a concentration, a size) is flagged if a result is below zero, and a percentage is flagged above 100. One result that is about 10, 100 or 1000 times the typical result, and far from the rest, is flagged as a possible slipped decimal point. It must be at least 5 robust standard deviations from the median and a power of ten away to within about 15%, and it is judged on a log scale, so a response that really spans decades is not flagged. A result that is far from the rest, and that two swapped digits would bring in line, is flagged as possibly transposed, but only when it stands alone and the other results are close together. Two or more results about 100 or 1000 times away from all the others are flagged as a possible mix of units.
Runs at identical settings are compared with the other replicates. A pair or group is flagged when its variance is larger than the pooled variance of all the other replicate groups, by an F test with a p-value below 0.0001. That is strict on purpose, so a clean experiment stays quiet, and it is not made when the other replicates agree exactly, because there is then nothing to compare with. The robust standard deviation is 1.4826 times the median absolute deviation, the usual constant that makes it match the standard deviation for normal data.
These checks only ask a question. They never block a value, change one or take a run out of the analysis, and nothing is stored: they are worked out again from the results each time. There is deliberately no general outlier rule, because in a designed experiment a large effect is meant to push some results far from the middle. Only results that were typed in are checked; a very surprising result can still be real.
Comparing the levels of one factor
A single-factor design runs every level of one categorical factor (catalysts, suppliers, doses treated as named groups) the same number of times, in random order. Its analysis is the one-way analysis of variance. The overall test asks whether the levels are all the same: F = MS(between levels) / MSE, where MSE is the pooled run-to-run noise, the sum of squared distances of each result from its own level's average divided by the results minus the number of levels. The p-value is the upper tail of the F distribution. The model fitted behind the scenes is the same regression used everywhere else (an intercept and one effect-coded column per level but the last), so its F-test and the one-way F-test are identical, and a test checks that they are.
Each level's average is shown with a range of the average ± t × √(MSE / n), using the pooled noise and its degrees of freedom, so a level with few runs is judged against the noise seen at every level. Every pair of levels is compared with a t-test on the same pooled noise, t = (difference of averages) / √(MSE × (1/n₁ + 1/n₂)), and the p-values are adjusted by Holm's step-down method: sort them from smallest, multiply the smallest by the number of pairs, the next by one fewer, and so on, never letting an adjusted value fall below an earlier one, capped at 1. That keeps the chance of any false alarm among all the pairs at 5%. A pair is called different only when its adjusted p-value is below 0.05. Tukey's method, which is a little more sensitive for all pairs, is not used yet.
The comparisons assume independent runs, roughly normal noise and equal spread at every level. Equal spread is checked with the Brown-Forsythe test: a one-way analysis of variance on each result's distance from its own level's median, flagged below p = 0.05. It also reports the ratio of the largest to the smallest level's standard deviation. The check can only warn; it never changes a result. With one run at every level there is no way to tell noise from a difference, so the comparison is refused, and the set-up asks for at least two runs per level (up to ten). A level treated as a named group says nothing about the values between levels, so a numeric dose is not a scale here: a trend across doses is not analysed yet.
Several categorical factors: the general factorial
A general factorial runs every combination of the levels of two or more categorical factors, each with its own number of levels (3 × 2 × 4 is 24 combinations), the same number of times. The model has an intercept, an effect-coded main effect for every factor (levels − 1 columns each) and every two-factor interaction, whose columns are the products of the two factors' columns, so an interaction between factors with 3 and 4 levels takes 2 × 3 = 6 columns. Interactions among three or more factors are left out of the model and so stay in the noise, which is fair because they are rarely large; a design run once with three or more factors therefore still has spare runs to estimate the noise from, while one with two factors run once uses every run and is refused. Each factor and each interaction is tested by the extra sum of squares F-test: refit without its columns and see how much worse the fit gets.
The levels of one factor are compared as in the single-factor case, with three differences. Each level's average is over every level of the other factors, which is the model's own average when every combination has the same number of results, so the comparison is made only then. The noise is the fitted model's residual mean square and its degrees of freedom, with the other factors and their interactions taken out, rather than the spread within the levels alone. The overall test is the model's test of that factor, and equal spread is checked across the combinations, so another factor's effect is not mistaken for a difference in noise. Pairs of levels are compared by t-tests on that noise with Holm's adjustment. If a factor interacts with another, the average over the other's levels can hide that its levels behave differently in each; read the interaction plot and the interaction test first.
Reducing the model
A full model has a term for everything the design can estimate, and some of those terms are noise. Model reduction removes them by backward elimination on p-values. Starting from the full model, it finds the term with the largest p-value above a cut-off, drops it, refits, and repeats, until every term left has a p-value at or below the cut-off or is needed by one that does. The cut-off is 0.10 by default, because dropping a borderline term costs less than keeping a useless one, and 0.05 or 0.20 can be chosen. A term's p-value is its own t-test when it takes one column, and the extra-sum-of-squares F-test when it takes several, such as a categorical factor. It is worked out on the model as it stands at that step, so a term that looked weak only because a bigger one was still in the model gets a fair second look.
Hierarchy is kept: a main effect stays while any interaction or square made with it stays, because an interaction without its main effects changes meaning when the factors are recoded and cannot be read. So interactions go first, and a main effect is judged again once nothing made with it is left. The block, when there is one, is never dropped, and at least one term always stays. Among terms with equal p-values the higher-order term goes first. The reasoning for every step, the p-value of each term kept and why, and the full and reduced models side by side (R², adjusted and predicted R², the noise, the lack-of-fit p-value) are all shown. A caution appears if the reduced model has a significant lack of fit that the full one did not, or if its predicted R² is more than 0.05 lower.
What it cannot do is make the p-values honest. The terms are chosen because they look weak in these results, so the p-values of the terms that stay are more flattering than they deserve and R² is a little high. A reduced model is a simpler working model, not a proof that the dropped terms are zero, and the answer to the optimism is a confirmation run, not more statistics. It needs spare runs to judge terms by; when the model uses every result it says so and points to the half-normal plot. Using a reduced model changes only which model is fitted: no result or run is changed, it is recorded in the history, and the full model is one click away. The experiment remembers the set-up the reduction was made for, and a reduction that no longer fits it (the factors, the design or the blocks changed) is ignored and dropped.
How it is tested
- The probability functions (t, F and normal distributions) are compared against standard published critical values.
- The regression code is checked against Anscombe's quartet, a widely published OLS benchmark.
- Designs are tested against their defining properties: run counts, balance and orthogonality.
- Models fitted to noise-free data generated from known effects must recover those effects.
- The prediction ranges are checked against a published regression dataset (the soft-drink delivery times), against a closed form for an orthogonal design, and by simulation: with known noise, the 95% ranges hold the true average and a new run between 93% and 97% of the time.
- The comparison of levels is checked against the published results for R's PlantGrowth data: the one-way ANOVA (F = 4.846 on 2 and 27 degrees of freedom, p = 0.0159), the group averages, the differences between pairs (Tukey's HSD table), and the Brown-Forsythe test of equal spread (car::leveneTest with the median, F = 1.119, p = 0.341). The Holm adjustment is checked against R's p.adjust.
- The two-way model is checked against the published results for R's ToothGrowth data (supplement × dose, 10 animals in each of six combinations): the F-tests of the supplement (15.572, p = 0.000231), the dose (92.00) and their interaction (4.107, p = 0.02186), the residual sum of squares (712.1 on 54 degrees of freedom), the cell averages, and the pairwise differences between doses (TukeyHSD: 9.130, 15.495, 6.365).
- Model reduction is checked against Montgomery's 2⁴ filtration-rate example (one run at each of 16 combinations): the full-model effects match the published ones, and the reduction finds the published model with A, C, D, AC and AD (70.06 + 10.81 A + 4.94 C + 7.31 D − 9.06 AC + 8.31 AD, R² = 0.966), dropping B last because its interactions had to go first. Hierarchy, the block, multi-column terms and the refusals are checked on constructed cases.
- The confirmation verdict is checked by simulation with known truth: when the model is right, between 3% and 7% of confirmations are judged missed (a 95% range), and the miss rate rises with the size of a real shift.
We have not yet validated against other statistical packages on a broad set of published DoE datasets. If you find a result that disagrees with another tool, please tell us.
Limits
- No mixture designs or split-plot structure yet, and no D-optimal or custom designs.
- A categorical factor's interaction with another is modelled only in a general factorial (all factors categorical); alongside numeric factors, each categorical factor interacts with the numeric ones only.
- Levels are named groups: a numeric dose is not treated as a scale, so a trend across doses is not analysed yet.
- The analysis assumes independent errors with roughly constant variance. Check the diagnostics before acting on a result.