我有一个完全随机的区组设计,包含三个处理和四个重复。连续四年对生物多样性进行了测量。
我认为将重复测量作为随机项的混合模型应该适合分析这种设计。
我的假设是,考虑到所有年份,治疗之间的生物多样性是不同的。
这是我的分析:
library(nlme)
library(multcomp)
# Made-up random dataset
mydata <- data.frame(
Treatment=rep(c("Control", "Irrigation", "Fertailization"), 16),
Block=rep(1:4, 12),
Year=rep(2000:2003, 12),
Value=runif(48, 0.5, 1.5)
)
# Model Treatment is a fixed effect, Year is a random effect
fit <- lme(Value ~ Treatment, random = ~1|Year, data = mydata)
# Post-hoc comparison
summary(glht(fit,linfct=mcp(Treatment="Tukey")))
我的问题:
我的模型正确吗?
事后比较是否合适?
我怎么能包括博克效应?
如果我理解正确,“年”应该嵌套在“块”中——所以正确的模型应该这样编码:
fit <- lme(Value ~ Treatment, random = ~1|Block/Year, data = mydata)
数据中似乎存在线性时间趋势。我怎么能在模型中解释这一点?