# Negative Binomial Regression Equation

I know that for a univariate linear regression the predictions are generated like: $$\hat{y} = \beta_0 + \beta_1 x$$

And for a univariate logistic regression the predictions are generated like:

$$\hat{y} = \dfrac{1}{1+e^{-(\beta_0 + \beta_1 x)}}$$

So my question is, what is the equation for a univariate negative binomial regression, specifically one fitted by R's nb.glm function? My guess is that it's something like:

$$\hat{y} = \binom{k+\theta-1}{k} \bigg(\frac{1}{1+e^{-(\beta_0 + \beta_1 x)}}\bigg)^k\bigg(1-\frac{1}{1+e^{-(\beta_0 + \beta_1 x)}}\bigg)^\theta$$

But then I don't know how to make sense of the parameters $k$ and $\theta$

I feel I've reached the limits of my google-fu, so any help would be much appreciated.

• Lol at Google-fu. As far as I can tell, it's the same as Poisson, so $e^{\beta_0+\beta_1 x}$. – Heteroskedastic Jim Jul 26 '18 at 1:46
• The fitted function usually predicts on the response scale. So a simple way to verify this would be to check if exp(X %*% coefs) equals fitted(model), where model is fitted using glm.nb, X is your model matrix and coefs are your regression coefficients. – Heteroskedastic Jim Jul 26 '18 at 1:52
• @jon You're specifying the conditional distribution as negative binomial, but the exact functional form depends on the link function, which is set by the "link" argument, it's not inherent in the fact that it's negative binomial. This is distinct from logistic regression (the logistic is the link function being used, the conditional distribution is binomial and other links may be used with that). The default link for the function you call (i.e. the one that's used if you don't specify a link) is the log link as can be seen by reading the help on the function. – Glen_b -Reinstate Monica Jul 26 '18 at 2:16
• You might be interested in Negative Binomial Regression by Hilbe. – Stephan Kolassa Jul 26 '18 at 8:00
• @Stephan It didn't seem like a full answer to me when I started to write it, though I guess it got closer after I edited it. I suppose I can post it but it still seems a little thin. – Glen_b -Reinstate Monica Jul 26 '18 at 12:48