Programming the statistical procedures from SAS

Finding the perimeter points of an area of points.

Reply
Super Contributor
Posts: 256

Finding the perimeter points of an area of points.

I have a dataset of a 100 randomly generated xy coordinates. I'm trying isolate the points that are on the edge of the area. The definition of this would be:

if the xy coordinate has no x value from another point above it or

if the xy coordinate has no x value from another point below it or

if the xy coordinate has no y value from another point above it or

if the xy coordinate has no y value from another point above it

I'm looking for a reasonably efficient way of doing this.,


data obs;

   do i= 1 to 100;

      x= round(1000* ranuni(123),1);

      y= round(1000* ranuni(789),1);

      output;

   end;

run;

Grand Advisor
Posts: 10,052

Re: Finding the perimeter points of an area of points.

I think you may need to provide some graphic examples of what you mean by coordinates that are on the "edge".

Same x but different y, or same y but different x seems to be the implied condition. But why would that make them an "edge"

If you have

(0, 10)

(0,15)

(0,20)

( 5, 10)

( 5, 15)

(5,20)

(10,10)

(15,10)

(25,10)

which are "edge"?

Super Contributor
Posts: 256

Re: Finding the perimeter points of an area of points.

All except (5,15). When I say edge I mean if you drew a line arounf all the outer points such that there were no points outside the shape the points joining the line would be on the edge. Like an efficient frontier.

SAS Super FREQ
Posts: 3,312

Re: Finding the perimeter points of an area of points.

It sounds like you are looking for the convex hull of the set of planar points. There is a convex hull algorithm in SAS/IML:

SAS/IML(R) 14.1 User's Guide

Ask a Question
Discussion stats
  • 3 replies
  • 228 views
  • 0 likes
  • 3 in conversation