The QQPLOT statement creates quantile-quantile plots (Q-Q plots) and compares ordered variable values 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 a Q-Q plot to determine how well a theoretical distribution models a set of measurements.
Q-Q plots are similar to probability plots, which you can create with the PROBPLOT statement. Q-Q plots are preferable for graphical estimation of distribution parameters, whereas probability plots are preferable for graphical estimation of percentiles.
You can use any number of QQPLOT statements in the UNIVARIATE procedure. The components of the QQPLOT statement are as follows.
Table 4.22 lists primary options for requesting a theoretical distribution. See the section Distributions for Probability and Q-Q Plots for detailed descriptions of these distributions.
Table 4.22: Primary Options for Theoretical Distributions
Option |
Description |
---|---|
specifies beta Q-Q plot for shape parameters and specified with mandatory ALPHA= and BETA= beta-options |
|
specifies exponential Q-Q plot |
|
specifies gamma Q-Q plot for shape parameter specified with mandatory ALPHA= gamma-option |
|
specifies gumbel Q-Q plot |
|
specifies lognormal Q-Q plot for shape parameter specified with mandatory SIGMA= lognormal-option |
|
specifies normal Q-Q plot |
|
specifies generalized Pareto Q-Q plot for shape parameter specified with mandatory ALPHA= Pareto-option |
|
specifies power function Q-Q plot for shape parameter specified with mandatory ALPHA= power-option |
|
specifies Rayleigh Q-Q plot |
|
specifies three-parameter Weibull Q-Q plot for shape parameter c specified with mandatory C= Weibull-option |
|
specifies two-parameter Weibull Q-Q plot |
Table 4.23 lists secondary options that specify distribution parameters and control the display of a distribution reference line. Specify these options in parentheses after the distribution keyword. For example, you can request a normal Q-Q plot with a distribution reference line by specifying the NORMAL option as follows:
proc univariate; qqplot Length / normal(mu=10 sigma=0.3 color=red); run;
The MU= and SIGMA= normal-options display a distribution reference line that corresponds to the normal distribution with mean and standard deviation , and the COLOR= normal-option specifies the color for the line.
Table 4.23: Secondary Distribution Reference Line Options
Option |
Description |
---|---|
Options Used with All Distributions |
|
specifies color of distribution reference line |
|
specifies line type of distribution reference line |
|
specifies width of distribution reference line |
|
Beta-Options |
|
specifies mandatory shape parameter |
|
specifies mandatory shape parameter |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Exponential-Options |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Gamma-Options |
|
specifies mandatory shape parameter |
|
specifies change in successive estimates of at which the Newton-Raphson approximation of terminates |
|
specifies initial value for in the Newton-Raphson approximation of |
|
specifies maximum number of iterations in the Newton-Raphson approximation of |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Gumbel-Options |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Lognormal-Options |
|
specifies mandatory shape parameter |
|
specifies slope of distribution reference line |
|
specifies for distribution reference line |
|
specifies for distribution reference line (slope is ) |
|
Normal-Options |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Pareto-Options |
|
specifies mandatory shape parameter |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Power-Options |
|
specifies mandatory shape parameter |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Rayleigh-Options |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Weibull-Options |
|
specifies mandatory shape parameter c |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Weibull2-Options |
|
specifies for distribution reference line (slope is ) |
|
specifies for distribution reference line (intercept is ) |
|
specifies slope of distribution reference line |
|
specifies known lower threshold |
|
Weibull-Options |
|
specifies mandatory shape parameter c |
|
requests table of iteration history and optimizer details |
|
specifies maximum number of iterations in the Newton-Raphson approximation of |
|
specifies for distribution reference line |
|
specifies for distribution reference line |
|
Weibull2-Options |
|
specifies for distribution reference line (slope is ) |
|
requests table of iteration history and optimizer details |
|
specifies maximum number of iterations in the Newton-Raphson approximation of |
|
specifies for distribution reference line (intercept is ) |
|
specifies slope of distribution reference line |
|
specifies known lower threshold |
Table 4.24 summarizes general options for enhancing Q-Q plots.
Table 4.24: General Graphics Options
Option |
Description |
---|---|
General Graphics Options |
|
creates a grid |
|
specifies reference lines perpendicular to the horizontal axis |
|
specifies labels for HREF= lines |
|
specifies vertical position of labels for HREF= lines |
|
suppresses label for horizontal axis |
|
suppresses label for vertical axis |
|
suppresses tick marks and tick mark labels for vertical axis |
|
displays a nonlinear percentile axis |
|
replaces theoretical quantiles with percentiles |
|
switches horizontal and vertical axes |
|
displays plot in square format |
|
specifies label for vertical axis |
|
specifies reference lines perpendicular to the vertical axis |
|
specifies labels for VREF= lines |
|
specifies horizontal position of labels for VREF= lines |
|
Options for Traditional Graphics Output |
|
specifies annotate data set |
|
specifies color for axis |
|
specifies color for frame |
|
specifies color for grid lines |
|
specifies colors for HREF= lines |
|
specifies colors for STATREF= lines |
|
specifies color for text |
|
specifies colors for VREF= lines |
|
specifies description for plot in graphics catalog |
|
specifies software font for text |
|
specifies height of text used outside framed areas |
|
specifies number of horizontal minor tick marks |
|
specifies software font for text inside framed areas |
|
specifies height of text inside framed areas |
|
specifies a line type for grid lines |
|
specifies line types for HREF= lines |
|
specifies line types for STATREF= lines |
|
specifies line types for VREF= lines |
|
specifies name for plot in graphics catalog |
|
suppresses frame around plotting area |
|
requests minor tick marks for percentile axis |
|
specifies AXIS statement for vertical axis |
|
specifies number of vertical minor tick marks |
|
specifies line thickness for axes and frame |
|
specifies line thickness for grid |
|
Options for ODS Graphics Output |
|
specifies footnote displayed on plot |
|
specifies secondary footnote displayed on plot |
|
specifies title displayed on plot |
|
specifies secondary title displayed on plot |
|
Options for Comparative Plots |
|
applies annotation requested in ANNOTATE= data set to key cell only |
|
specifies color for filling frame for row labels |
|
specifies color for filling frame for column labels |
|
specifies color for proportion of frequency bar |
|
specifies distance between tiles |
|
specifies number of columns in comparative Q-Q plot |
|
specifies number of rows in comparative Q-Q plot |
|
Miscellaneous Options |
|
specifies table of contents entry for Q-Q plot grouping |
|
adjusts sample size when computing percentiles |
|
adjusts ranks when computing percentiles |
The following entries provide detailed descriptions of options in the QQPLOT statement. Options marked with † are applicable only when traditional graphics are produced. See the section Dictionary of Common Options for detailed descriptions of options common to all plot statements.