How to get the statistics you need from SAS Enterprise Guide

8

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.

Share

About Author

Chris Hemedinger

Director, SAS User Engagement

+Chris Hemedinger is the Director of SAS User Engagement, which includes our SAS Communities and SAS User Groups. Since 1993, Chris has worked for SAS as an author, a software developer, an R&D manager and a consultant. Inexplicably, Chris is still coasting on the limited fame he earned as an author of SAS For Dummies

8 Comments

  1. Pablo Orosco Joerger on

    Last but not least, you can even write your own statistics code in SAS Enterprise Guide

    • Chris Hemedinger
      Chris Hemedinger on

      Pablo, yes, of course! And if you use the rich SAS/IML language to do this, you'll find there is really nothing that you can't compute. You'll find lots of IML examples on Rick's blog. PROC IML can be run from a program window in SAS Enterprise Guide.

      • Hi Chris,

        May I ask how to run PROC IML in SAS Enterprise Guide? I got errors, because this procedure was not installed in my version?

        Thanks!

        • Chris Hemedinger
          Chris Hemedinger on

          SAS/IML is a separately licensed module that must be installed with SAS. This goes with your SAS server, not with EG. Run proc product_status to see if you have a license. If so, then you or an admin will need to take steps to install.

  2. Mansoor Abubakari on

    Chris,
    Can I use enterprise guide to perform a decision tree analysis? I know I can use SAS Enterprise Miner.

    • Chris Hemedinger
      Chris Hemedinger on

      Mansoor,

      No, SAS Enterprise Miner is the best tool for that. Or SAS Visual Analytics -- which now also has some decision tree support. The closest task in SAS Enterprise Guide is probably Rapid Predictive Modeling -- which uses SAS Enterprise Miner procedures behind the scenes.

  3. Nigel Applewhite on

    I need help compiling the mean and standard deviation of 400 organisations activity over 29 months - can you help

Back to Top