BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
shixin
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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

1 REPLY 1
Reeza
Super User

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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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