Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Using the Output Delivery System

Example 15.4: Selecting ODS Tables for Display

You can use the ODS SELECT statement to deliver only the desired tables to ODS destinations. In the following example, the GLM procedure is used to perform an analysis on an unbalanced two-way experimental design.

   data twoway;
   title "Unbalanced Two-way Design";
      input Treatment Block y @@;
      datalines;
   1 1 17   1 1 28   1 1 19   1 1 21   1 1 19
   1 2 43   1 2 30   1 2 39   1 2 44   1 2 44
   1 3 16
   2 1 21   2 1 21   2 1 24   2 1 25
   2 2 39   2 2 45   2 2 42   2 2 47
   2 3 19   2 3 22   2 3 16
   3 1 22   3 1 30   3 1 33   3 1 31
   3 2 46
   3 3 26   3 3 31   3 3 26   3 3 33   3 3 29   3 3 25
   ;

   proc glm data=twoway;
      class Treatment Block;
      model y = Treatment|Block;
      means Treatment;
      lsmeans Treatment;

   ods select ModelANOVA Means;
   ods trace on;
   ods show;
   run;

In the preceding statements, the GLM procedure is invoked to produce the output. The ODS SELECT statement specifies that only the two tables "ModelANOVA" and "Means" are to be delivered to the ODS destinations. In this example, no ODS destinations are explicitly opened. Therefore, only the default SAS listing receives the procedure output. The ODS SHOW statement displays the current overall selection list in the SAS log. The ODS TRACE statement writes the trace record of the ODS output objects to the SAS log.

Output 15.4.1 displays the results of the ODS SHOW statement, which writes the current overall selection list to the SAS log.

Output 15.4.1: Results of the ODS SHOW Statement

              ods select ModelANOVA Means;
              ods trace on;
              ods show;

Current OVERALL select list is: 
1. ModelANOVA
2. Means


Partial results of the ODS TRACE statement, which are written to the SAS log, are displayed in Output 15.4.2. Note that there are two tables having the name "ModelANOVA," which are the Type I Model Anova and the Type III Model Anova tables. Similarly, there are two ODS tables having the name "Means," which are the Means and the LS-means tables.

Output 15.4.2: The ODS TRACE: Partial Contents of the SAS Log

Output Added:
-------------
Name:       ClassLevels
Label:      Class Levels
Template:   STAT.GLM.ClassLevels
Path:       GLM.Data.ClassLevels
-------------
               .
               .
               .
               .
Output Added:
-------------
Name:       ModelANOVA
Label:      Type I Model ANOVA
Template:   stat.GLM.Tests
Path:       GLM.ANOVA.y.ModelANOVA
-------------

Output Added:
-------------
Name:       ModelANOVA
Label:      Type III Model ANOVA
Template:   stat.GLM.Tests
Path:       GLM.ANOVA.y.ModelANOVA
-------------
NOTE: Means from the MEANS statement are not adjusted for other terms in the 
      model.  For adjusted means, use the LSMEANS statement.

Output Added:
-------------
Name:       Means
Label:      Means
Template:   stat.GLM.Means
Path:       GLM.Means.Treatment.Means
-------------

Output Added:
-------------
Name:       Means
Label:      Means
Template:   stat.GLM.LSMeans
Path:       GLM.LSMEANS.Treatment.Means
-------------


In the following statements, the ODS SHOW statement writes the current overall selection list to the SAS log. The QUIT statement ends the GLM procedure. The second ODS SHOW statement writes the selection list to the log after PROC GLM terminates. The ODS selection list is reset to 'ALL,' by default, when a procedure terminates. For more information on ODS exclusion and selection lists, see the section "Using the Output Delivery System".

   ods show;
   quit;
   ods show;

The results of the statements are displayed in Output 15.4.3. Before the GLM procedure terminates, the ODS selection list includes only the two tables, "ModelANOVA" and "Means."

Output 15.4.3: The ODS Selection List, Before and After PROC GLM Terminates
            ods show;

Current OVERALL select list is: 
1. ModelANOVA
2. Means


              quit;

NOTE: The PROCEDURE GLM printed pages 11-13.


              ods show;

Current OVERALL select list is: ALL


The GLM procedure supports interactive run-group processing. Before the QUIT statement is executed, PROC GLM is active and the ODS selection list remains at its previous setting before PROC GLM was invoked. After the QUIT statement, when PROC GLM is no longer active, the selection list is reset to deliver all output tables.

The entire displayed output consists of the four selected tables (two "ModelANOVA" tables and two "Means" tables), as displayed in Output 15.4.4 and Output 15.4.5.

Output 15.4.4: The ModelANOVA Tables from PROC GLM

                                               Unbalanced Two-way Design

                                                   The GLM Procedure
 
Dependent Variable: y   

        Source                                          DF       Type I SS     Mean Square    F Value    Pr > F

        Treatment                                        2        8.060606        4.030303       0.24    0.7888
        Block                                            2     2621.864124     1310.932062      77.95    <.0001
        Treatment*Block                                  4       32.684361        8.171090       0.49    0.7460


        Source                                          DF     Type III SS     Mean Square    F Value    Pr > F

        Treatment                                        2      266.130682      133.065341       7.91    0.0023
        Block                                            2     1883.729465      941.864732      56.00    <.0001
        Treatment*Block                                  4       32.684361        8.171090       0.49    0.7460

Output 15.4.5: The Means Tables from PROC GLM

                           Unbalanced Two-way Design

                               The GLM Procedure

               Level of             --------------y--------------
               Treatment      N             Mean          Std Dev

               1             11       29.0909091       11.5104695
               2             11       29.1818182       11.5569735
               3             11       30.1818182        6.3058414
 
                                                                                
 
                           Unbalanced Two-way Design

                               The GLM Procedure
                              Least Squares Means

                           Treatment        y LSMEAN

                           1              25.6000000
                           2              28.3333333
                           3              34.4444444

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.