4

There is a certain probability that ANOVA provides negative variance estimates. According to [Searle et al. : Variance components] (https://onlinelibrary.wiley.com/doi/book/10.1002/9780470316856) p67 this probability for one-factor, balanced designs can be described by the following equation:

$$ \textrm{Pr}(\hat \sigma^2_a<0) = \textrm{Pr}\left( F_{a-1}^{a(n-1)} > 1+ n\tau \right) \quad \textrm{for} \quad \tau = \sigma^2_a/\sigma^2_e $$

I tried to calculate this probability for different scenarios with the following R code:

no_groups <- 10
n <- 2:100
df1 <- no_groups*(n-1)
df2 <- no_groups-1
tau <- 0.01
x <- 1 + n*tau

prob <- pf(x, df1, df2, lower.tail = F, log.p = FALSE) prob

plot(n, prob)

I would expect that P decreases as n (or the number of groups) increases. But this is the plot that I get: enter image description here

I find it odd that at low n (2-4) the probability of negative estimates increases as n increases (at tau = 0.01) and it shows the expected behaviour only from n=4.

Is there something wrong with the code (the values in the book can be verified with it)? Or with the equation in the Searle book? Or is it related to the characteristics of an F distribution?

Edit (additional info)

By converting the above code into a function, contour plots, similar to the ones shown on page 68 can be created. I added two additional contour plots with P values of 0.5 and 0.6 and $\quad \tau$ was set to 0.01 just like in the book. The contour plots (0.01 < P < 0.4) look similar to the ones published in the book. However, the two additional contour plots show an inflection point at low n (most obvious at P = 0.5), which I would not expect. As Searle et. al point out, "having many classes is more important than having more observations per class" so increasing the number of classes and the number of observations does not have the same effect on the probability of negative estimates, but I still find it surprising. enter image description here

  • Just to confirm, you verified all the values in the table in the book (as well as maybe the figure on the next page)? – Ben Bolker Jun 14 '23 at 16:25
  • It would be interesting to work out the derivative with respect to $n$ and confirm that it's negative (see ?pf, which expresses pf in terms of pbeta; this is a straightforward exercise I think, but "thought is irksome and three minutes is a long time" to quote Lewis Carroll ...) – Ben Bolker Jun 14 '23 at 16:33
  • In two cases there is a difference of 1 unit in the last digit, all the others are the same. (My first thought was that due to rounding!?) Thanks Ben! I will check your other suggestions. – Kalman Toth Jun 15 '23 at 07:06

0 Answers0