How can I develop a negative binomial model where the overdispersion parameter is a function of one of the independent variables?

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)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.