recoding numbers....
Hello all,
Im facing a little problem which so far I could not find a work around. Any sugestions would be welcome.
I have tow datasets which come from different sources... I intended to join them side-by-side with epidata entry to keep on going wiht the data update. I know that the second one would update some stuff in the firts one, at least for the majority of the observations.
Both of the have a unique identifier which is a variable called num. However in the first set num is like this...
133.01.2007 244.01.2007
while in the second one num is like this...
2007.01.133 2007.01.244
For any software these would be different numbers but given that I know that 2007 is the yaer and 1 is january and 244 or 133 is the sequence within the month I know that the second dataset have num in the inverse order. Concatenating the datasets like this would be just as append because no observatiosn would match. I tought in recode the numbers but this would be same as digitizing all again. Nay sugestions?
I will assume that your sequence numbers ALWAYS have 3 digits (001.01.2007 and 2007.01.001) If not, this becomes more complicated. But here is a really simple way to do this with Analysis.
read set1 define oldnum ___________ oldnum = num num = copy(oldnum,8,4)+copy(oldnum,4,4)+copy(oldnum,1,3) merge num /file=set2 /update savedata newset
I think you could also flip num around using a RECODEBLOCK in Entry, but I find it a lot simpler to use Analysis.
Jamie
Pedra wrote:
I have tow datasets which come from different sources... I intended to join them side-by-side with epidata entry to keep on going wiht the data update. I know that the second one would update some stuff in the firts one, at least for the majority of the observations.
Both of the have a unique identifier which is a variable called num. However in the first set num is like this...
133.01.2007 244.01.2007
while in the second one num is like this...
2007.01.133 2007.01.244
For any software these would be different numbers but given that I know that 2007 is the yaer and 1 is january and 244 or 133 is the sequence within the month I know that the second dataset have num in the inverse order. Concatenating the datasets like this would be just as append because no observatiosn would match. I tought in recode the numbers but this would be same as digitizing all again.
participants (1)
-
epidata-list@lists.umanitoba.ca