Since you only have 1 year, year would just be a constant. There would be no identifying variation, which is what @MrFlick is implying in his comment. That's why you get an error if you try a contrast or if you were to try putting it in the lm
equation.
Realistically, you should not include year since you do not have any variation in years.
Technically, you could include it in your regression if you were to omit the default constant (commonly called "Beta naught") which is calculated as the mean response when all predictor values are zero. That would be the same as artifically setting your y-intercept to 2010.
It's hard to think of a scenario where that would be advantageous and even then you could not have interaction terms with a constant.
Here are your options:
- Forget about including year
- Get more years
- Use 2010 as your y-intercept:
Lanu <- lm(YFT ~ 0 + PR1*factor(DN1)*factor(NTM1)*factor(AÑO1), offset=rep(2010, length(YFT))
- Use months, quarters, or some subdivision of the year instead of year
Note that adding 0 +
or - 1
to the equation removes the normal intercept and offset
creates the artificial year intercept.