I know that contr.poly
creates orthogonal polynomials of degree 1, 2, etc. so that you can determine if there is a particularly mathematical pattern (e.g., linear, quadratic, cubic, etc.). And, contr.sum
provides orthogonal contrasts where you compare every level to the overall mean.
Are categorical variables always coded with contr.sum
? And continuous with contr.poly
? How do you know which one you should use to specify your variable?