LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 27 Jun 2000 09:38:13 -0600
Reply-To:     Mark S Dehaan/MSD/CC01/INEEL/US <MSD@INEL.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mark S Dehaan/MSD/CC01/INEEL/US <MSD@INEL.GOV>
Subject:      Re: Creating dummy vars (lots of them)
Comments: To: David Richmond <daver80@DAKOTACOM.NET>
Content-type: text/plain; charset=us-ascii

Wait a minute everyone.

Isn't David trying to do exactly what Proc GLMMOD was designed for? I have used this in the past for this kind of thing with great success and without all the gyrations the kind suggestions are going through.

What am I missing?

confused, Mark DeHaan

David Richmond <daver80@DAKOTACOM.NET>@listserv.vt.edu> on 06/27/2000 12:11:28 AM

Please respond to David Richmond <daver80@DAKOTACOM.NET>

Sent by: "SAS(r) Discussion" <SAS-L@listserv.vt.edu>

To: SAS-L@LISTSERV.VT.EDU cc:

Subject: Creating dummy vars (lots of them)

Hi, I'm trying to create a very large set of dummy variables from a single grouping variable which takes on nearly 1000 unique values. Each dummy corresponds to a unique value of the grouping variable. The dummy needs to equal 1 when the group var equals the corresponding value for the dummy var and 0 otherwise. The example below illustrates what I mean.

id dum1 dum2 dum3 1 1 0 0 2 0 1 0 2 0 1 0 3 0 0 1 3 0 0 1

I have two questions: 1) is there an easy way to do this? I've thought about trying to do this with macros, but my problem is that I want SAS to figure out how many dummies it needs using the 'max' option in proc univariate (i.e. what's the largest value of "id"?) and then pass that number to a macro so it can execute a loop to create the dummies one by one. I have no idea how to do this.

2) I'm essentially trying to do a fixed effects model (w/ logistic reg.), is there a better way to do this in SAS?

daver

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! -----== Over 80,000 Newsgroups - 16 Different Servers! =-----


Back to: Top of message | Previous page | Main SAS-L page