Function produces wrong output if (A) one of the factors has more than 10 levels and more than 10 subjects are used or (B) both factors have more than 10 levels.
The reason is that the "eval()" function is used to create temporary storage variables. Unfortunately, the result of "factorlevel 1" and "subject 11" is written into the the same variable "x111" as the result of "factorlevel 11" and "subject 1" (because both numbers are simply concatenated to produce the storage variable name), that is, the value of this variable is accidentally overwritten on subsequent iterations. This produces wrong results and also explains the negative F-values reported above.
Warning. This function (and apparently all other ANOVA functions by this author) produces a wrong output if (A) one of the factors has more than 10 levels and more than 10 subjects are used or (B) both factors have more than 10 levels.
The reason is that the "eval()" function is used to create temporary storage variables. Unfortunately, "factorlevel 1" and "subject 11" and "factorlevel 11" and "subject 1" are written into the same storage variable with the concatenated name "x111", that is, the value of this variable is accidentally overwritten. This produces wrong results and also explains the negative F-values reported above.