Performs a two-way analysis of variance (ANOVA) and determines whether the two factors and their interaction have a significant effect on the experimental outcome.
Number of levels in factor b. levels b must be equal to or greater than 2. Otherwise, this node returns an error.
Specify a positive value if b is a fixed effect. Specify a negative value if b is a random effect.
Default: 2
Number of levels in factor a. levels a must be equal to or greater than 2. Otherwise, this node returns an error.
Specify a positive value if a is a fixed effect. Specify a negative value if a is a random effect.
Default: 2
All the observational data. You must specify an equal number of observations in each cell.
The total number of data points in x must equal the result of multiplying the number of levels in each factor and the number of observations per cell. Otherwise, this node returns an error. For example, if level a is 2, level b is 3, and observations per cell is 2, x must contain 12 data points.
The level of factor a to which the corresponding observation belongs.
This node converts arrays that do not begin with 0 or have nonconsecutive values into arrays of consecutive values that begin with 0. For example, if you enter [3, 5, 7], this node converts the array into [0, 1, 2].
The level of factor b to which the corresponding observation belongs.
This node converts arrays that do not begin with 0 or have nonconsecutive values into arrays of consecutive values that begin with 0. For example, if you enter [3, 5, 7], this node converts the array into [0, 1, 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
Number of observations in each cell. observations per cell must be equal to or greater than 1. Otherwise, this node returns an error.
Default: 1 — Causes this node to ignore the interaction between the factors and return False in ab significant?. Both levels a and levels b must be positive if observations per cell is 1.
Acceptable probability that this node incorrectly rejects a true null hypothesis.
significance level is a threshold value used to judge whether a factor has a significant effect on the experimental outcome.
Default: 0.05
Significance values of the factors and their interaction.
Algorithm for Calculating significance
This node calculates significance using the following equations:
where Fn1, n2 is the F distribution with n1 and n2 degrees of freedom.
Significance value associated with factor a.
Significance value associated with factor b.
Significance value associated with the interaction of factors a and b.
A 4-by-5 matrix that displays the obtained values for analysis.
where
Algorithm for Calculating Sums of Squares
This node calculates the sums of squares using the following equations:
where
Algorithm for Calculating Degrees of Freedom
Algorithm for Calculating Mean Squares
This node calculates the mean squares using the following equations:
where
Algorithm for Calculating F Values
Result of the analysis. Each Boolean value in this output indicates whether the corresponding factor or interaction of the factors has a significant effect on the experimental outcome.
True | The corresponding element in significance is equal to or less than significance level, which means the corresponding factor or interaction of the factors has a significant effect on the experimental outcome. |
False | The corresponding element in significance is -1 or is greater than significance level, which means the corresponding factor or interaction of the factors does not have a significant effect on the experimental outcome. |
Boolean value that indicates whether factor a has a significant effect on the experimental outcome.
Boolean value that indicates whether factor b has a significant effect on the experimental outcome.
Boolean value that indicates whether the interaction of factors a and b has a significant effect on the experimental outcome.
Error information.
The node produces this output 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.
A factor is a basis for categorizing data. A factor is a random effect if it has a large population of levels about which you want to draw conclusions but such that you cannot sample from all levels. You thus pick levels at random and generalize about all levels.
A factor is a fixed effect if you can sample from all levels about which you want to draw conclusions.
In ANOVA, cells mean level combinations of multiple factors. For example, if you specify the inputs for this node as shown in the following table, the second table below illustrates the cell distributions.
levels b | 3 |
levels a | 2 |
x | [10, 17, 20, 25, 12, 4, 11, 16, 18, 24, 14, 6] |
index a | [0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0] |
index b | [0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2] |
observations per cell | 2 |
factor b (Level 0) | factor b (Level 1) | factor b (Level 2) | |
---|---|---|---|
factor a (Level 0) | 10, 11 | 12, 14 | 4, 6 |
factor a (Level 1) | 17, 16 | 25, 24 | 20, 18 |
Using age and weight as factors, this example demonstrates how to test whether age or weight has a significant effect on the number of sit-ups a person can do.
The following table defines the levels of age and weight.
factor a (age) | Level 0 | 10 years old to 20 year old |
Level 1 | 21 years old to 30 years old | |
factor b (weight) | Level 0 | less than 50 kg |
Level 1 | between 50 kg and 70 kg | |
Level 2 | more than 70 kg |
The following table lists the results of a random sampling of twelve people. The results are based on a series of observations of how many sit-ups people from different age and weight groups can do.
Person 1 | 14 years old (Level 0) | 40 kg (Level 0) | 10 sit-ups |
Person 2 | 22 years old (Level 1) | 48 kg (Level 0) | 17 sit-ups |
Person 3 | 27 years old (Level 1) | 72 kg (Level 2) | 20 sit-ups |
Person 4 | 24 years old (Level 1) | 65 kg (Level 1) | 25 sit-ups |
Person 5 | 12 years old (Level 0) | 51 kg (Level 1) | 12 sit-ups |
Person 6 | 18 years old (Level 0) | 71 kg (Level 2) | 4 sit-ups |
Person 7 | 16 years old (Level 0) | 45 kg (Level 0) | 11 sit-ups |
Person 8 | 25 years old (Level 1) | 49 kg (Level 0) | 16 sit-ups |
Person 9 | 29 years old (Level 1) | 75 kg (Level 2) | 18 sit-ups |
Person 10 | 21 years old (Level 1) | 61 kg (Level 1) | 24 sit-ups |
Person 11 | 17 years old (Level 0) | 53 kg (Level 1) | 14 sit-ups |
Person 12 | 19 years old (Level 0) | 73 kg (Level 2) | 6 sit-ups |
The following table lists the inputs and outputs of this node.
levels b | 3 | |
levels a | 2 | |
x | [10, 17, 20, 25, 12, 4, 11, 16, 18, 24, 14, 6] | |
index a | [0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0] | |
index b | [0, 0, 2, 1, 1, 2, 0, 0, 2, 1, 1, 2] | |
observations per cell | 2 | |
significance level | 0.05 | |
significance | significance a | 3.4353E-06 |
significance b | 0.000334898 | |
significance ab | 0.00612114 | |
summary | ssa | 330.75 |
ssb | 100.5 | |
ssab | 33.5 | |
sse | 7.5 | |
dofa | 1 | |
dofb | 2 | |
dofab | 2 | |
dofe | 6 | |
msa | 330.75 | |
msb | 50.25 | |
msab | 16.75 | |
mse | 1.25 | |
fa | 264.6 | |
fb | 40.2 | |
fab | 13.4 | |
0.0 | 0 | |
F critical a | 5.98736 | |
F critical b | 5.14321 | |
F critical ab | 5.14321 | |
0.0 | 0 | |
conclusion | a significant? | True |
b significant? | True | |
ab significant? | True |
Because all the Boolean values in conclusion are True, you can conclude that based on the sampling data, age, weight, and the interaction of age and weight have a significant effect on the number of sit-ups a person can do.
Where This Node Can Run:
Desktop OS: Windows
FPGA: Not supported
Web Server: Not supported in VIs that run in a web application