首页 文章

交互图 - R中的双向anova编码失败

提问于
浏览
0

我试图在双因素方差分析中分析并呈现腹足类和物种上的腹足类丰度与高度的结果 .

这是数据集http://dropcanvas.com/ercb6

数据已经过sqrt转换,ANOVA测试成功 . 在下面的示例代码中,我能够绘制正常腹足类数据的交互图 . 但是,我想使用转换后的数据制作交互图,但我不知道如何更改代码以允许此操作 . 建议?

Gastropods = read.csv(file = "MaroubraZones.csv", header = TRUE)
boxplot(Abundance ~ Zone*Species,data = Gastropods, names = c("A.high", "A.mid", "A.low", "C.high", "C.mid", "C.low", "N.high", "N.mid", "N.low"))
Gastropods.ANOVA = aov(Abundance ~ Zone * Species, data = Gastropods)
hist(Gastropods.ANOVA$residuals)
plot(Gastropods.ANOVA)
summary(Gastropods.ANOVA)
Gastropods$sqrtAbundance = sqrt(Gastropods$Abundance +1)
Gastropods.aov = aov(Gastropods$sqrtAbundance ~ Zone + Species + Zone:Species, data = Gastropods)
summary(Gastropods.aov)

interaction.plot(Gastropods$Zone, Gastropods$Species, Gastropods$Abundance, main= "Gastropod Interaction Plot", xlab = "Gastropod Zone", ylab= "Mean of Gastropod Abundance", legend = TRUE)

1 回答

  • 1

    只是为了结束这个问题:

    interaction.plot(Gastropods$Zone, Gastropods$Species, Gastropods$sqrtAbundance, main= "Gastropod Interaction Plot", xlab = "Gastropod Zone", ylab= "Mean of SQRT Gastropod Abundance", legend = TRUE)
    

相关问题