My case is that I have one continuous DV variable and two categorical IVs containing 11 and 12 different levels (YEAR & MONTH) form 1998 to 2008.
Until now I have experimented a lot with contrasts() and the deviation coding seems to be the one I want to use, because I would rather compare the individuals levels in each IV to the mean of YEAR rather than some default baseline.
An example of my output is provided here:
model <- lm(LN.IDEA ~ 0 + MONTH + MONTHMONTH + YEAR + YEARYEAR, data = ds)
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.467431 0.031038 -111.717 < 2e-16 ***
MONTH1 0.207696 0.098558 2.107 0.0375 *
MONTH2 0.080218 0.098558 0.814 0.4176
MONTH3 -0.197687 0.098558 -2.006 0.0475 *
MONTH4 -0.110153 0.098558 -1.118 0.2663
MONTH5 0.039526 0.098558 0.401 0.6892
MONTH6 -0.194322 0.098558 -1.972 0.0514 .
MONTH7 0.174461 0.098558 1.770 0.0797 .
MONTH8 0.014709 0.098558 0.149 0.8817
MONTH9 -0.025038 0.094821 -0.264 0.7923
MONTH10 -0.086207 0.094821 -0.909 0.3654
MONTH11 0.060783 0.094821 0.641 0.5229
YEAR1 0.081754 0.155188 0.527 0.5995
YEAR2 0.545592 0.090489 6.029 2.65e-08 ***
YEAR3 0.044065 0.090489 0.487 0.6273
YEAR4 -0.103906 0.090489 -1.148 0.2535
YEAR5 0.005907 0.090489 0.065 0.9481
YEAR6 -0.110614 0.090489 -1.222 0.2244
YEAR7 0.076436 0.090489 0.845 0.4003
YEAR8 0.069966 0.090489 0.773 0.4412
YEAR9 -0.218867 0.090489 -2.419 0.0173 *
YEAR10 -0.204054 0.090489 -2.255 0.0263 *
It has been claimed that this question is a duplicate of
I realize that this answer touches upon what levels in regression are, but the question is about testing and interpreting p-values in regression. Therefore I argue that this is not a duplicate.
Rgives you the ability to specify reference levels for factors and it is also flexible enough to change your dummy codes completely, in any fashion you see fit. Just beware that a model with means of all months and all years contains a redundant variable and so is not identifiable; any good stats software will have to throw out one of your variables--and will be arbitrary about how it does that. – whuber Mar 15 '13 at 21:59http://www.ats.ucla.edu/stat/r/library/contrast_coding.htm#DEVIATION
As I changed my question to "How to compare against mean" i do think i made the right corrections. All the links that have been provided me seems only to explain the theory behind, which i have studied. No i am simply asking if it is possible to define ones own intercept...
– Kasper Christensen Mar 15 '13 at 22:29