Dummy and Contrast Codings in R
“Dummy” or “treatment” coding is to create dichotomous variables where each level of the categorical variable is contrasted to a specified reference level. Basic Syntax of Dummy and Contrast Coding 1. Dummy Coding The following is the syntax to do dummy coding in R. contr.treatment( number_of_level_of_X ) 2 3 1 0 0 2 1 0 3 … Read more