# Negative binomial regression

Negative binomial regression |
---|

See also |

**Negative binomial regression** is a type of statistical analysis used to model and explain the relationship between a response variable and one or more explanatory variables. This type of regression is used when the response variable is a count or count-based data, such as the number of customer complaints, or the number of products purchased. It works by estimating the effects of the explanatory variables on the response variable, and by estimating the probability of an event occurring a specified number of times. By doing so, managers can better understand the underlying relationships between their explanatory variables and the response variable, and can use this information to make informed decisions.

## Example of negative binomial regression

- A company may use negative binomial regression to understand how the number of customer complaints is affected by its marketing strategy. For example, the company might use the regression to estimate the probability that a customer will complain a certain number of times, given their exposure to a particular advertisement. It could also use the regression to estimate the effect of changes in the company’s customer service policies on the number of complaints received.
- A doctor may use negative binomial regression to understand how the number of visits to their office is affected by the availability of health insurance in the area. For example, the doctor might use the regression to estimate the probability that a patient will visit their office a certain number of times, given their access to health insurance.
- A researcher may use negative binomial regression to understand how the number of new products purchased is affected by the pricing of those products. For example, the researcher might use the regression to estimate the probability that a customer will purchase a certain number of products, given the pricing of those products. It could also use the regression to estimate the effect of changes in the product’s pricing on the number of products purchased.

## Formula of negative binomial regression

The formula for negative binomial regression is as follows:

$$\begin{align} \log \left(\frac{\mu_i}{1-\mu_i}\right) &= \beta_0 + \beta_1 x_{1i} + \beta_2 x_{2i} + \ldots + \beta_k x_{ki}\\ \end{align}$$

Where $$\mu_i$$ is the expected count for observation $$i$$, $$\beta_0$$ is the intercept, $$\beta_1, \beta_2, \ldots, \beta_k$$ are the regression coefficients, and $$x_{1i}, x_{2i}, \ldots, x_{ki}$$ are the explanatory variable values for observation $$i$$.

The left-hand side of the equation is the log odds ratio of the expected count for observation $$i$$. This can be interpreted as the logarithm of the ratio of the expected count to the expected count minus one. The right-hand side of the equation is the sum of the intercept and the product of each explanatory variable and its corresponding regression coefficient. This can be interpreted as the sum of the intercept and the effect of each explanatory variable on the log odds ratio.

The regression coefficients can then be estimated using maximum likelihood estimation (MLE). This is done by finding the coefficient values that maximize the likelihood that the observed counts were generated by the model.

Once the coefficients are estimated, the expected count for each observation can be calculated using the formula:

$$\begin{align} \mu_i &= \frac{1}{1 + \exp \left(- \left(\beta_0 + \beta_1 x_{1i} + \beta_2 x_{2i} + \ldots + \beta_k x_{ki} \right) \right)} \end{align}$$

This formula can be interpreted as the inverse logit of the sum of the intercept and the product of each explanatory variable and its corresponding regression coefficient. This is a sigmoid (or logistic) curve that takes on values between 0 and 1 and is used to calculate the expected count for each observation.

Once the expected counts are calculated, the model can then be used to make predictions about the response variable given new values of the explanatory variables.

## When to use negative binomial regression

Negative binomial regression is a useful tool for analyzing count data, such as the number of customer complaints or the number of products purchased. It can be used in a variety of applications, including:

- predicting the likelihood of an event occurring a certain number of times;
- analyzing count data from observational studies;
- determining the effects of explanatory variables on count data;
- estimating the probability of an event occurring a specified number of times;
- modeling the relationship between a response variable and one or more explanatory variables; and
- comparing the relative importance of different explanatory variables.

## Types of negative binomial regression

Negative binomial regression is a type of statistical analysis used to model and explain the relationship between a response variable and one or more explanatory variables. This type of regression is used when the response variable is a count or count-based data. There are several types of negative binomial regression, including:

* Poisson regression: This type of regression is used when the response variable is a count, such as the number of customer complaints. It works by estimating the effects of the explanatory variables on the response variable, and by estimating the probability of an event occurring a specified number of times.

- Zero-inflated negative binomial regression: This type of regression is used when the response variable is a count and the data contains excess zeroes. It works by estimating the effects of the explanatory variables on the response variable, and by estimating the probability of an event occurring a specified number of times.
- Over-dispersed negative binomial regression: This type of regression is used when the response variable is a count and the data is over-dispersed. It works by estimating the effects of the explanatory variables on the response variable, and by estimating the probability of an event occurring a specified number of times.
- Negative binomial autoregressive model: This type of regression is used when the response variable is a count and the data is autocorrelated. It works by estimating the effects of the explanatory variables on the response variable, and by estimating the probability of an event occurring a specified number of times.
- Negative binomial logistic regression: This type of regression is used when the response variable is a count and the data is binary. It works by estimating the effects of the explanatory variables on the response variable, and by estimating the probability of an event occurring a specified number of times.

## Advantages of negative binomial regression

Negative binomial regression offers several advantages for managers seeking to gain insights into their data. These advantages include:

- The ability to model overdispersion, which is when the variance of the response variable is greater than the mean. This is important for count data, as it allows for a more accurate estimation of the effects of the explanatory variables.
- It is also relatively easy to interpret, as the coefficients can be used to measure the effect of each explanatory variable on the response variable.
- Additionally, negative binomial regression is more flexible than other count models, such as Poisson regression, as it can account for overdispersion and non-negative values.
- Finally, it can be used to investigate the effects of both continuous and categorical explanatory variables.

## Limitations of negative binomial regression

Negative binomial regression is a powerful statistical technique for understanding the relationships between explanatory variables and a response variable. However, it also has some limitations. These include:

- It is not suitable for use with data that are not count-based or with data that have a large number of zeroes.
- Since it is a form of regression analysis, it assumes linear relationships between the explanatory and response variables, which may not always be the case.
- It is not appropriate for use with data that are not normally distributed.
- It is also sensitive to outliers, which can severely distort the results.
- It is a form of parametric analysis, which means that if the underlying assumptions of the model are not met, the results of the analysis may be misleading.

## Suggested literature

- Hilbe, J. M. (2011).
*Negative binomial regression*. Cambridge University Press. - Allison, P. D., & Waterman, R. P. (2002).
*Fixed–effects negative binomial regression models*. Sociological methodology, 32(1), 247-265. - Ver Hoef, J. M., & Boveng, P. L. (2007).
*Quasi‐Poisson vs*. negative binomial regression: how should we model overdispersed count data?. Ecology, 88(11), 2766-2772.