Skip to content
Prev 1039 / 20628 Next

Dummy variables in Factors with more than 2 levels

On Wed, May 21, 2008 at 5:16 AM, Martin Henry H. Stevens
<HStevens at muohio.edu> wrote:
In R the terminology is that variables expressed as factors
(categorical data) or ordered factors (ordered categorical data) are
converted to a set of contrasts when incorporated in a linear or
generalized linear model.  The default behavior is to use the
"treatment" contrasts.  You can set an option to use the "SAS"
contrasts where the last level is the reference level.  Try

options(contrasts = c(unordered = "contr.SAS", ordered = "contr.poly")

then refit your model.