我正在尝试绘制回归分析
我创建了一个glm模型来确定农业对鸟类物种丰富度的影响。
这是我的glm代码:
spec_rich_final <- glm(species_richness ~ (trans_forest * fert_total) +
agri + I(trans_agri^2) + diversity + (I(diversity^2)) + (I(trans_forest^2)
* fert_total) + trans_semi_natural + bio1, poisson(link = "log"),
data=data_transformed)
这是我的绘图代码:
effect_plot(spec_rich_final, pred = agri, interval = TRUE,
partial.residuals = TRUE)
然后我得到这个错误:
Error in names(o) <- rownames(attr(terms(formula), "factors")) :
'names' attribute [10] must be the same length as the vector [8]
有人可以帮忙吗?不知道属性10或向量8是什么意思?