Skip to content

Estimated Effects Not Balanced

6 messages · Justin Thong, Bert Gunter, Richard M. Heiberger +1 more

#
Something does not make sense in R. It has to do with the question of
balance and unbalance.

*A<-factor(c(1,1,1,1,1,1,2,2,2,2,2,2))*
*B<-factor(c(1,1,2,2,3,3,1,1,2,2,3,3))*
*y<-rnorm(12)*
*mod<-aov(y~A+B)*

I was under the impression that the design is balanced ie order does not
effect the sums of squares. However, when I compute the anova R reports
that the Estimated Effects are Unbalanced. I thought that when all
combinations of levels of A and B have equal replications then the design
is called balanced. But, R tends to think that when not all levels of A and
levels of B have equal replication, then the "Estimated Effects are
unbalanced".... Is this the same as the design being unbalanced? Because
for the example below, where the error occured, the order does not matter
(which make me think that the design is balanced).


*Call:*
*   aov(formula = y ~ A + B)*

*Terms:*
*                        A         B Residuals*
*Sum of Squares   0.872572  0.025604 16.805706*
*Deg. of Freedom         1         2        10*

*Residual standard error: 1.296368*
*Estimated effects may be unbalanced*
#
Please!

"when I compute the anova R reports
that the Estimated Effects are Unbalanced"


It does *not* say this. It says that they **may** be unbalanced. They are not.

-- Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Aug 22, 2016 at 8:15 AM, Justin Thong <justinthong93 at gmail.com> wrote:
#
The problem is that you have 12 observations and 1+2+10=13 degrees of freedom.
There should be 1 + 2 + 8 = 11 degrees of freedom.
Probably one of your variables is masked by something else in you workspace.
Protect yourself by using a data.frame
+ B=factor(c(1,1,2,2,3,3,1,1,2,2,3,3)),
+ y=rnorm(12))
Df Sum Sq Mean Sq F value Pr(>F)
A            1  1.553   1.553   1.334  0.281
B            2  3.158   1.579   1.357  0.311
Residuals    8  9.311   1.164
On Mon, Aug 22, 2016 at 11:15 AM, Justin Thong <justinthong93 at gmail.com> wrote:
#
Thanks, Rich. I didn't notice that!

-- Bert
Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Aug 22, 2016 at 1:43 PM, Richard M. Heiberger <rmh at temple.edu> wrote:
#
Hi,

Thanks Richard,

That was me playing with too many examples and having too many variables
just lying around. Thanks for the tip though.
On 22 August 2016 at 23:32, Bert Gunter <bgunter.4567 at gmail.com> wrote:

            

  
    
#
On 22 Aug 2016, at 17:15 , Justin Thong <justinthong93 at gmail.com> wrote:

            
As an aside, notice that this is one case where posting in HTML goes against your own interests (let alone the posting guide). The above cannot be cut+pasted, so fewer people will be willing to try it.