05-18-2017 02:44 PM - edited 05-18-2017 02:45 PM
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...)
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.
05-18-2017 03:40 PM
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:
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:
05-18-2017 03:56 PM
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?
05-18-2017 05:19 PM
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.
05-18-2017 04:20 PM - edited 05-18-2017 04:23 PM
Here's a quick and dirty report that might be good enough:
proc freq data=have;
tables name * location / missing list;
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.