Date: Mon, 26 May 2008 10:31:16 -0400
Reply-To: M D <tant07@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: M D <tant07@GMAIL.COM>
Subject: Seperating Events
Content-Type: text/plain; charset=ISO-8859-1
Hello,
I have an unusual dataset of the following form:
ID Day Event1 Event2 Event3 ..... Event31
1 1 199990 901090 990091....
where each event (Event1, Event2, Event2...) indicates choice for 6
different products.
1 indicates that the product was present in the choice set and was selected,
0 indicates that the product was present in the choice set, but was not
selected,
and 9 indicates that the product was not present in the choice set.
I want to create a new dataset of the following form:
ID Day Event P1 P2 Choice
1 1 1 6 1 2
1 1 2 2 3 4
1 1 2 4 3 4
1 1 2 6 3 4
1 1 3 3 6 3
1 1 3 4 6 3
and so on...
where ID, Day is same as the original datast, Event indicates the event
column (i.e. Event1 = 1, Event23=23 and so on..)
P1 and P2 indicates the product choices where P1 indicates product
no. with 0 (product is in the choice set, but not selected) and P2 indicates
product no. with 1 (product is in the choice set and is selected). Finally,
"Choice" indicates the number of products present in the choice set.
I am a true SAS novice, and have no idea how to create this new dataset.
Please help me with this.
Thank you in advance,
Mike