Syntax
The syntax for the HISTOGRAM statement is as follows:
- HISTOGRAM <variables >
< / options >;
You can specify the keyword HIST as an alias for
HISTOGRAM. You can use any number of HISTOGRAM
statements after a PROC CAPABILITY statement.
The components of the HISTOGRAM statement are
described as follows.
- variables
- are the process variables for which histograms are to be created.
If you specify a VAR statement, the variables must also be
listed in the VAR statement. Otherwise, the
variables can be any numeric variables in the
input data set. If you do not specify
variables in a VAR statement or in the HISTOGRAM
statement, then by default, a histogram is created
for each numeric variable in the DATA= data set.
If you use a VAR statement and do not specify any
variables in the HISTOGRAM statement, then
by default, a histogram is created for each variable
listed in the VAR statement.
For example, suppose
a data set named STEEL contains exactly two
numeric variables named LENGTH and WIDTH.
The following statements create two histograms,
one for LENGTH and one for WIDTH:
proc capability data=steel;
histogram;
run;
Likewise, the following statements create histograms for LENGTH
and WIDTH:
proc capability data=steel;
var length width;
histogram;
run;
The following statements create a histogram for LENGTH only:
proc capability data=steel;
var length width;
histogram length;
run;
- options
- add features to the histogram. Specify all options
after the slash (/) in the HISTOGRAM statement.
For example, in the following statements,
the NORMAL option displays a fitted normal
curve on the histogram, the MIDPOINTS= option specifies
midpoints for the histogram, and the CTEXT= option
specifies the color of the text:
proc capability data=steel;
histogram length / normal
midpoints = 5.6 5.8 6.0 6.2 6.4
ctext = yellow;
run;
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.