2

I am trying to recreate what my predecessor has done, with the only knowledge being he used "regression."

I'm predicting my dependent variable based on the day of the week, but also on two other quantitative variables. I initially intended to use indicator variables for the week day, but then remembered that I will not be able to get a coefficient for each of the seven days, though my predecessor was able to somehow get a model with coefficients for all of Sunday-Saturday.

Is there another way I can tackle this problem, or is this method the best way? Is there a method I can use to get separate coefficients for each day of the week?

jonsca
  • 1,790
  • 3
  • 20
  • 30
alex
  • 23
  • 1
  • 3
  • How many observations are you working with? A little bit more information would be helpful, what are you predicting, are there any dependencies between the observations etc... – Jonathan Lisic Dec 04 '12 at 16:43

1 Answers1

5

I would guess that he did not include an intercept in his model, which allows you to identify all seven day-of-week coefficients. In any case, the model with an intercept and six day-of-week coefficients gives the same results, when appropriately calculated, as a model with seven day-of-week dummies. See a related derivation here.

Charlie
  • 13,124
  • 5
  • 38
  • 68
  • Ah, I see, I figured it might be something to that effect, but didn't want to veer off into using pretend magic-math. Thank you so much for this clarification. As for not including an intercept, are you familiar with how I'd go about making a model like that? I've never had to do it but maybe once. – alex Dec 04 '12 at 16:32
  • It depends upon your software. Stata uses the `noconstant` option. `R` uses a `-1`, as in `lm(y ~ x - 1)` (you could do `+ 0`, too).. – Charlie Dec 04 '12 at 16:40
  • Ah fantastic! You've just saved my whole day, good sir, with all your assistance. I'm using R, so I will try -1. Thank you so much, again, for your help. – alex Dec 04 '12 at 16:46
  • Ah! Sorry about that, will do! I had another quick question regarding this method, I see that my intercept is the same as the variable that got left out when I run it using -1, but when I use -1, all my week day coefficients become negative, and much larger, when I use the intercept, they are pretty different. Will my predictions be wrong based on this, and could I use the intercept as my, say, Saturday coefficient? – alex Dec 04 '12 at 17:16
  • To get your Saturday intercept, you need to add the regular intercept and the Saturday term (try writing out the expectation of your outcome for a Saturday). This will be the same as the value that you get when you use all seven day-of-week dummies. – Charlie Dec 04 '12 at 17:20
  • I think my problem tends to arise from my weak math stat knowledge, but I think I'm seeing it now. If I used a day that doesn't get omitted, the coefficient of say, Monday, in the no-intercept model would be Monday added to the intercept term? Could I safely treat the intercept as if it were the coefficient of the variable that gets omitted? – alex Dec 04 '12 at 17:42
  • Yes, that's right. – Charlie Dec 04 '12 at 18:05