Hello, I am performing a BACI analysis with ANOVA using the following glm:
fit1<-glm(log(Cucs_m+1)~(BA*Otter)+BA+Otter+ID+Primary, data=b1) The summary(aov(fit1)) shows significance in the interaction; however, now I would like to determine what combinations of BA and Otter are significantly different (each factor has two levels). ID and PRIMARY substrates are categorical and included in the model to help explain some of the variation in the data. The data is unbalanced so I plan on using Tukey Kramer post hoc analysis. Here is how my data is laid out, it is a fairly substantial data set: Subdistrict T Year Cucs_m Primary Persistence Otter Fishing BA ID 109-41,42 9 2010 0.00 sil 3 1 1 A 109-41,42 109-41,42 13 2010 2.75 rck 3 1 1 A 109-41,42 109-41,42 16 2010 2.00 rck 3 0 1 A 109-41,42 109-41,42 18 2010 8.25 rck 3 0 0 B 109-41,42 I am assuming this is an appropriate pairwise comparison analysis and I cannot get the code to work with my data. I am *unclear how to code it to work with the interaction*; however, even when I attempt to use it only for a single factor, it does not work (see below). x<-aov(glm(Cucs_m~as.factor(BA),data=cuc)) glht(x, linfct=mcp(BA="Tukey")) .................................... Error in mcp2matrix(model, linfct = linfct) : Variable(s) ‘BA’ have been specified in ‘linfct’ but cannot be found in ‘model’! Can anyone off suggestions on potential problems with my approach and/or script issues? Thank you very much in advance. -- View this message in context: http://r.789695.n4.nabble.com/Tukey-Kramer-with-ANOVA-glm-tp4633314.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ R-help@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.