[S] creat dummy variables

Jing (jxu@athena.biostat.jhsph.edu)
Thu, 25 Jun 1998 15:47:51 -0400 (EDT)


Hi, everyone,

Is there a simple way to create (n-1) dummy variables from a single
variable which takes values 0,1,...,n-1?

Say, I have a variable f like:
f
0
2
1
2
0
how can I get something like:
d1 d2
0 0
1 1
1 0
1 1
0 0

Any help would be greatly appreciated!

Jane

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news