Help using Base SAS procedures

How to return the most frequent latitude/longitude?

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

How to return the most frequent latitude/longitude?

Hi SAS experts,

I am playing around with a dataset that consists of the starting latitude/longitude of a car for 30 consecutive days. I want to know the location of the most frequent starting point (eg. home).

An example of the dataset is below:

date            lat/long          value           

01JAN14     latitude           42.4937362670898

01JAN14     longitude        -83.8847427368164

02JAN14     latitude           42.3681436844645

02JAN14     longitude        -83.8913497924805

03JAN14     latitude           64.1684654354354

03JAN14     longitude        -24.4862442016602

04JAN14     latitude            40.1641654545435

04JAN14     longitude        -83.4861297607422

.....

30JAN14     latitude            39.1641654545435

30JAN14     longitude        -80.4861297607422

I need to get the most frequent lat/long starting point for the 30 days but since the coordinates have up to 13 decimals, I can't just do a proc freq.

I am fairly new to SAS and I was reading up a statistic called PROC UNIVARIATE. I am not familiar with proc univariate so I would like to ask you guys if there's another simpler way for beginners to do it. Otherwise, I will have to read up on that statistic. Thanks in advance!


Accepted Solutions
Solution
‎06-19-2014 04:31 PM
Super User
Posts: 19,772

Re: How to return the most frequent latitude/longitude?

Figure out a distance boundary, ie 100 m, then translate that to decimal points, say 2. Now round all numbers to 2 decimal places and run a proc freq.

View solution in original post


All Replies
Solution
‎06-19-2014 04:31 PM
Super User
Posts: 19,772

Re: How to return the most frequent latitude/longitude?

Figure out a distance boundary, ie 100 m, then translate that to decimal points, say 2. Now round all numbers to 2 decimal places and run a proc freq.

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 140 views
  • 0 likes
  • 2 in conversation