11-19-2012 01:56 AM
Let's say we have a list of pet types mentioned on a survey:
I simply want a tally of these entries. How many cats, how many dogs, etc.
What would be the most appropriate SAS Proc to accomplish this? Please provide a complete example code.
11-19-2012 03:57 AM
PROC FREQ is the simplest way of doing this. Just search for it on the web and you will find many examples you can use, depending on how you want your output (report or data set).
11-19-2012 05:58 PM
There are hundreds of paper on this, search lexjansen.com
What are you actually after?
Here's one from 1993...b/c that's at least how old the question is.
11-19-2012 06:33 PM
The actual case I'm dealing with has around 5,000,000 observations. And the data file has 15 variables. So, computationally, some muscle is needed.
What I'm surprised at is that the simple problem above doesn't have a more straight-forward solution in SAS.
In Minitab, another statistics program I like, the answer is found with the command:
That's it. So easy. Presto.
Unfortunately, however, Minitab chokes on such a large data set.
11-24-2012 01:38 AM
Hmmm. So in this particular case the PROC FREQ is considerably shorter / more efficient than PROC SQL.
In other instances it's said that more can be done with less code by using SQL.
11-24-2012 04:49 PM
I wan't questioning the usefulness of proc sql. It often offers the best way to accomplish some tasks. However, I wouldn't recommend using it for all data manipulation tasks or to code such things as an analysis of variance, regression, graphs and all of the other things that are easy to do with the various procs.
Need further help from the community? Please ask a new question.