Reputation: 371
I have a data named "doctor" which is concerned with the number of deaths by heart disease in a sample of doctors from different age groups and with different smoking status (smoker/non-smoker).
V2 V3 L4 V5
1 1 32 10.866795 1
2 2 104 10.674706 1
3 3 206 10.261581 1
4 4 186 9.446440 1
5 5 102 8.578665 1
6 1 2 9.841080 2
7 2 12 9.275472 2
8 3 28 8.649974 2
9 4 28 7.857481 2
10 5 31 7.287561 2
There are 4 variables: V2 (age groups indexed 1-5), V3 (number of deaths), L4 (log of aggregate years at risk) and V5 (smoking status represented by 1 or 2). I wish to fit a negative binomial regression using the code nb1=glm.nb(V3~V2+L4+V5,data=doctor)
but get the error message In glm.nb(V3 ~ V2 + L4 + V5, data = doctor) : alternation limit reached
. What is the problem here?
Upvotes: 0
Views: 198
Reputation: 1
You can increase the number of iterations with glm.control
The following code ran on my system:
glm.control(maxit = 25)
nb1=glm.nb(V3~V2+L4+V5, data=doctor)
Upvotes: 0