<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to calculate distance between observations with coordinate points in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307467#M65854</link>
    <description>&lt;P&gt;Correctly. But each row composed of 5 {fxi,fyi} points. If I used Proc distance, I won't get correct result. For proc distance with Euclid, the calculate function will be dist=sqrt[(fx11-fx12)**2+(fy11-fy12)**2+ (fx21-fx22)**2+ (fy21-fy22)**2+...+ (fx51-fx52)**2+ (fy51-fy52)**2]. However, what I want to get is: dist=sqrt[(fx11-fx12)**2+(fy11-fy12)**2]+ sqrt[(fx21-fx22)**2+(fy21-fy22)**2]+...+sqrt[(fx51-fx52)**2+ (fy51-fy52)**2].&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2016 19:15:23 GMT</pubDate>
    <dc:creator>ffguo</dc:creator>
    <dc:date>2016-10-26T19:15:23Z</dc:date>
    <item>
      <title>how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307313#M65797</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a problem with calculating distance between observations, which is the variable model. Each observation contains 5 coordinate points, {fxi,fyi}, i=1 to 5; The dataset as following, is there any macro or for loop can do the calculation? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;obs&lt;/TD&gt;&lt;TD&gt;model&lt;/TD&gt;&lt;TD&gt;fx1&lt;/TD&gt;&lt;TD&gt;fy1&lt;/TD&gt;&lt;T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t;34.5&lt;/TD&gt;&lt;TD&gt;106.3438&lt;/TD&gt;&lt;TD&gt;57.5&lt;/TD&gt;&lt;TD&gt;106.3438&lt;/TD&gt;&lt;TD&gt;78&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;d&lt;/TD&gt;&lt;TD&gt;130.9375&lt;/TD&gt;&lt;TD&gt;9.75&lt;/TD&gt;&lt;TD&gt;130.9375&lt;/TD&gt;&lt;TD&gt;14.75&lt;/TD&gt;&lt;TD&gt;130.9375&lt;/TD&gt;&lt;TD&gt;51.5&lt;/TD&gt;&lt;TD&gt;130.9375&lt;/TD&gt;&lt;TD&gt;79.5&lt;/TD&gt;&lt;TD&gt;130.9375&lt;/TD&gt;&lt;TD&gt;99.5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;e&lt;/TD&gt;&lt;TD&gt;143.5625&lt;/TD&gt;&lt;TD&gt;21.5&lt;/TD&gt;&lt;TD&gt;143.5625&lt;/TD&gt;&lt;TD&gt;26.5&lt;/TD&gt;&lt;TD&gt;143.5625&lt;/TD&gt;&lt;TD&gt;74&lt;/TD&gt;&lt;TD&gt;143.5625&lt;/TD&gt;&lt;TD&gt;119.5&lt;/TD&gt;&lt;TD&gt;143.5625&lt;/TD&gt;&lt;TD&gt;142&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 05:06:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307313#M65797</guid>
      <dc:creator>ffguo</dc:creator>
      <dc:date>2016-10-26T05:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307319#M65798</link>
      <description>&lt;P&gt;What would your distance calculation look like?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please include sample output.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 05:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307319#M65798</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T05:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307356#M65809</link>
      <description>&lt;P&gt;if it was Eduical distance,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data step also can do that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover expandtabs;
input obs	model $	fx1	fy1	fx2	fy2	fx3	fy3	fx4	fy4	fx5	fy5;
cards;
1   a   129 16.5    129 22.25   129 59.75   129 90.75 129   112.25
2   b   156.9375    18  156.9375    26.5    156.9375    69  156.9375    109.5   156.9375    137
3   c   140 26  140 31  140 76.5    140 116 140 142.75
4   d   109.7188    24  109.7188    29.5    109.7188    53.75   109.7188    87  109.7188    100.25
5   e   145.5   7   145.5   11.5    145.5   46.5    145.5   90  145.5   110.5
6   f   94.28125    15  94.28125    19.5    94.28125    47.5    94.28125    91.25   94.28125    111.25
7   g   150 28.5    150 34  150 83  150 126 150 172
8   a   147 9.5 147 17  147 62  147 102.5   147 141
9   b   91.4375 12.75   91.4375 17.75   91.4375 48.5    91.4375 82.75   91.4375 89.25
10  c   106.3438    2.25    106.3438    4.75    106.3438    34.5    106.3438    57.5    106.3438    78
11  d   130.9375    9.75    130.9375    14.75   130.9375    51.5    130.9375    79.5    130.9375    99.5
12  e   143.5625    21.5    143.5625    26.5    143.5625    74  143.5625    119.5   143.5625    142
;
run;
proc iml;
var_x='fx1':'fx5';
var_y='fy1':'fy5';
use have;
read all var var_x into x;
read all var var_y into y;
close;

