How to get the statistics you need from SAS Enterprise Guide

If you need to calculate the mean, sum, standard deviation, or frequency count for a variable, you'll find it pretty easy to accomplish in SAS Enterprise Guide. The corresponding tasks in the menus have names like "Summary Statistics" or "One-way Frequencies". Obvious, right?

Often, researchers or students have a quest to calculate a more "exotic" statistic that isn't easy to find by navigating the menus. I'm not a statistician, but I do have a method for answering the question: "can I calculate <your favorite statistic> in SAS Enterprise Guide?"

Step 1. Find out how SAS supports the statistic

One of the most popular SAS notes on support.sas.com is FAStats: Frequently asked-for statistics. This note lists the statistical terms from "Alpha" to "Zero-inflated models". Most entries include a reference to a SAS procedure and option that can be used to calculate the stat. Some entries provide links to more documentation to help you with the approach, and even to more information about the theories behind the statistic.

Step 2. Find out whether SAS Enterprise Guide has a corresponding task

After you learn the name of the SAS procedure that you might use to calculate the statistic, you need to find out whether SAS Enterprise Guide has a task that supports that procedure. You can find a list of SAS tasks and associated procedures on support.sas.com.

Or, you can simply look in the task list within SAS Enterprise Guide. Select View->Task List, then change the view to show the Tasks by Name. This shows a list of all of the tasks and their associated SAS procedures. You can sort the list by clicking on the SAS Procedure column heading, which will make it easier to find whether the procedure that you need is listed.

Step 3. Explore the task to find the exact option to check

If you've identified a SAS procedure and a SAS Enterprise Guide task that supports it, then the next step is to find the exact option in the task that triggers the statistic.

For example, let's assume you're looking to calculate odds ratios using the Wald method. The FASTats note points you to a number of SAS procedures, including PROC LOGISTIC and the CLODDS= option. The SAS Enterprise Guide task list shows that LOGISTIC is supported by (surprise!) the Logistic Regression task. If you open the Logistic Regression task and hunt around for a bit, you'll find the Wald option within the Conditional odds ratios grouping on the Model: Options page.

Pro tip: The SAS Enterprise Guide help contains detailed listings of all of the supported options among all of the tasks. If you choose Help->SAS Enterprise Guide Help from the main menu, then enter "Wald" in the Search tab (note that the Index might not have it), it will lead you right to the Logistic Regression task (as well as a few others).

Step 4. If needed, find a programming example for the statistic

SAS Enterprise Guide does not offer a task for every single SAS procedure. And the tasks don't support every single procedure option. But that doesn't mean that SAS Enterprise Guide doesn't support the statistic: it simply means that you might have to write a bit of code to get to it.

In addition to the FAStats note, which will point you to the correct SAS language elements that you need for your program, the SAS samples collection might very well include an example of what you need. (If you can't find the example you need, ask your peers in the SAS Statistical Procedures forum on communities.sas.com!)

Note that some analyses are more specialized per discipline and not easily attainable by straight programming. For example, a customer recently asked about CHAID analysis in SAS Enterprise Guide. I checked FAStats and found an entry for CHAID (Chi-square Automatic Interaction Detector), with a note that it's supported by SAS Enterprise Miner. It might not have been the "yes, you can do here" answer that the customer was looking for, but at least it ended the hunt quickly.