How to properly set contrasts in R
问题 I have been asked to see if there is a linear trend in 3 groups of data (5 points each) by using ANOVA and linear contrasts. The 3 groups represent data collected in 2010 , 2011 and 2012 . I want to use R for this procedure and I have tried both of the following: contrasts(data$groups, how.many=1) <- contr.poly(3) contrasts(data$groups) <- contr.poly(3) Both ways seem to work fine but give slightly different answers in terms of their p-values. I have no idea which is correct and it is really