Relevel function in R for GLM

1) What is the purpose of the relevel function for variables with more than 2 categories.

I understand that you select one category for the "base", and the other categories are compared to it. But why is it necessary?

2) How you do you interpret the coefficient estimates of a GLM model of a variable that has been re-leveled?

example:

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 2.49805 0.79386 3.147 0.001651 **
Category1 0.32993 0.67235 0.491 0.623637
Category2 -1.38851 0.35765 -3.882 0.000103 ***
Category3 -1.74476 0.42517 -4.104 4.07e-05 ***

We (the community) can give you better help with FAQ: What's a reproducible example (`reprex`) and how do I do one? which would include the call of the model glm(y ~ x, data = dat, family = "poisson") [whatever] and some data of the same form, which doesn't have to be real.

Without that to work with, the answers you can expect will probably be too abstract to be as useful as they could.

On top of @technocrat has said, there is also a FAQ on homework (which your question looks a lot like):

So, if you can elaborate a bit on where exactly you are stuck and what you've tried so far, you'll find it much more likely that people will be willing to help.

2 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.