Professional Documents
Culture Documents
A Nova Recitation
A Nova Recitation
To use built in Excel data analysis ("ANOVA: two-factor with replication") arrange the data like this:
Factor B
-1 1
Factor A -1 10.34 10.11 To perform two factor ANOVA, follow these steps
10.44 10.135 Click "data analysis" under the Data ribbon, and select "ANOVA: two-fa
10.29 10.095 *Note: if you don't see the Data Analysis button, you will need to load
1 10.32 10.234 For input range, highlight the cells outlined in green to the left
10.29 10.245 For number of rows per sample, put the number of replicates (in this ca
10.25 10.223 Choose an output range where Excel will provide the results of the ana
Excel will then produce the results of the ANOVA analysis (everything in the blue box was generated by Excel):
Anova: Two-Factor With Replication
SUMMARY -1 1 Total
-1
Count 3 3 6
Sum 31.07 30.34 61.41
Average 10.35667 10.11333 10.235
Variance 0.005833 0.000408 0.02026
1
Count 3 3 6
Sum 30.86 30.702 61.562
Average 10.28667 10.234 10.26033
Variance 0.001233 0.000121 0.001374
Total
Count 6 6
Sum 61.93 61.042
Average 10.32167 10.17367
Variance 0.004297 0.00458
ANOVA
Source of VariationSS df MS F P-value F crit
Sample 0.001925 1 0.001925 1.013867 0.343459 5.317655 Here "sample" refers to the
Columns 0.065712 1 0.065712 34.60348 0.000369 5.317655 "Columns" refers to the fact
Interaction 0.027265 1 0.027265 14.35773 0.005318 5.317655
Within 0.015192 8 0.001899
Total 0.110095 11
n this spreadsheet we will walk through performing ANOVA on this data three ways.
VA analysis function of Excel
ave the degrees of freedom column filled in. You should be able to complete the DOF column just from the experimental design
in the SS column
ese using the equations on slides 62 and 63 from week 1
-0.012667 SSA: 0.001925 (calculated as levels*replicates*sum of square error between A means and grand mean)
0.012667
0.074 SSB: 0.065712 (calculated as levels*replicates*sum of square error between B means and grand mean)
-0.074
nteraction "AB":
0.047667 SSAB: 0.027265 (calculated as replicates*sum of squares of interaction differences: y - y_i - y_j +grand mean)
-0.047667
-0.047667
0.047667
ually need to calculate each SS term. Since all the rows should sum to the total value, you can calculate all SS terms but one and use this
tment mean)
SS terms but one and use this simple sum rule to calculate the last SS term.
TreatmentFactor A Factor B Data
1 -1 -1 10.34 Lastly, if you prefer to use Matlab, we can use the function a
1 -1 -1 10.44 In this approach, the majority of our effort will be spent arra
1 -1 -1 10.29
2 1 -1 10.32 First, our output data should be put into a vector. We can do
2 1 -1 10.29 y = [10.34 10.44 10.29 10.32 10.29 10.25 10.11 10.135 10.095
2 1 -1 10.25 Note that in practice it is usually easier to cut and paste the
3 -1 1 10.11
3 -1 1 10.135 next we need to define the factors and levels associated wit
3 -1 1 10.095 The levels associated with factor A (or "group 1" in Matlab c
4 1 1 10.234 g1 = [-1 -1 -1 1 1 1 -1 -1 -1 1 1 1]
4 1 1 10.245 The levels associated with factor B (or "group 2" in Matlab c
4 1 1 10.223 g2 = [-1 -1 -1 -1 -1 -1 1 1 1 1 1 1]
Basically, the "group" vectors should be set up so that if you
You'll notice that this table is a little different from our previ
We can rerun the function again with a slightly different fun
anovan(y,{g1,g2},'interaction')
To get the following table:
Which matches our ANOVA analysis from both Excel method
or B (or "group 2" in Matlab convention) can be defined with this line:
hould be set up so that if you look at the i-th entry, it should have the level associated with the i-th entry in the output data vector
ANOVA table:
little different from our previous tables. This is because by default, "anovan" doesn't consider interaction effects.
n with a slightly different function call:
alysis from both Excel methods.
wo factors, you just need to define more groups. So for example, the function call for a four factor MANOVA might look like this:
or and transpose it