# Using Numeric Values Instead of Dates in Linear Regression

I just ran a regression using

• time (year)
• sex (Male = 0; Female = 1)
• the interaction between the two.

I chose not to recode the year variable (i.e., 2000 = 1, 2001 = 2, etc.) for this analysis, as I've read that doing so only impacts the intercept (per another post on this site). These were the results I obtained from this analysis:

However, when I recode the year variable using the scheme noted above (while making no other changes), these are the results:

Why would changing the coding scheme for the year variable reverse the sign of the coefficient for "Female?"

• What do you understand the coefficient for 'Female' to represent? If you write down the model equations you'll likely answer your own question. – Scortchi - Reinstate Monica Apr 12 '18 at 15:56
• Based on what I've read it represents the intercept for the females minus the intercept from the males. – professorfarnsworth Apr 12 '18 at 16:13
• Sure, only the intercept is affected by recoding, but it's now crazy. You shouldn't want the bother of explaining that to a readership (could be an examiner or reviewer in your field). – Nick Cox Apr 12 '18 at 16:30

When you have an interaction, be very careful about looking at main effects.

The main effect of female is the effect when year = 0. When year is not recoded, year can't be 0.

Let's take a look. Year = YR + 2000.

Then the first equation is, for males:

$$DV = -1866 + 0.94 *(YR + 2000) = -1866 + .94*YR + 1880 = 14 + .94*YR$$

for females: $$DV = -1866 + 0.94 *(YR + 2000) -646 + 0.32*(YR + 2000) = -1866 + .94YR + 1880 -646 + .32*YR + 640 = 1.36*YR + 8$$

And that is the same as the second variation.