Skip to content
Prev 316452 / 398506 Next

Creating dummy variables in r

You almost never need dummy variables in R. R creates them
automatically from factors given model and possibly contrasts
specification.

?contrasts  ## for some technical details.

If you have not read "An Introduction to R" do so now. Pay particular
attention to the chapter on modeling and categorical variables. You
can also google around to find appropriate tutorials. Here is one:

http://www.ats.ucla.edu/stat/r/modules/dummy_vars.htm

I repeat: DO not create dummy variablesby hand in R unless you have
understood the above and have good reason to do so.

-- Bert

On Tue, Jan 29, 2013 at 7:21 PM, Joseph Norman Thomson
<thomsonj at email.arizona.edu> wrote: