[R] Balanced design throws "design unbalanced, cannot proceed" error

David Winsemius dwinsemius at comcast.net
Tue May 7 18:28:03 CEST 2013


On May 7, 2013, at 8:33 AM, Krysta Chauncey wrote:

> I think this means an unequal sample in different conditions. But it seems
> to mean something else. . .
> 
> I have a data set like below
> 
> particip    group   device  width   length  accep   thresh  rating
> d-rating1           RA      Dingo   nom     nom     Y       5       8
>     31           RA      Dingo   nom     long    Y       4       6
>   21           RA      Dingo   fat     nom     Y       4       6
> 21           RA      Dingo   fat     long    N       6       4
> -2
> 
> and I'm running an ANOVA on it like so
> 
> aov.AMIDS_d <- aov(d.rating ~ group*device*width*length +
> Error(particip/(device*width*length))+group,data.AMIDS_d)
> 
> This works ok until I try to print the condition means like so
> 
> print(model.tables(aov.AMIDS_d,"means"),digits=3)
> 
> and it says
> 
> Error in model.tables.aovlist(aov.AMIDS_d, "means") : design is
> unbalanced so cannot proceed
> 
> According to the design, it ought to be balanced, so I need to check my
> data structure. I tried
> 
> table(data.AMIDS_d[,2:5])

In this table there is a variable named "devicegroup". In the model there are terms named 'device' and 'group" but none named 'devicegroup'. This error  could have been identified 4 days ago on SO if you had edited the question to include the results of that table operation. It would have been even better to also  offer str(aov.AMIDS_d).

-- 
David.

> 
> to give a table of observations per condition and got this
> 
> , , width = fat, length = long
> 
>     devicegroup Dingo SNAR
>   NR    12   12
>   NV    12   12
>   RA    12   12
> , , width = nom, length = long
> 
>     devicegroup Dingo SNAR
>   NR    12   12
>   NV    12   12
>   RA    12   12
> , , width = fat, length = nom
> 
>     devicegroup Dingo SNAR
>   NR    12   12
>   NV    12   12
>   RA    12   12
> , , width = nom, length = nom
> 
>     devicegroup Dingo SNAR
>   NR    12   12
>   NV    12   12
>   RA    12   12
> 
> which looks both correct and balanced. So what am I missing, where's this
> error coming from?
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA



More information about the R-help mailing list