0

I am trying to work with Poisson regression. I came across this video which is very helpful - https://www.youtube.com/watch?v=HntUY8SsYZg. In the video one of parameters (Race) is categorical and treated vide factor() in R.

Ideally the model should show coefficient of every parameter - Race, Income and GPA. But for the categorical variable Race - it shows coefficient for value of categorical variable. [Video at 09:18]

                 CO        2.5 %     97.5 %
(Intercept) 0.003004161 0.0007308336 0.01167968
Race2       2.811686825 1.5523542481 5.62637686
Race3       1.310301471 0.5854852933 2.98624050
Income      1.066367468 1.0494809143 1.08382221
GPA         1.129708044 0.9120963633 1.40195401

Can someone explain this ? why is every value of categorical variable having a different coefficient ?

Anuj Gupta
  • 111
  • 3
  • 1
    Why would the parameters for each level of a categorical variable have the same coefficients? What would be the use of that? – Dason Apr 15 '15 at 12:07
  • @Dason: I didnt get it. Say we want to build a model between some X values and Y values (X,Y are real numbers). Say the model that comes out is Y=2.3 * X + 8.1 Now, to predict Y, we take X value plug in this eq and get Y. The coefficient (2.3) of X should not vary with X. Right ? Now consider the scenario when X is a categorical variable that takes values Monday, Tuesday and wednesday, which after using factor() in R gets mapped to 1,2,3. Why should the coefficient vary with the value of X ? –  Apr 15 '15 at 12:33
  • 3
    Read up on factors, dummy encoding and contrasts. – Roland Apr 15 '15 at 12:41
  • 2
    @AnujGupta As Rolad says you just have a statistical misunderstanding about model building. Basically if you have a categorical variable you don't just have a single predictor. Your model has to treat that one variable like it is actually k-1 variables where k is the number of levels that the categorical variable can take on. – Dason Apr 15 '15 at 13:21
  • See http://stats.stackexchange.com/questions/11096, *inter alia*. – whuber Apr 16 '15 at 16:15
  • I found the duplicate by searching this site for [dummy variable regression coefficient](http://stats.stackexchange.com/search?tab=votes&q=dummy%20variable%20regression%20coefficient) and looking through the top-voted posts. If it doesn't completely address your question, please continue looking through the rest of these search results. – whuber Apr 16 '15 at 16:16

0 Answers0