2
$\begingroup$

I am trying to calculate the incidence rate ratio of my negative binomial model. After running my negative binomial regression model, I use exp(Mymodel) in order to get the incidence rate ratio but R gives me this message: non-numeric argument to mathematical function.

Is the code wrong?

$\endgroup$

1 Answer 1

1
$\begingroup$

Try this:

exp(coef(Mymodel))

Mymodel is a model object containing much more than the fitted coefficients, and some of this components are not numerical, causing the error message. The coef method just extracts the coefficients.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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