问题
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