<?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: Similating coordinates and calculating various functions in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202353#M10849</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You say 8 random numbers but generate 36?&lt;/P&gt;&lt;P&gt;This will generate random points. Change I get the number of pairs you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data obs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i= 1 to 36;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x= round(1000* ranuni(123),1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y= round(1000* ranuni(789),1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck with the rest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2015 15:10:22 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-08-19T15:10:22Z</dc:date>
    <item>
      <title>Similating coordinates and calculating various functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202352#M10848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to be able to simulate 8 random xy coordinates (limiting the max x and y to 1000 each and only allowing integers) and then be able to do the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Calculate all the distances between all the points. For 8 points there will be n(n-1)/2 distances so 28 distances. I want to calculate the mean and standard deviation of the distances.&lt;/P&gt;&lt;P&gt;Calculate the length of every possible route consisting of a path between one of the points (called the start point) and every other point returning to the original point (travelling salesman like situation) and work out the minimum distance.&lt;/P&gt;&lt;P&gt;Calculate the distance from the start point to the furthest point from the start point&lt;/P&gt;&lt;P&gt;Calculate the distance of the perimeter that consists of the outer points of the shape&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know there is a lot here but I'm trying to start off by simulating 8 random numbers. The code below simulates 26 coordinates and the calculates the distance between every point but I want the points to be random.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Obs;&lt;BR /&gt;do x=0 to 5;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; do y=0 to 5;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc distance data=Obs out=Dist method=Euclid nostd;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; var interval(x y);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 14:57:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202352#M10848</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2015-08-19T14:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Similating coordinates and calculating various functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202353#M10849</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You say 8 random numbers but generate 36?&lt;/P&gt;&lt;P&gt;This will generate random points. Change I get the number of pairs you want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data obs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i= 1 to 36;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x= round(1000* ranuni(123),1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y= round(1000* ranuni(789),1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;good luck with the rest.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 15:10:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202353#M10849</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-19T15:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Similating coordinates and calculating various functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202354#M10850</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Once you have your simulated data you can do a cross join and then you can do your stats.&lt;/P&gt;&lt;P&gt;Building on @ballardw code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data obs;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do i= 1 to 8;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x= round(1000* ranuni(123),1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y= round(1000* ranuni(789),1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table xdistance as&lt;/P&gt;&lt;P&gt;select a.x as x1, a.y as y1,&lt;/P&gt;&lt;P&gt;b.x as x2, b.y as y2&lt;/P&gt;&lt;P&gt;from obs as a&lt;/P&gt;&lt;P&gt;cross join obs as b&lt;/P&gt;&lt;P&gt;where a.i&amp;lt;b.i;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 15:16:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202354#M10850</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-19T15:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Similating coordinates and calculating various functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202355#M10851</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I chose a START vector, say 750,321 would I need to use arrays to create a table with 18 fields (x1 y1 x2 y2 ... x8 y8 x1y1) which showed every combination of the 8 coordinates conditional on the first number being 750,321. I would then create 19/20th fields with 750,321 in every row. I'm trying to simulate a situation where each coordinate represents a city (so 8 cities) and I want to work out the quickest route if you were to start at 750,321 and visit all cities before returning to 750,321. There are (n-1)!/2 possible routs so 2520.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I have my table in the above format I will calculate the total distance travelled for each of the 2520 possible routes. The smallest one will be the optimal route.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 19:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202355#M10851</guid>
      <dc:creator>brophymj</dc:creator>
      <dc:date>2015-08-19T19:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Similating coordinates and calculating various functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202356#M10852</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could use arrays...&lt;/P&gt;&lt;P&gt;SAS OPTGRAPH is designed exactly for this type of analysis. &lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/procgralg/68145/HTML/default/viewer.htm#procgralg_optgraph_details78.htm" title="http://support.sas.com/documentation/cdl/en/procgralg/68145/HTML/default/viewer.htm#procgralg_optgraph_details78.htm"&gt;SAS(R) OPTGRAPH Procedure 14.1: Graph Algorithms and Network Analysis&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 20:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202356#M10852</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-08-19T20:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Similating coordinates and calculating various functions</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202357#M10853</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And this paper&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings12/161-2012.pdf" title="http://support.sas.com/resources/papers/proceedings12/161-2012.pdf"&gt;http://support.sas.com/resources/papers/proceedings12/161-2012.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 20:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Similating-coordinates-and-calculating-various-functions/m-p/202357#M10853</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-19T20:18:11Z</dc:date>
    </item>
  </channel>
</rss>

