This dialog is activated by selecting the **Two-Way ANOVA...** command from the Statistics -> ANOVA -> menu.
The two-way analysis of variance (abbreviated two-way ANOVA) can be used to compare the means of two or more samples using the F distribution.
Please visit the Wikipedia article on the Analysis of Variance for more details about this statistical test.

In the QtiPlot implementation of two-way ANOVA there are only two factors defined, A and B, with L_{A} and L_{B} levels respectively,
for a total number of samples N = L_{A}L_{B}.

If the controls in the *Means Comparison* group box are checked QtiPlot
can also perform several post-hoc analysis tests. These tests can determine which level means or sample means (if the *Interactions* box is checked)
are significantly different from each other. The folowing post-hoc tests are currently implemented:
Tukey, Bonferroni, Dunn-Sidak, Fisher's Least Significant Difference (LSD), Scheffe,
Holm-Bonferroni and
Holm-Sidak.

The post-hoc tests compare all possible pairs of level means, meaning that for L_{i} levels per factor
there are k = L_{i}(L_{i}-1)/2 pairs of means to be compared for each factor.
If the *Interactions* box is checked QtiPlot also compares all possible pairs of sample means,
meaning that for the N samples there are N(N-1)/2 pairs of means to be compared.

For each pairwise comparison QtiPlot computes the difference between the means *m _{i}* and

The compaired means are said to be significantly different (reported *Significance* is 1 in the results log/tables)
at significance level *α* (*0 ≤ α ≤ 1*)
if the calculated probability is lower than the value of *α* chosen by the user.

For each test QtiPlot calculates the test statistics and the probabilities using the following formulas:

*Tukey*:This test uses the Studentized range statistic q = 2

^{1/2}|m_{i}- m_{j}|/SEM_{ij}.The probability is calculated using the formula p = 1 - srangecdf(q, DoF, L), where the QtiPlot function

*srangecdf*computes the probability associated with the lower tail of the distribution of the Studentized range statistic for*L*the number of levels in factor A or factor B and*DoF*degrees of freedom (reported in the Error line of the ANOVA results table).The implementation of the

*srangecdf*function provided by QtiPlot uses code adapted from the following paper by WILLIAM P. DUNLAP, RICHARD S. POWELL and TED K. KONNERTH: A FORTRAN IV function for calculating probabilities associated with the studentized range statistic, published in*Behavior Research Methods and Instrumentation, 1977, Vol. 9 (4), 373-375*.*Bonferroni*:This test uses the statistic t = (m

_{i}- m_{j})/SEM_{ij}.The probability is calculated using the formulas p = 2tcdf(t, DoF) if

*tcdf(t, DoF) < 0.5*and p = 2[1 - tcdf(t, DoF)] otherwise, where the*tcdf*function calculates the lower tail of the cumulative distribution function for the Student's t-distribution with*DoF*degrees of freedom.*Dunn-Sidak*:This test uses the statistic t = (m

_{i}- m_{j})/SEM_{ij}.The probability is calculated using the formulas p = 2tcdf(t, DoF) if

*tcdf(t, DoF) < 0.5*and p = 2[1 - tcdf(t, DoF)] otherwise, where the*tcdf*function calculates the lower tail of the cumulative distribution function for the Student's t-distribution with*DoF*degrees of freedom.*Fisher LSD*:This test uses the statistic t = (m

_{i}- m_{j})/SEM_{ij}.The probability is calculated using the formulas p = 2tcdf(t, DoF) if

*tcdf(t, DoF) < 0.5*and p = 2[1 - tcdf(t, DoF)] otherwise, where the*tcdf*function calculates the lower tail of the cumulative distribution function for the Student's t-distribution with*DoF*degrees of freedom.*Scheffe*:This test uses the statistic F = t

^{2}, where t = (m_{i}- m_{j})/SEM_{ij}.The probability is calculated using the formula p = 1 - fcdf(F, 1, DoF), where the

*fcdf*function calculates the lower tail of the cumulative distribution function for the F-distribution with one and*DoF*degrees of freedom.*Holm-Bonferroni*:This test uses the statistic t = (m

_{i}- m_{j})/SEM_{ij}.*tcdf(t, DoF) < 0.5*and p = 2[1 - tcdf(t, DoF)] otherwise, where the*tcdf*function calculates the lower tail of the cumulative distribution function for the Student's t-distribution with*DoF*degrees of freedom.The Holm-Bonferroni test sorts the p-values in ascending order and compares them to nominal significance levels from α/k to α, namely the values: α/k, α/(k-1),...,α/2, α.

*Holm-Sidak*:This test uses the statistic t = (m

_{i}- m_{j})/SEM_{ij}.*tcdf(t, DoF) < 0.5*and p = 2[1 - tcdf(t, DoF)] otherwise, where the*tcdf*function calculates the lower tail of the cumulative distribution function for the Student's t-distribution with*DoF*degrees of freedom.The Holm-Sidak test sorts the p-values in ascending order and compares them to nominal significance levels from 1 - (1 - α)

^{1/k}to α, namely the values: 1 - (1 - α)^{1/k}, 1 - (1 - α)^{1/(k-1)},...,1 - (1 - α)^{1}.

When comparing the sample means (*Interactions* box checked) QtiPlot calculates the test statistics and the
probabilities using the formulas defined for the one-way ANOVA post-hoc tests.