distance= sqrt((y-x)[,##]);

create distance var{distance};
append;
close;

data want;
 merge have distance;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 11:11:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307356#M65809</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-26T11:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307357#M65810</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
infile cards truncover expandtabs;
input obs	model $	fx1	fy1	fx2	fy2	fx3	fy3	fx4	fy4	fx5	fy5;
cards;
1   a   129 16.5    129 22.25   129 59.75   129 90.75 129   112.25
2   b   156.9375    18  156.9375    26.5    156.9375    69  156.9375    109.5   156.9375    137
3   c   140 26  140 31  140 76.5    140 116 140 142.75
4   d   109.7188    24  109.7188    29.5    109.7188    53.75   109.7188    87  109.7188    100.25
5   e   145.5   7   145.5   11.5    145.5   46.5    145.5   90  145.5   110.5
6   f   94.28125    15  94.28125    19.5    94.28125    47.5    94.28125    91.25   94.28125    111.25
7   g   150 28.5    150 34  150 83  150 126 150 172
8   a   147 9.5 147 17  147 62  147 102.5   147 141
9   b   91.4375 12.75   91.4375 17.75   91.4375 48.5    91.4375 82.75   91.4375 89.25
10  c   106.3438    2.25    106.3438    4.75    106.3438    34.5    106.3438    57.5    106.3438    78
11  d   130.9375    9.75    130.9375    14.75   130.9375    51.5    130.9375    79.5    130.9375    99.5
12  e   143.5625    21.5    143.5625    26.5    143.5625    74  143.5625    119.5   143.5625    142
;
run;
data want1;
 set have;
 array x{*} fx:;
 array y{*} fy:;
 sum=0;
 do i=1 to dim(x);
  sum+(y{i}-x{i})**2;
 end;
  distance=sqrt(sum);
 drop sum i;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 Oct 2016 11:15:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307357#M65810</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-26T11:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307415#M65834</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The function used to caluculate&amp;nbsp;euclidean distance should be dis(distance between any two oberservation)= sum(squr((fyi1-fyi2)**2+(fxi1-fxi2)**2)),{fxi1,fyi1} from the first observation, the other from the second observation, i=1 to 5. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 14:28:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307415#M65834</guid>
      <dc:creator>ffguo</dc:creator>
      <dc:date>2016-10-26T14:28:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307431#M65840</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for help. This seems work but not get the right result, because t&lt;SPAN&gt;he function used to caluculate&amp;nbsp;euclidean distance&amp;nbsp;is&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;dis(distance between any two oberservation)= sum(squr((fyi1-fyi2)**2+(fxi1-fxi2)**2)),{fxi1,fyi&lt;/SPAN&gt;&lt;SPAN&gt;1} from the first observation, the other from the second observation, i=1 to 5. So should the sum equation be modified? Thanks.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 14:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307431#M65840</guid>
      <dc:creator>ffguo</dc:creator>
      <dc:date>2016-10-26T14:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307452#M65845</link>
      <description>&lt;P&gt;Look at proc distance with method=Euclid.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 16:54:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307452#M65845</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T16:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307459#M65849</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;&amp;nbsp;I think the OP wants distance between different rows.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 18:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307459#M65849</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T18:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307467#M65854</link>
      <description>&lt;P&gt;Correctly. But each row composed of 5 {fxi,fyi} points. If I used Proc distance, I won't get correct result. For proc distance with Euclid, the calculate function will be dist=sqrt[(fx11-fx12)**2+(fy11-fy12)**2+ (fx21-fx22)**2+ (fy21-fy22)**2+...+ (fx51-fx52)**2+ (fy51-fy52)**2]. However, what I want to get is: dist=sqrt[(fx11-fx12)**2+(fy11-fy12)**2]+ sqrt[(fx21-fx22)**2+(fy21-fy22)**2]+...+sqrt[(fx51-fx52)**2+ (fy51-fy52)**2].&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 19:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307467#M65854</guid>
      <dc:creator>ffguo</dc:creator>
      <dc:date>2016-10-26T19:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307472#M65858</link>
      <description>&lt;P&gt;Are you sure? Post the code you've used please.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 19:36:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307472#M65858</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T19:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307477#M65860</link>
      <description>proc distance data=use method= euclid out=want;&lt;BR /&gt;var interval(fx1 fy1 fx2 fy2 fx3 fy3 fx4 fy4 fx5 fy5);&lt;BR /&gt;id model;&lt;BR /&gt;run;&lt;BR /&gt;the distance between fist obs and second obs is 79.1, however, the correct value should be 156.6.</description>
      <pubDate>Wed, 26 Oct 2016 19:52:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307477#M65860</guid>
      <dc:creator>ffguo</dc:creator>
      <dc:date>2016-10-26T19:52:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to calculate distance between observations with coordinate points</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307517#M65878</link>
      <description>&lt;P&gt;It might be worth switching it to a long format then and grouping to be able to use the formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Otherwise a SQL cross join as long as you're willing to type &amp;nbsp;out the formula.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;select a.*, b.fx1 as fx12, b.fy1 as fy12 ...,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sqrt[(fx11-fx12)**2+(fy11-fy12)**2]+ sqrt[(fx21-fx22)**2+(fy21-fy22)**2]+...+sqrt[(fx51&lt;/SPAN&gt;&lt;WBR /&gt;&lt;SPAN&gt;-fx52)**2+ (fy51-fy52)**2] as dist&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;from have as a&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cross join have as b;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2016 22:52:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-calculate-distance-between-observations-with-coordinate/m-p/307517#M65878</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-26T22:52:03Z</dc:date>
    </item>
  </channel>
</rss>

