[R] Means from balanced incomplete block design

N.W.Galwey nw.galwey at ukonline.co.uk
Sat Jan 21 23:52:47 CET 2006

The code below is intended to analyse a textbook example of a balanced
incomplete block design:

# Data taken from  pp. 219-230 in
# Cox, D.R. (1958) Planning of Experiments. John Wiley and Son, Inc. New
York. 308 pp.
day <- factor(rep(1:10, each = 3))
T <- factor(c("T4","T5","T1","T4","T2","T5","T2","T4","T1","T5",
response <- c(4.43,3.16,1.40,5.09,1.81,4.54,3.91,6.02,3.32,4.66,
incomplt.blk.modelaov <- 
   aov(response ~ T + Error(day))
model.tables(incomplt.blk.modelaov, type = "means", se = TRUE)

It gives the correct anova, but the attempt to extract the treatment means
using function model.tables() produces the following error:

Error in FUN(X[[1]], ...) : eff.aovlist: non-orthogonal contrasts would give
an incorrect answer

Is there a way to obtain these means, either with or without recovery of
inter-block information?   

(N.B. The means with recovery of inter-block information can be obtained
from lme() after loading package nlme, but I'd like to do this using an
anova approach rather than a mixed modelling approach if possible.)

Thank you in anticipation.

Nick Galwey

More information about the R-help mailing list