Date: Tue, 23 Jan 2007 20:25:09 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: Creating a new group id by combining two other group id's via
an array?
In-Reply-To: <1169583638.529017.41070@d71g2000cwa.googlegroups.com>
Content-Type: text/plain; format=flowed
Joep ,
If you tell us more about what you need to do with this data it might help.
Why do I say this, well you can create multilable formats which will map one
value to more than one group. The down side to this is they can only be
used with a few procs. Whether or not this is a viable option would largely
depend on what you intend to do with the data.
Toby Dunn
To sensible men, every day is a day of reckoning. ~John W. Gardner
The important thing is this: To be able at any moment to sacrifice that
which we are for what we could become. ~Charles DuBois
Don't get your knickers in a knot. Nothing is solved and it just makes you
walk funny. ~Kathryn Carpenter
From: Joep <joeparts@GMAIL.COM>
Reply-To: Joep <joeparts@GMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: Creating a new group id by combining two other group id's via an
array?
Date: Tue, 23 Jan 2007 12:20:38 -0800
Hi,
I am working on an analysis of multiple groups of variables. Basically
I am trying to split a huge dataset into smaller more sensible pieces.
To do so I have managed to create two separate group variables (groupd
and groupi). These groups overlap unfortunately. Groupi has 5 levels;
groupd has 20. Furthermore in case groupi = 1, groupd may have 10
levels. So if I could combine the two variables, I would have 1 single
indicator for different groups (i.e. datasets).
This is what I have done:
* create groups for each combination; data me.dataset2;
set me.dataset1;
group = .;
array _gd(*) groupd1-groupd5 ;
array _gi(*) groupi1-groupi20 ;
do i = 1 to dim(_gd);
do j = 1 to dim(_gi);
group = i&j;
end;
end;
run;
I think things go wrong with this statement: group = i&j; but maybe an
array is not the best way to go here.
Any other suggestions are more than welcome!
Thanks.
Joep
_________________________________________________________________
Get Hilary Duff’s homepage with her photos, music, and more.
http://celebrities.live.com