想要预测一个值,但这显然不是解决方案。我在做选择题测试,0.304分...不是正确使用answer.How ()的预测吗?
library(glm2)
data(crabs)
fit= glm(Satellites~Width,data=crabs, family="poisson")
plot(Satellites~Width,data=crabs)
abline(fit)
predict(fit, newdata=data.frame(Width=c(22)))
1
0.3042347 发布于 2013-02-20 03:01:54
默认情况下,泊松回归的函数predict() (一般用于GLM )将计算线性预测器的标度上的值,即本例中的对数标度(请参阅predict.glm的帮助文件)。
predict(fit, newdata=data.frame(Width=c(22)))
1
0.3042347 要在response变量的范围内获得预测值,您应该向函数predict()添加参数type="response"。
predict(fit, newdata=data.frame(Width=c(22)),type="response")
1
1.355587 https://stackoverflow.com/questions/14964836
复制相似问题