1
$\begingroup$

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.

Thank you in advance!

Kind regards.

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

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$.

$\endgroup$
  • 1
    $\begingroup$ +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. $\endgroup$ – Dave Dec 10 '19 at 16:39
  • $\begingroup$ No, then the predictors are correlated, and parameter inference goes goofy. How would you resolve that? $\endgroup$ – Dave Dec 10 '19 at 16:56
  • 1
    $\begingroup$ It's also pretty common to use the avg and difference, (x1+x2)/2 and (x1-x2)/2 $\endgroup$ – Neal Fultz Dec 10 '19 at 17:13
  • $\begingroup$ Whether multicolinearity is a big problem with this approach or not will depend on your specific data set. $\endgroup$ – Neal Fultz Dec 10 '19 at 17:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.