我正在尝试将GLM模型适合我的数据。数据(rope_complete
)如下所示:
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
现在我想检查我是否具有NA
值:
table(is.na(rope_complete))
看到我没有:
FALSE : 3225
现在我做了我的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)
但是我仍然遇到相同的错误:
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'
我有点迷茫,因为我不知道我现在应该做什么。我知道我的数据是泊松分布的。