Re: [R] Creating dummy codes

2004-08-01 Thread Peter Dalgaard
"Doran, Harold" <[EMAIL PROTECTED]> writes: > Is there an efficient way to create a series of dummy codes from a single variable? > For example, I have a variable, “grade” = {2, …, 12}. I want to create k-1 > dummy codes for grade such that grade 2 is the base (i.e, grade 2 =0). > > I am hopin

Re: [R] Creating dummy codes

2004-08-01 Thread Prof Brian Ripley
On Sun, 1 Aug 2004, Doran, Harold wrote: > Is there an efficient way to create a series of dummy codes from a > single variable? For example, I have a variable, “grade” = {2, …, > 12}. I want to create k-1 dummy codes for grade such that grade 2 is the > base (i.e, grade 2 =0). Yes, and that's wh

Re: [R] Creating dummy codes

2004-08-01 Thread Rolf Turner
(1) Why ***ON EARTH*** do you want to do that? Just make ``grade'' into a factor and use that factor directly. (2) If you insist on doing it your way, class.ind() from package nnet will get you most of the way there. You'll need to strip off the first (grade 2) column, give the matrix the colum

[R] Creating dummy codes

2004-08-01 Thread Doran, Harold
Is there an efficient way to create a series of dummy codes from a single variable? For example, I have a variable, “grade” = {2, …, 12}. I want to create k-1 dummy codes for grade such that grade 2 is the base (i.e, grade 2 =0). I am hoping that the new variables can be labeled as grade.3, gra