当我运行anova
函数时,我正在从以下数据集中收到此错误消息:summary(aov(Site~Chlo,data=alldata))
。数据集保存在txt文件下。运行anova时出现错误消息
Error in levels(x)[x] : only 0's may be mixed with negative subscripts
In addition: Warning messages:
1: In model.response(mf, "numeric") :
using type = "numeric" with a factor response will be ignored
2: In Ops.factor(y, z$residuals) : - not meaningful for factors
Year Site Chlo DAC PARD SST
2003 Seych 2.95 0.24 -39.36 0.40
2003 Brazil -2.35 -0.14 22.97 4.03
2003 Indo 0.42 0.04 6.82 0.60
2004 Seych 0.20 0.02 -2.30 -0.63
2004 Brazil -0.22 -0.01 -10.28 -1.22
2004 Indo 0.32 0.03 15.82 -1.72
这是背后的原因吗?
我很确定你想'Chlo〜Site'而不是'Site〜Chlo'。您应该阅读有关公式语法的文档。因变量在左侧,RHS的预测因子。 – Roland