Skip to content
Prev 181198 / 398502 Next

anova leads to an error

Skotara wrote:
Hmm, It didn't work in 2.8.1 either.

Anyways, the direct cause of the problem is that the construction

sapply(deltassd, function(X) diag((T %*% X %*% t(T))))

will return a vector, not matrix, if T is 1 x p. This happens inside

apply(abs(sapply(deltassd, function(X) diag((T %*% X %*% t(T))))), 1, max)

and obviously, apply() is confused. We need an as.matrix(), which we do
have at other points in the function.

For a quick workaround, use test="Spherical". It is really a univariate
problem so all the tests are equivalent (in fact,
anova(lm(rowMeans(exam) ~ gg)) also works).