Syntax: INSET Statement |
The syntax for the INSET statement is as follows:
You can use any number of INSET statements in the CAPABILITY procedure. Each INSET statement produces an inset and must follow one of the plot statements: CDFPLOT, COMPHISTOGRAM, HISTOGRAM, PPPLOT, PROBPLOT, or QQPLOT. The inset appears in all displays produced by the plot statement that immediately precedes it. The statistics are displayed in the order in which they are specified. For example, the following statements produce a cumulative distribution plot with two insets and a histogram with one inset:
proc capability data=Wire; cdfplot Strength; inset mean std min max n; inset p1 p5 p10; histogram Strength; inset var skewness kurtosis; run;
The statistics displayed in an inset are computed for a specific process variable from observations for the current BY group. For example, in the following statements, there are two process variables (Strength and Diameter) and a BY variable (Batch). If there are three different batches (levels of Batch), then a total of six histograms are produced. The statistics in each inset are computed for a particular variable and batch. The labels in the inset are the same for each histogram.
proc capability data=Wire2; by Batch; histogram Strength Diameter / normal; inset mean std min max normal(mu sigma); run;
The components of the INSET statement are described as follows.
can include any of the keywords listed in Summary of INSET Keywords. Some keywords allow secondary keywords to be specified in parentheses immediately after the primary keyword. Also, some inset statistics are available only if you request plot statements and options for which those statistics are calculated. For example, consider the following statements:
proc capability data=Wire; histogram Strength / normal; inset mean std normal(ad adpval); run;
The keywords MEAN and STD display the sample mean and standard deviation of Strength. The primary keyword NORMAL with the secondary keywords AD and ADPVAL display the Anderson-Darling goodness-of-fit test statistic and -value in the inset as well. The statistics specified with the NORMAL keyword are available only because a normal distribution has been fit to the data by using the NORMAL option in the HISTOGRAM statement. See the section Summary of INSET Keywords, which follows, for a list of available keywords.
Typically, you specify keywords, to display statistics computed by the CAPABILITY procedure. However, you can also specify the keyword DATA= followed by the name of a SAS data set to display customized statistics. This data set must contain two variables:
a character variable named _LABEL_ whose values provide labels for inset entries.
a variable named _VALUE_, which can be either character or numeric, and whose values provide values for inset entries.
The label and value from each observation in the DATA= data set occupy one line in the inset. The position of the DATA= keyword in the keyword list determines the position of its lines in the inset.
By default, inset statistics are identified with appropriate labels, and numeric values are printed using appropriate formats. However, you can provide customized labels and formats. You provide the customized label by specifying the keyword for that statistic followed by an equal sign (=) and the label in quotes. Labels can have up to 24 characters. You provide the numeric format in parentheses after the keyword. Note that if you specify both a label and a format for a statistic, the label must appear before the format. For an example, see Formatting Values and Customizing Labels.
appear after the slash (/) and control the appearance of the inset. For example, the following INSET statement uses two appearance options (POSITION= and CTEXT=):
inset mean std min max / position=ne ctext=yellow;
The POSITION= option determines the location of the inset, and the CTEXT= option specifies the color of the text of the inset.
See Summary of Options for a list of all available options, and Dictionary of Options for detailed descriptions. Note the difference between keywords and options; keywords specify the information to be displayed in an inset, whereas options control the appearance of the inset.