error glm, NA/NaN/Inf in 'y

不羁的心 提交于 2019-12-11 17:52:13

问题


I am trying to fit a GLM model to my data. The data (rope_complete) looks like this:

      rope.X...Sound rope.directional.change rope.Time.of.the.shark.in.the.video
1           5_min_blank                       5              23
2           Snorkeling                        11             37
3                 Fish1                       1              17
4                 Fish1                       6              46
5                 Diving                      6              37

Now i wanted to check if I have NA values:

table(is.na(rope_complete))

and saw that I have none:

FALSE  : 3225 

Now I did my GLM:

directional_turn_fit<-glm(rope_complete$rope.directional.change~
                        rope_complete$rope.X...Sound
                      +offset(
          log(rope_complete$rope.Time.of.the.shark.in.the.video))
          , family = poisson)

but i still get the same error:

Error in glm.fit(x = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,  :             
Na/NaN/Inf in 'y'

I am a little bit lost, because i have no idea what i should do now. I know my data is Poisson distributed.

来源:https://stackoverflow.com/questions/50043467/error-glm-na-nan-inf-in-y

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!