You can use SAS/IML Workshop to quickly generate graphics in an interactive environment. For example, you can combine traditional SAS/IML statements with new exploratory graphics capabilities to produce quantile-quantile (Q-Q) plots, which are useful for comparing ordered values of a variable with quantiles of a specified theoretical distribution. If the data distribution matches the theoretical distribution, the points on the plot form a linear pattern. Thus, you can use Q-Q plots to determine how well a theoretical distribution models a set of measurements. The following IML Workshop program combines traditional SAS/IML programming statements with new IMLPlus functionality to create a Q-Q plot of rod diameter measurements.

Figure 1: SAS/IML Workshop Program Editor
This example uses two object classes provided by IMLPlus: the DataObject class and the ScatterPlot class. The dobj variable refers to an object of the DataObject class. The object is declared and then constructed using the CreateFromFile method of the DataObject class. The "rods.sas7bdat" parameter to the CreateFromFile method identifies the path name of the stored data set. The GetVarData method creates a matrix X that contains the observation data of the "diameter" variable.
The next three statements are traditional SAS/IML statements. The first statement uses the j function to create a matrix named sortedX to contain sorted values of X. This matrix has the same number of rows as X, as determined by the nrow function, and one column. In addition, the final parameter of the j function specifies that each value of sortedX is equal to zero. The statement
sortedX[rank(X),] = X;
copies the values of X into sortedX, indexed by the ranked values of X, which creates a sorted version of the X matrix. The next statement creates the quantilesX matrix that contains the ordered quantiles of X as computed by the probit function in Base SAS.
The statement
declare ScatterPlot qqplot =
ScatterPlot.Create("QQ Plot",quantilesX,sortedX);
creates a scatter plot that displays the values of quantilesX versus the values of sortedX in a plot titled "QQ Plot." The next three statements invoke the SetAxisLabel method to specify the labels for the X- and Y-axes and set the number of minor axis ticks to five. Figure 2 displays the Q-Q plot created by this IMLPlus program.

Figure 2: Scatter plot of Quantiles versus Sorted Values
Although many of the features of each plot are accessible using IMLPlus syntax, you can also use dialog boxes to modify the appearance of the plots. You can right-click on the plot area and select Plot Area Properties. Figure 3 displays the Observations tab of the Plot Area Properties dialog box.

Figure 3: Plot Area Properties Dialog Box
The Plot Area Properties dialog box displays modified marker properties, including a circle shape, red fill color, and marker size equal to six. Figure 4 displays the modified plot.

Figure 4: Modified Q-Q Plot
Statistics and Operations Research Home Page | SAS/IML Workshop