# Negative binomial estimate output

I am doing a negative binomial regression:

m1 <- glm.nb(Trip ~ Origin + Destination + Distance, data)


I then wanted to get the predicted values to compare with the actual values

PredictTrip <- predict(m1)


My question is, I read on several websites that the predicted values need to be exponentiated because it is in log form. However, if I exponentiate the predicted values, it becomes ridiculously large (i.e. E+20, or even Infinity). If I did not exponentiate it, the values are close and comparable to the actual values. Which one is right? Thanks.

You don't necessarily need to exponentiate.

When you execute predict(m1), what is called is the predict.glm() function. Here is its help page:

Usage:

## S3 method for class 'glm'
predict(object, newdata = NULL,

Note in particular the type parameter, which governs what type of predictions or fits you will get. By default (type="link"), you get a prediction on the level of the link function. What you want is a mean response prediction, so do
predict(m1, type="response")