| To: | s-news@wubios.wustl.edu |
|---|---|
| Subject: | [S] creat dummy variables |
| From: | "Jing (Jane) Xu" <jxu@athena.biostat.jhsph.edu> |
| Date: | Thu, 25 Jun 1998 15:47:51 -0400 (EDT) |
| In-reply-to: | <6rbtrhi89p.fsf@verdi.stat.wisc.edu> |
| Sender: | owner-s-news@wubios.wustl.edu |
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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [S] scope rules, Douglas Bates |
|---|---|
| Next by Date: | Re: [S] create dummy variables, Jan Schelling |
| Previous by Thread: | Re: [S] scope rules, Douglas Bates |
| Next by Thread: | Re: [S] creat dummy variables, Alan Zaslavsky |
| Indexes: | [Date] [Thread] [Top] [All Lists] |