Last Modified: March 15, 2017

Performs a one-way analysis of variance (ANOVA) and returns the effect of the levels of the factor on the experimental outcome.

The level to which the corresponding observation belongs.

This input converts input levels that do not begin with zero or input levels that have nonconsecutive values. For example, if you enter an index that contains the levels 3, 5, and 7, this input converts the levels to an index array with level values of 0, 1, and 2.

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

Probability that a value sampled from the F distribution with *dofa* and *dofe* degrees of freedom is greater than *fa*, where *dofa*, *dofe*, and *fa* are values in **summary**.

Analyzing **significance** for Your Experiment

Compare **significance** with the chosen level of significance to determine whether the level of the factor has an effect on the experimental outcome. A common choice of the chosen level of significance is 0.05. If **significance** is less than the chosen level of significance, you can conclude that at least one level of the factor has some effect on the experimental outcome.

Algorithm for Calculating **significance**

This node calculates **significance** using the following equation:

$\mathbf{s}\mathbf{i}\mathbf{g}\mathbf{n}\mathbf{i}\mathbf{f}\mathbf{i}\mathbf{c}\mathbf{a}\mathbf{n}\mathbf{c}\mathbf{e}=\mathrm{Prob}\{{F}_{\mathrm{dofa},\text{\hspace{0.17em}}\text{\hspace{0.17em}}\mathrm{dofe}}>\mathrm{fa}\}$

where
${F}_{\mathrm{dofa},\text{\hspace{0.17em}}\text{\hspace{0.17em}}\mathrm{dofe}}$ is the F distribution with *dofa* and *dofe* degrees of freedom.

A 2-by-4 matrix that displays the obtained values for analysis.

$\mathrm{summary}=\left[\begin{array}{cc}\mathrm{ssa}& \mathrm{dofa}\\ \mathrm{sse}& \mathrm{dofe}\end{array}\phantom{\rule{0ex}{0ex}}\text{\hspace{0.17em}}\phantom{\rule{0ex}{0ex}}\phantom{\square}\begin{array}{cc}\mathrm{msa}& \mathrm{fa}\\ \mathrm{mse}& \mathrm{0.0}\end{array}\right]$

where

*ssa*and*sse*are the sums of squares associated with the factor and residual error, respectively*dofa*and*dofe*are the respective degrees of freedom*msa*and*mse*are the respective mean squares*fa*is the F value

Algorithm for Calculating Sums of Squares

This node calculates the sums of squares using the following equations:

$\mathrm{ssa}={\displaystyle \underset{i=0}{\overset{k-1}{\sum}}}{\displaystyle \underset{m=0}{\overset{{n}_{i}-1}{\sum}}{\left(\stackrel{\xaf}{{x}_{i\cdot}}-\stackrel{\xaf}{{x}_{\cdot \cdot}}\right)}^{2}}$

$\mathrm{sse}={\displaystyle \underset{i=0}{\overset{k-1}{\sum}}}{\displaystyle \underset{m=0}{\overset{{n}_{i}-1}{\sum}}{\left({x}_{im}-\stackrel{\xaf}{{x}_{i\cdot}}\right)}^{2}}$

where

*k*is the number of levels*i*is the index of each level, starting from 0*n*_{i}is the number of observational data at the*i*^{th}level*m*is the index of each observational data at a certain level, starting from 0-
$\stackrel{\xaf}{{x}_{i\cdot}}$ is the mean of all the observational data at the
*i*^{th}level - $\stackrel{\xaf}{{x}_{\cdot \cdot}}$ is the mean of all the observational data
*x*_{im}is the*m*^{th}observation data of the*i*^{th}level

Algorithm for Calculating Degrees of Freedom

This node calculates the degrees of freedom using the following equations:

$\mathrm{dofa}=k-1$

$\mathrm{dofe}=n-k$

where

*k*is the number of levels*n*is the number of all the observational data

Algorithm for Calculating Mean Squares

This node calculates the mean squares using the following equations:

$\mathrm{msa}=\frac{\mathrm{ssa}}{\mathrm{dofa}}$

$\mathrm{mse}=\frac{\mathrm{sse}}{\mathrm{dofe}}$

where

*ssa*is a measure of variation attributed to the factor*dofa*is the degree of freedom of*ssa**sse*is a measure of variation attributed to random fluctuation*dofe*is the degree of freedom of*sse*

Algorithm for Calculating the F Value

This node calculates the F value using the following equation:

$\mathrm{fa}=\frac{\mathrm{msa}}{\mathrm{mse}}$

where

*msa*is the mean square quantity of*ssa**mse*is the mean square quantity of*sse*

The greater *msa* is relative to *mse*, which means, the greater *fa* is, the more significant effect the factor has on the experimental outcome.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

Using age as a factor, this example demonstrates how to test whether age has an effect on the number of sit-ups a person can do.

The following table defines the levels of age.

Level 0 | 6 years old to 10 years old |

Level 1 | 11 years old to 15 years old |

Level 2 | 16 years old to 20 years old |

The following table lists the results of a random sampling of five people. The results are based on a series of observations of how many sit-ups people from different age groups can do.

Person 1 | 8 years old (Level 0) | 10 sit-ups |

Person 2 | 12 years old (Level 1) | 15 sit-ups |

Person 3 | 16 years old (Level 2) | 20 sit-ups |

Person 4 | 20 years old (Level 2) | 25 sit-ups |

Person 5 | 13 years old (Level 1) | 17 sit-ups |

The following table lists the inputs and outputs of this node.

level |
3 | |

x |
[10, 15, 20, 25, 17] | |

index |
[0, 1, 2, 2, 1] | |

summary |
ssa |
110.7 |

sse |
14.5 | |

dofa |
2 | |

dofe |
2 | |

msa |
55.35 | |

mse |
7.25 | |

fa |
7.63448 | |

0.0 |
0 | |

significance |
0.1158 |

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: This product does not support FPGA devices