What are the different types of codings available for categorical variables (in R) and when would you use them? If you fit a linear model or a mixed model there are different types of codings available to transform a categorical or nominal varibale into a number of variables for which paramaters are estimated, such as dummy conding (the R default) and effects coding.
I heard that effects coding (sometimes called deviation or contrast coding) is preferred when you have interactions, but what are the possible contrasts and when would you use which type of contrast?
The context is mixed modeling in R using lme4, but I think broader responses are fine. Sorry, if I missed a similar question.
EDIT: Two helpful links are: effect coding & dummy coding explained.
 A: Others can enlighten me if I am wrong, but here goes…
What is the effect for the level compared to the mean of the previous levels? i.e. you are interested locating the threshold of the effect


*

*Use Helmert contrasts. I think of this as cumulative comparisons. I have used this when interested in determining a drugs dose-response limit of the exposure. Comparison to multiple levels at a time means that less information is thrown away. I think of this as cumulative comparisons.


What is the effect of the level relative to a baseline level? i.e. you are interested in one baseline comparison group.  


*

*Use dummy variable coding (treatment contrasts).  I think of this as baseline comparisons. I have used this when there is typically one group/level established as important by other studies, and my study is demonstrating that associations also exist when this threshold is exceeded. 


What is the effect of two adjacent levels of a variable? 


*

*Use forward/backward differencing. I think of this as short-interval successive comparisons. I have used this when comparing effects for different levels of socioeconomic position, when each group is compositionally different in their own right and no more of interest than any other. 

