IMSTAT Procedure (Analytics)

Example 10: Performing a Multi-Dimensional Summary

Details

This PROC IMSTAT example demonstrates creating multi-dimensional summaries of the Prdsale data set. Three set specifications are shown in the example. There is no limit to the number of set specifications that you can specify.

Program

libname example sasiola host="grid001.example.com" port=10010 tag='hps';

data example.prdsale; set sashelp.prdsale; run;

proc imstat data=example.prdsale;
    mdsummary actual / 1
/* 1 */  groupby=(region prodtype)
         formats=("$", "$")
         filter="(NOT (REGION='WEST'))",

/* 2 */  groupby=(region prodtype division)
         formats=("$", "$", "$")
         filter="(NOT (REGION='WEST')) AND (NOT (PRODUCT='SOFA'))"

/* 3 */  groupby=(region prodtype division year)
         formats=("$", "$", "$", "f4.") 2
         filter="(NOT (REGION='WEST'))";
run;

Program Description

  1. This MDSUMMARY statement uses the variable that is named actual. You can analyze more than one variable by adding the variable names before the slash.
  2. Formats are enclosed in quotation marks and separated by commas. Numeric formats are also enclosed in quotation marks.

Output

Results for Summarization of Actual by Region and Prodtype
Results for the first set specification: region and prodtype
Results for Summarization of Actual by Region, Prodtype, and Division
Results for the second set specification: region, prodtype, and division
Results for Summarization of Actual by Region, Prodtype, Division, and Year
Results for the third set specification: region, prodtype, division, and year