I want to fit my data to a negative binomial regression model. The dependent variable Y is count data with many 0's and the independent variable X is continuous. For this, I want to check if the variables are linearly related using a simple scatterplot. Because of the log-link in the nb-model, I'm assuming that I have to plot the natural log of Y with X, but the natural log of 0 is -infinity. Some blog posts advised to add +1 to the count variable, but others argue against it. However, they were talking about transforming variables and not about checking linearity for a nb-model.

Is it safe to add +1 to the count variable for the plot only, or do I then plot something different from what I actually want to plot?

I'm using R, but my question should be applicable to other software, too.

New contributor
ratsrule23 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

ratsrule23 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.