Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
MRCHART Statement

Example 36.2: Specifying Axis Labels

See SHWMR3 in the SAS/QC Sample Library

This example illustrates various methods for specifying axis labels and other axis features for median and range charts. For further details, see "Labeling Axes".

The charts in Figure 36.2, which are based on the data set DETERGNT introduced in the "Getting Started" section, display default labels for the horizontal and vertical axes. You can specify axis labels by associating labels with the process and subgroup variables as illustrated by the following statements:

   title 'Median and Range Charts for Detergent Box Weight';
   symbol v=dot c=rose;
   proc shewhart data=detergnt;
      mrchart weight*lot / split    = '/'
                           cframe   = vipb
                           cinfill  = ywh
                           coutfill = salmon
                           cconnect = rose;
      label lot    = 'Detergent Lot Number'
            weight = 'Median in pounds/Range';
   run;

The charts are shown in Output 36.2.1. The horizontal axis label is the label associated with the subgroup-variable LOT. The vertical axis label for the median chart, referred to as the primary vertical axis label, is the first portion of the label associated with the process variable WEIGHT, up to but not including the split character, which is specified with the SPLIT= option. The vertical axis label for the range chart, referred to as the secondary vertical axis label, is the second portion of the label associated with WEIGHT.

Output 36.2.1: Customized Axis Labels Using Variable Labels
mrex2a.gif (6013 bytes)

When the input data set is a HISTORY= data set, the vertical axis labels are determined by the label associated with the subgroup median variable. This is illustrated by the following statements, which use the data set DETSUM:

   title 'Median and Range Charts for Detergent Box Weight';
   symbol v=dot;
   proc shewhart history=detsum;
      mrchart weight*lot / split = '/';
      label lot     = 'Detergent Lot Number'
            weightm = 'Median (pounds)/Range';
   run;

The charts are identical to those in Output 36.2.1.

When the input data set is a TABLE= data set, the vertical axis labels are determined by the label associated with the subgroup median variable _SUBMED_. This is illustrated by the following statements, which use the data set DTABLE introduced in Figure 36.7:

   title 'Median and Range Charts for Detergent Box Weight';
   symbol v=dot;
   proc shewhart table=dtable;
      mrchart weight*lot / split = '/';
      label lot      = 'Detergent Lot Number'
            _submed_ = 'Median (pounds)/Range';
   run;

The charts are identical to those in Output 36.2.1. When you are creating charts on graphics devices, you can use AXIS statements to enhance the appearance of the axes. This method is illustrated by the following statements:

   title 'Median and Range Charts for Detergent Box Weight';
   symbol v=dot c=rose;
   proc shewhart data=detergnt;
      mrchart weight*lot / haxis    = axis1 
                           vaxis    = axis2
                           vaxis2   = axis3
                           cframe   = vipb
                           cinfill  = ywh
                           cconnect = rose
                           coutfill = salmon;
   axis1 label=(c=bib  f=simplex 'Detergent Lot Number'          );
   axis2 label=(c=vilg f=simplex 'Median Weight' j=c 'of Sample' );
   axis3 label=(c=vilg f=simplex 'Range of'      j=c 'Sample'    );
   run;

The charts are shown in Output 36.2.2.

Output 36.2.2: Customized Axis Labels Using AXIS Statements
mrex2b.gif (6516 bytes)

You can use AXIS statements to customize a variety of axis features. For details, see SAS/GRAPH Software: Reference.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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