Date: Tue, 14 Apr 2009 13:08:48 +0200
Reply-To: "POHL, Dr., Stefan - AKTUARE" <pohl@AKTUARE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "POHL, Dr., Stefan - AKTUARE" <pohl@AKTUARE.DE>
Subject: AW: Data manipulation
In-Reply-To: <c6b899fd0904140403h2c041b83k79d81d4676c3e4b5@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
Hi,
I want to build up a sequential distance matrix. id1 is the postal code, x1
longitude and y1 lattitude.
Id1 x1 y1
1 1 4
4 4 2
8 7 3
And I want to have this data:
Id1 Id2 x1 y1 x2 y2
1 1 1 4 1 4
1 4 1 4 4 2
1 8 1 4 7 3
----------------------
4 1 4 2 1 4
4 4 4 2 4 2
4 8 4 2 7 3
----------------------
8 1 7 3 1 4
8 4 7 3 4 2
8 8 7 3 7 3
Now I can determine the distances between two postal codes.
How can I manipulate my data?
Stefan.
_____
Von: Alex Murphy [mailto:goladin@gmail.com]
Gesendet: Dienstag, 14. April 2009 13:03
An: POHL, Dr., Stefan - AKTUARE
Cc: SAS-L@listserv.uga.edu
Betreff: Re: Data manipulation
Hi,
Can I just check whether x2, y2 and id2 has any relations with the original
variables?
On Tue, Apr 14, 2009 at 6:58 PM, POHL, Dr., Stefan - AKTUARE
<pohl@aktuare.de> wrote:
Hi,
I need a more general solution.
Suppose I have this data:
Id1 x1 y1
1 1 4
4 4 2
8 7 3
And I want to have this data:
Id1 Id2 x1 y1 x2 y2
1 1 1 4 1 4
1 4 1 4 4 2
1 8 1 4 7 3
2 1 4 2 1 4
2 4 4 2 4 2
2 8 4 2 7 3
3 1 7 3 1 4
3 4 7 3 4 2
3 8 7 3 7 3
Thank you for your help, Stefan.
_____
Von: Alex Murphy [mailto:goladin@gmail.com]
Gesendet: Dienstag, 14. April 2009 12:48
An: POHL, Dr., Stefan - AKTUARE
Cc: SAS-L@listserv.uga.edu
Betreff: Re: Data manipulation
Hi,
Try this.
DATA T;
SET T;
DO I = 1 TO 3;
ID2 = I;
X2 = I;
Y2 = I;
OUTPUT;
END;
RUN;
On Tue, Apr 14, 2009 at 6:10 PM, POHL, Dr., Stefan - AKTUARE
<pohl@aktuare.de> wrote:
Hi,
I have this data:
Id1 x1 y1
1 1 1
2 2 2
3 3 3
I want to have this data:
Id1 Id2 x1 y1 x2 y2
1 1 1 1 1 1
1 2 1 1 2 2
1 3 1 1 3 3
2 1 2 2 1 1
2 2 2 2 2 2
2 3 2 2 3 3
3 1 3 3 1 1
3 2 3 3 2 2
3 3 3 3 3 3
How can I do this?
Thank you for help, Stefan.
--
Regards,
Murphy Choy
Certified Advanced Programmer for SAS V9
Certified Basic Programmer for SAS V9
DataShaping Certified SAS Professional
--
Regards,
Murphy Choy
Certified Advanced Programmer for SAS V9
Certified Basic Programmer for SAS V9
DataShaping Certified SAS Professional