# Test if two coefficients are statistically different in negative binomial regression in R? [closed]

I am currently working with negative binomial regressions and I would like to test whether two coefficients in the same model are significantly different from each other in R. I have read on some answers here but none concern negative binomial regressions.

Kind regards.

• Is your confusion about what's going on mathematically or how to code it in R? – Dave Dec 10 '19 at 15:40
• Pretty much both, actually. But my question is primarily about how to code it in R! – Elsa Mitova Dec 10 '19 at 17:54

If your model is $$g(Y) = a + \beta_1 X_1 + \beta_2 X_2$$ and your hypothesis is that $$\beta_2 = \beta_1 + \delta$$ you can reparameterize using the sum of the variables: $$g(Y) = \beta_1 (X_1 + X_2) + \delta X_2$$, and test if $$\delta = 0$$.

• +1 I've never seen this trick, and it makes perfect sense! Code-wise, this would be something like z <- x1+x2; L <- lm(y~z+x2) and doing inference on the parameter on x2. – Dave Dec 10 '19 at 16:39
• No, then the predictors are correlated, and parameter inference goes goofy. How would you resolve that? – Dave Dec 10 '19 at 16:56
• It's also pretty common to use the avg and difference, (x1+x2)/2 and (x1-x2)/2 – Neal Fultz Dec 10 '19 at 17:13
• Whether multicolinearity is a big problem with this approach or not will depend on your specific data set. – Neal Fultz Dec 10 '19 at 17:14