首页 > 解决方案 > 即使是最简单的 glm 函数也出现“未使用的参数”错误

问题描述

我的代码是

counts <- c(18,17,15,20,10,20,25,13,12)
outcome <- gl(3,1,9)
treatment <- gl(3,3)
data.frame(treatment, outcome, counts)
glm.D93 <- glm(counts ~ outcome + treatment, family = poisson())

但是,当我运行时,它显示:

Error in list(counts, outcome, treatment) : unused argument (treatment)

似乎每个“glm”功能在我的 R 中都不起作用

标签: r

解决方案


推荐阅读