I am trying to develop a negative binomial model where the dependent variable is crash count, and the independent variables are traffic count and roadway length. Currently, with the below code, I get only one value of overdispersion parameter. But I want to get the overdispersion parameter as a function of roadway length. Can you please tell me what should I change in the code? Thank you very much!
Crash_count<- glm.nb(Total_crashes~LN(traffic_count) + road_length, data=mydata)