Dear R-users, I have 3 plant populations (fixed). Within each population there is the same number of “families” (random) – the seed progeny of the same plant. These families were exposed to 2 treatments (fixed) and their response was measured (mean values for 25 seedlings per family per treatment are presented in data table). I would like to know if there is a significant difference in the response of populations between the treatments (primarily the interaction term, and the main effects as well) taking into account an important (from biological point of view) thing that progeny of each plant (i.e. family) was exposed to both treatments. Taking the artificial example one could easily do it with car-package: library(car) dat <- data.frame(Family = 1:60, # Plant family name Pop = rep(c("Pop1","Pop2","Pop3"), each=20), # Population name Cond1 = rnorm(60, 15, 1), # obtained values at experimental conditions 1 Cond2 = rnorm(60, 20, 1)) # experimental conditions 2 # rearrange data data.wide <- data.frame(Family = 1:20, subset(dat, dat$Pop == "Pop1")[3:4], subset(dat, dat$Pop == "Pop2")[3:4], subset(dat, dat$Pop == "Pop3")[3:4]) names(data.wide)[2:7] <- c("Pop1.Cond1","Pop1.Cond2", "Pop2.Cond1","Pop2.Cond2", "Pop3.Cond1","Pop3.Cond2") # define the structure of analysis design <- data.frame(Pop = rep(c("Pop1","Pop2","Pop3"), each=2), Cond = rep(c("Cond1","Cond2"))) # define the model mod <- lm(as.matrix(data.wide[, -1]) ~ 1) an <- Anova(mod, idata = design, idesign = ~Pop * Cond) summary(an) But obviously this is not the right way to analyse this data because plant families are nested within the populations. So I’m struggling with how to incorporate this information into the model. Tanks in advance for any suggestions and/or helpful links! Vladimir. PS. If it’ll be easier to do it with the long format of data one can run this code: library(reshape2) data.long <- melt(dat, measure.vars=c("Cond1", "Cond2"), variable.name ="Cond") -- Vladimir Mikryukov, PhD Institute of Plant & Animal Ecology UD RAS, Lab. of Population and Community Ecotoxicology [8 Marta 202, 620144, Ekaterinburg, Russia] [[alternative HTML version deleted]]