用于不平衡嵌套设计的线性混合模型
我从我的实验设计中收集了以下数据集。我有两个物种(sp1和sp2),在sp1中我有两个种质(a1和a2),它们是不同类型的材料(L和CV),然后在每个种质中,我随机取出两颗种子(1和2)并生长后,我从每个种子中生成了两个克隆(1 和 2),并且我对 a2 做了同样的事情。在数据集中,我有另一个物种 sp2,它只有一个种质 (a3),但也对该物种进行了相同的克隆。
据我所知,这种类型的实验设计被称为不平衡嵌套设计,其中因子的水平与阶乘或其他平衡设计不同。 现在我想进行方差分析以获得以下结果:
1:方差分析,以便种质嵌套在物种中,并根据测量的性状 Y1 和 Y2 查看物种之间的差异,然后与邓肯分组字母相关的情节。
图 2:比较两个物种的图,同时也表示(分组)不同类型(L、CV 和 W)。如果您能帮助我,我真的很感激。多谢。
df <- data.frame(species=c(rep("sp1",8),rep("sp2",4)),
accession=c(rep("a1",4),rep("a2",4), rep("a3", 4)),
type=c(rep("L",4),rep("CV",4), rep("W", 4)),
seed=c(rep("1",2),rep("2",2), rep("1", 2), rep("2", 2),
rep("1", 2), rep("2", 2)),
clone=c(rep("1",1),rep("2",1), rep("1", 1), rep("2", 1),
rep("1", 1), rep("2", 1), rep("1",1),rep("2",1), rep("1", 1), rep("2", 1),
rep("1", 1), rep("2", 1)),
Y1 = c(11, 10, 8, 9, 20, 21, 19, 19, 6, 5, 7, 8),
Y2 = c(34, 31, 23, 25, 44, 45, 33, 34, 14, 11, 16, 13))
I have the following data set collected from my experimental design. I have two species (sp1 and sp2), in sp1 I have two accessions (a1 and a2) which are different types of material (L and CV), and then in each accession, I randomly took two seeds (1 and 2) and after growing I generated two clones from each seed (1 and 2) and I did the same for a2. In the dataset, I have another species sp2 which only has one accession (a3) but the same cloning was done for this species also.
As far as I know, this type of experimental design is named as unbalanced nested design, in which factors don't have the same levels as factorial or other balanced designs.
Now I want to perform an analysis of variance to get the following results:
1: analysis of variance so that accession is nested in species and to see the differences between species based on measured traits Y1 and Y2 and then relevant plot with Duncan grouping letters.
2: a plot of comparing two species while different types (L, CV, and W) are also represented (are grouped). I really appreciated it if you could help me. Thanks a lot.
df <- data.frame(species=c(rep("sp1",8),rep("sp2",4)),
accession=c(rep("a1",4),rep("a2",4), rep("a3", 4)),
type=c(rep("L",4),rep("CV",4), rep("W", 4)),
seed=c(rep("1",2),rep("2",2), rep("1", 2), rep("2", 2),
rep("1", 2), rep("2", 2)),
clone=c(rep("1",1),rep("2",1), rep("1", 1), rep("2", 1),
rep("1", 1), rep("2", 1), rep("1",1),rep("2",1), rep("1", 1), rep("2", 1),
rep("1", 1), rep("2", 1)),
Y1 = c(11, 10, 8, 9, 20, 21, 19, 19, 6, 5, 7, 8),
Y2 = c(34, 31, 23, 25, 44, 45, 33, 34, 14, 11, 16, 13))
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
作为开始:
首先使用
lme4
/lmerTest
(固定效应的 p 值需要后者)结果:
现在使用
nlme
:两个包之间的大多数结果都匹配(入种间和残差方差的估计;固定效应的估计和标准误差;speciesp2 的分母 df 和 p 值)。唯一的区别在于截距的估计 df/p 值,这可能在科学上并不重要(即测试物种 1 的
Y1
是否与零显着不同)。As a start:
first with
lme4
/lmerTest
(the latter is needed for p-values on the fixed effects)Results:
Now with
nlme
:Most results match between the two packages (estimate of among-accession and residual variance; estimates and standard errors for fixed effects; denominator df and p-value for
speciesp2
). The only difference is in the estimated df/p-value for the intercept, which is probably not scientifically important (i.e., testing whetherY1
is significant different from zero for species 1).