ANOVA
ANOVA in statistics is a powerful tool for determining the influence of different groups of observations among themselves. The analysis of variance was introduced by Fisher, an English scientist who made a huge contribution to the development of science. ANOVA is an acronym for ANalysis Of VAriance.
Example
Suppose you want to conduct an empirical study of gasoline quality, for this you fill up the tank at one gas station and drive n kilometers, repeat such an experiment, say, five times, then conduct the same experiment, only at a different gas station. You have two sets of data - refueling A and refueling B. Certainly, the figures are scattered, but there is still some dependence, so that would determine whether refueling affects gasoline consumption (or the data are not related) You are using variance analysis.
The analysis of variance allows you to determine which of the factors affects more, intra-group or intergroup. In the example above, you will be able to determine how much the choice of gas station affects gasoline consumption. This is the essence of the dispersion analysis: to find out whether the selected factor is significant for the selected observations.
In a sense, the analysis of variance is similar to regression and correlation analyses, because it allows determine the influence of variables on each other.
Analysis
In theory, a simple model is built to analyze the variance, similar to the one studied in time series analysis.
Model
The model of the analysis of variance includes the average value, the effect of the experiment and a random error:
y = μ + τ + ε
τ - experiment effect, ε - random error
Single-factor
One-factor analysis of variance considers the influence of one criterion, it is done this way: we conduct two experiments, in one of them we include an additional factor and analyze whether this factor has made changes. As initial data, consider the results of a number of experiments:
N | E1 | E2 | E3 | E4 |
---|---|---|---|---|
1 | 50 | 45 | 84 | 58 |
2 | 31 | 51 | 78 | 35 |
3 | 42 | 48 | 100 | 45 |
4 | 58 | 41 | 80 | 48 |
5 | 45 | 47 | 85 | 43 |
μi | 45.2 | 46.4 | 85.4 | 45.8 |
μ = (45.2 + 46.4 + 85.4 + 45.8) / 4 = 55.7
The square of errors within groups (Square Sum within group):
SSw = ΣiΣj(yij - μi)2 = 1032
The square of errors between groups (Square Sum between group):
SSb = Σi(μi - μ)2 = 1176.84
Given the degrees of freedom, the expected average is:
MSw = SSw / a(n-1) = 68.8
MSb = SSb / a-1 = 294.21
Value of Fcrit :
F0 = MSb/MSw = 4.276
Fischer's test: if the value of F0 turns out to be greater than the value of F λ,4,15, then the factor has an impact.
For n = 20 and a = 5, Fλ,n-a,a-1 = Fλ,15,4= 5.86
Since F0 = 4.276 < 5.86, then we assume that the introduced factor did not have an effecton the results of the experiment.
Two-factor
In two- factor analysis , three hypotheses are put forward for verification:
- Factors A and B do not affect the result
- Factor A does not affect the result
- Factor B does not affect the result
To carry out a two-factor analysis, it is necessary to make groups of results: several measurements for all values of each of the factors, i.e.:
A1 | A2 | |
---|---|---|
B1 | X1a1,b1...XNa1,b1 | X1a1,b2...XNa1,b2 |
B2 | X1a1,b2...XNa1,b2 | X1a1,b2...XNa1,b2 |
Next, the average value for each factor value is calculated, i.e. the average for A1, the average for B1, etc. Then it is calculated the total average for all results. Let's set the number of criteria: k = 2 (the number of criteria A) and m = 2 (the number of criteria B).
T = ΣΣΣxijk
The sum of elements under the influence of factor A:
TAi = Σxi·k
The sum of elements under the influence of factor B:
TBj = Σx·jk
The sum of elements under the influence of factor AB:
TAiBj = Σxij·
SST = Σx2ijk - T2/N
SSA = ΣT2Ai/n·m - T2/N
SSB = ΣT2Bj/n·k - T2/N
SSAB = ΣΣT2AiBj/n - SSA - SSB - T2/N
SSE = ΣΣΣx2ijk - ΣΣT2AiBj/n
SST = SSA + SSB + SSAB + SSE
MSE = SSE/(n-1)·m·k
MSA = SSA/k-1
MSB = SSB/m-1
MSAB = SSAB/(m-1)·(k-1)
Test "Criterion A does notaffect the result", ν1= k-1:
FA = MSA/MSE
Test "Criterion B does notaffect the result", ν1= m-1:
FB = MSB/MSE
Test "Criteria A and B do notaffect the result", ν1 = (k-1)(m-1):
Fint = MSAB/MSE
For each F, if F > F α,ν1,ν2, then the hypothesis is rejected. ν2 = N-mk
Multifactorial
Multivariate analysis is similar to two-factor analysis - the same operations are performed, but the criteria are grouped and the influence of each of the factors is found iteratively.
With repeated measurements
The analysis of variance with repeated measurements indicates that several tests were performed for each criterion measurements of a random variable to obtain a more accurate result (since ANOVA) uses the intra-group sum of squares.
Application
Dispersion analysis is used in a wide variety of branches of science and production when it is necessary to study the dependence of the criteria on the difference in average values, while comparing not the average value, but the spread the results are around the mean, i.e. the variance.
Solving problems
As an example, let's give a problem from metrology. The plant houses five machines that produce shafts. It is necessary to determine whether the choice of a machine tool or the training of an employee affects the result of production. For analysis measurements are made for each machine and employee, the result is a table:
Operator 1 | ||||||||||
M1 | 30.394 | 30.326 | 30.356 | 30.336 | 30.39 | 30.345 | 30.335 | 30.343 | 30.337 | 30.359 |
---|---|---|---|---|---|---|---|---|---|---|
M2 | 30.256 | 30.203 | 30.219 | 30.227 | 30.224 | 30.223 | 30.222 | 30.256 | 30.272 | 30.284 |
M3 | 30.361 | 30.378 | 30.327 | 30.353 | 30.301 | 30.392 | 30.327 | 30.342 | 30.34 | 30.386 |
M4 | 30.313 | 30.338 | 30.365 | 30.343 | 30.352 | 30.346 | 30.368 | 30.335 | 30.392 | 30.373 |
M5 | 30.343 | 30.374 | 30.452 | 30.319 | 30.55 | 30.546 | 30.335 | 30.463 | 30.341 | 30.391 |
Operator 2 | ||||||||||
M1 | 30.971 | 30.422 | 30.992 | 30.968 | 30.398 | 30.728 | 30.885 | 30.485 | 30.974 | 30.432 |
M2 | 30.399 | 30.322 | 30.354 | 30.344 | 30.337 | 30.388 | 30.318 | 30.382 | 30.342 | 30.308 |
M3 | 30.361 | 30.377 | 30.395 | 30.381 | 30.3 | 30.359 | 30.331 | 30.307 | 30.324 | 30.38 |
M4 | 30.73 | 30.689 | 30.501 | 30.444 | 30.44 | 30.418 | 30.718 | 30.396 | 30.37 | 30.658 |
M5 | 30.39 | 30.389 | 30.316 | 30.301 | 30.387 | 30.383 | 30.334 | 30.373 | 30.373 | 30.366 |
Let's use the method of two-factor analysis, factor A is the operator, factor B is the machine. Calculate the sums of squares, to do this, you need to calculate the average value for each of the groups:
T | TA1 | TA2 | TB1 | TB2 | TB3 | TB4 | TB5 |
---|---|---|---|---|---|---|---|
3040.293 | 1517.053 | 1523.24 | 610.776 | 605.88 | 607.022 | 608.889 | 607.726 |
SSA = 0.383
SSB = 0.7
SSAB = 0.557
SSE = 0.929
MSA = 0.383
MSB = 0.175
MSAB = 0.139
MSE = 0.232
FA = 1.651
FB = 0.754
FAB = 0.599
Critical values for the Fischer test:
Fcrit A = F0.1, 1, 90 = 2.77
Fcrit B = F0.1, 4, 90 = 2.01
Fcrit AB = F0.1, 4, 90 = 2.01
Results table:
The impact of the machine on the result | Yes | 1.651 < 2.77 |
---|---|---|
The impact of the employee's qualifications on the result | Yes | 0.754 < 2.01 |
The mutual influence of the employee's qualifications and the choice of the machine on the result | Yes | 0.599 < 2.01 |
In excel/Open Calc
To solve the variance analysis in a spreadsheet, you will need the following formulas:
sumproduct | Sum of products, used to find the sum of squares |
finv | Inverse value of the distribution F - Fisher criterion |