05-01-2013 02:29 PM
I would like to use the Summary Tables feature but I don't know what some of the wording means like under Task roles: Analysis Variables, Classification Variables, Pages, Relative weight, Frequency count. Options for classification variables. Also, I want to format my numbers to include commas - where do I do this. Under the Summary Tables, it has Available statistics - how do I use them? I am trying to use this feature and I am sure once I understand everything it should be easy.
05-04-2013 04:56 PM
No problem; the task can be a little daunting at first. I'm going to use the datasets SASHELP.SHOES to illustrate some of the concepts.
I'm using the Summary Tables task, not the Summary Tables Wizard. As you say, the first screen asks you to assign variables to roles. Classification variables are the "dimensions" for your tables, i.e. "I'd like to tabulate x by y". In SHOES, Region, Product and Subsidiary are good examples. To get you started, drag Product into the Classification Variables box.
Analysis variables, on the other hand, are the variables that you actually perform statistical operations on, like sums, means, medians, etc. Try dragging Total Sales to the Analysis Variables box.
We'll worry about the other three later. Now click on the "Summary Tables" tab at the left. You'll see a list of the variables that you selected, a list of the available statistics, and a "preview" area, where you drag variables and statistics to make up your table. I advise people to start with the rows, and with the innermost classification variable. So try dragging the "Product" variable to the row box. It should sit there.
Now drag the Sales variable to the skinny box above the box with an "N" in it. Last, drag the "Mean" statistic, and drop it on top of the "N". It should replace it.
Ta-da! You've now asked for mean sales by product. Hit Run, and see how it looks.
Now a few of the things we skipped. On the Data tab, if you drag a classification variable into "Pages", it will print a separate page for each value of that variable. Relative weight and Frequency Count let you use weights, the first uses decimal places and the second one truncates them before using.
On the Summary Tables tab, the Total (ALL) classification variable lets you ask for sub and grand totals. Just drag it, like the other classification variables. You can use it more than once. Classification and Analysis variables can only be used once, but they can be used in both rows and columns, and rows and columns can be nested. The N statistic is Count (it's called N in SAS for historical reasons).
On the Results tab, you can ask SAS to create a summary dataset, as well as the printable table.
And the Titles and Properties tabs are the ones you see in pretty much all of the tasks.
My advice is to play with it with a simple dataset, like SHOES. You'll beat your head against a wall for about an hour, and after that you'll absolutely love it!