[R] Basic Dummy Variable Creation
Rolf Turner
rolf at math.unb.ca
Fri Sep 5 20:09:17 CEST 2003
In response to a question from Francisco J. Bido, about how to create
dummy variables, Doug Bates and others essentially said ``Don't.''
Which is good advice, but ....
Recently I encountered a problem involving a linear model with a
three level factor (levels low, medium, and high) crossed with linear
and quadratic terms in a continuous variate. The client wanted (for
some reason --- perhaps I should have discouraged him more
forcefully) to compare the full model with a model in which there
were linear and quadratic terms for the high level of the factor, but
only linear terms for the low and medium levels.
The only way I could see of specifying the reduced model was through
using dummy variables explicitly. I.e. I could see no way of
specifying such a model in the standard general linear model syntax.
(The client was actually working in SAS, but the same considerations
apply whether one is speaking SAS or R/Splus, it seems to me.)
Did I miss something obvious (or even not-so-obvious)?
cheers,
Rolf Turner
rolf at math.unb.ca
More information about the R-help
mailing list