s-news
[Top] [All Lists]

[S] creat dummy variables

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>