EXAMPLE - 0093Da/Analysis-of-Variance GitHub Wiki

ANOVA is considered to be a special case of linear regression. which in turn is a special case of the general linear model.All consider the observations to be the sum of a model (fit) and a residual (error) to be minimized.We can consider the 2-way interaction example where we assume that the first factor has 2 levels and the second factor has 3 levels.

Define if and if , i.e. is the one-hot encoding of the first factor and is the one-hot encoding of the second factor.

With that,

where the last term is an intercept term. For a more concrete example suppose that

Then,

Eg. 1

Significance level 0.05 in comparison of two groups (A and B) indicates that the possibility of taking true hypothesis is 95% and taking wrong hypothesis is 5%. When we do paired comparison of three groups (A with B, B with C and A with C), the possibility of such mistake would be:

1-(0.95×0.95×0.95) = 14.3%.

If we have four groups (A, B, C and D), to compare all them we would do six comparisons: A with B, A with C, A with D, B with C, B with D and C with D. In this case, the probability of accepting wrong hypothesis would be:

1-(0.95×0.95×0.95×0.95×0.95×0.95) = 26.5%.

With increasing the number of paired comparison in multiple groups the probability of accepting wrong statistical hypothesis dramatically increases