SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Repeated Measures Data - how often they frequent same location

Reply
New Contributor
Posts: 2

Repeated Measures Data - how often they frequent same location

[ Edited ]

Hi all,

 

I'm trying to see if each person had visited different location for each observation and if there was a location they frequently visited.

 

The data looks like this (along with other variables like date, description of the visit...)

 

Name  Location

Name1  location_A

Name1  location_B

Name1  location_C

Name2  location_D

Name2  location_D

Name2  location_D

Name2  location_E

Name3  location_F

Name3  location_G

 

So I would like to know if the people in my data set usually go to the same place (in the case of Name2 that went to location_B 75% of the time) or not (in the case of Name1 that went to three different places three different times).  Is there any good way to see this with a SAS code?

 

I know it's not a good data question, but I thought I would ask the experts anyways.

 

Thank you,

 

 

 

 

PROC Star
Posts: 1,167

Re: Repeated Measures Data - how often they frequent same location

Give Summary Tables in Enterprise Guide a try. Set Name and Location as your Classification variables, and on the table builder get it looking like this:

 

SAS Table 1.png

 

When you run it, you should see a table with the correct numbers. Then in the Results tab, have EG save it to a dataset. The dataset should look like this:

 

SAS Table 2.png

New Contributor
Posts: 2

Re: Repeated Measures Data - how often they frequent same location

Hi Tom,

Thank you for your solution.  This is what I would normally do - but I failed to mention that my data contains at least 700,000 people, each with 5-20 visits.

 

Any good solution for such data?

 

Thanks,

 

PROC Star
Posts: 1,167

Re: Repeated Measures Data - how often they frequent same location

I wouldn't get too concerned...SAS plays in the big boy leagues.

 

Just turn off all of your report output options in EG. I spun up some test data that I think matches your profile (8 million records), and the Summary Tables step ran in about 30 seconds.

 

Tom

 

Super User
Posts: 5,498

Re: Repeated Measures Data - how often they frequent same location

[ Edited ]

Here's a quick and dirty report that might be good enough:

 

proc freq data=have;

tables name * location / missing list;

run;

 

Well, maybe not for 700K people.  What would you consider to be an acceptable report for that?  This program will print something for each NAME, which might be too much.  But if that's not a good solution, then what is?  If you can design the report, somebody can certainly program it.

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