# [R] "Estimate effects may be unbalanced" in aov()

Max Manfrin mmanfrin at ulb.ac.be
Mon Oct 22 11:36:44 CEST 2007

```On 22 Oct 2007, at 10:50, Prof Brian Ripley wrote:

> On Mon, 22 Oct 2007, Max Manfrin wrote:
>
>> Can anybody explain me what does it mean "Estimated effects may be
>> unbalanced", and what does it imply for the anova analysis?
>
> The help page does!  I suspect you intended to use factors, and
> have not done so, and also that you did not intend to replicate res.
>
> Try
>
> D <- expand.grid(A=factor(c(0,1,2,3)),B=factor(c(0,1)),C=factor(c
> (0,1)))
> aov(rnorm(16) ~ A * B * C, data = D)

> D<-expand.grid(A=factor(c(0,1,2,3)),B=factor(c(0,1)),C=factor(c
(0,1)))
> D
A B C
1  0 0 0
2  1 0 0
3  2 0 0
4  3 0 0
5  0 1 0
6  1 1 0
7  2 1 0
8  3 1 0
9  0 0 1
10 1 0 1
11 2 0 1
12 3 0 1
13 0 1 1
14 1 1 1
15 2 1 1
16 3 1 1
> aov(rnorm(16) ~ A*B*C, data=D)
Call:
aov(formula = rnorm(16) ~ A * B * C, data = D)

Terms:
A        B        C      A:B      A:C
B:C    A:B:C
Sum of Squares  9.327827 0.256657 0.172870 4.054674 0.079648 3.214687
2.828070
Deg. of Freedom        3        1        1        3        3
1        3

Estimated effects may be unbalanced
> !is.list(replications(formula=rnorm(16)~A*B*C,data=D))
[1] TRUE

The number of replicates for each factor is the same. I guess that
the unbalanced refers to the number of observations that each level
in a factor has, am I correct?
For calculating HSDTukey confidence intervals for interaction plots
in such unbalanced design, what should I do?

--------------------------------------------------------------------
Max MANFRIN                                 Tel.: +32 (0)2 650 3168
IRIDIA - CoDE, CP 194/6                     Fax.: +32 (0)2 650 2715
Université Libre de Bruxelles
Av. F. D. Roosevelt, 50
1050 Brussels                             Email: mmanfrin at ulb.ac.be
BELGIUM                      WWW: http://iridia.ulb.ac.be/~mmanfrin

gpg DSA: 0xD3956AAF
gpg fingerprint: 1D69 8664 EF25 FCDE 229F FCA1 E66F EAC5 D395 6AAF
--------------------------------------------------------------------

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : https://stat.ethz.ch/pipermail/r-help/attachments/20071022/2c9aa736/attachment.bin
```