Hi Rick, The error and total sums of squares in the two ANOVA tables are not matching. The problem stems from unique(G) which considers the means in alphabetical order by group name, for the code to work the data must be presented in the same order, or you need to add some code to match each group to the right group mean.