Date: Thu, 21 Jun 2007 10:29:02 -0400
Reply-To: Juliana <juliana.i.tobon@GMAIL.COM>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Juliana <juliana.i.tobon@GMAIL.COM>
Subject: Converting scale value into binary columns
It would be great if anyone could help me out with the following:
I have a series of contact dates such as
Jan02 May02 July02 Aug02
I would eventually like to convert this into binary coding month-by-month
such that if a contact occurred in a given month the value is 1 and
otherwise it is 0. I calculated the difference between the contact dates
(in months) such that I have the following:
datediff1 datediff2 datediff3 datediff4
1 4 2 1
I would like to conver this into a new series of columns with (n-1) zeroes
in between ones such that the above would become:
1 0 0 0 1 0 1 1
This would reflect the months January to August, with a 1 for a contact
and a 0 for no contact.
Again, if anyone can help me out, I would appreciate it.
Thanks!