Sample 25003: Format midpoints from HISTOGRAM statement in PROC CAPABILITY
Format midpoints from HISTOGRAM statement in PROC CAPABILITY
NOTE: This program is not needed if you are using Version 7 or later
of the SAS System. Beginning in Version 7, formats and FORMAT
statements are honored by PROC CAPABILITY.
- PURPOSE:
-
Prior to Version 7, PROC CAPABILITY did not use formatted values of the
analysis variable and FORMAT statements are ignored. This program
provides a method of formatting through the use of the VALUE= option on
an AXIS statement.
- REQUIREMENTS:
-
Version 6 of Base SAS,
SAS/QC, and
SAS/GRAPH.
- USAGE:
-
Change the value in the %LET statement to the numeric format you want to
use for histogram midpoint values.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
See the
Results tab for the results of running the following SAS code.
/* Assign the appropriate numeric format to &FMT */
%let fmt=time8.;
/* Generate a test data set */
data test;
informat downtime time8.;
format downtime time8.;
input downtime @@;
datalines;
1:15:26 2:03:59 18:20:13 32:08:08 21:42:30
11:54:55 4:05:35 11:58:25 17:03:03 1:09:52
5:07:35 1:34:06 5:22:13 11:09:32 20:47:51
3:11:11 3:02:40 30:20:35 6:02:38 12:46:52
11:57:20 16:01:47 0:59:06 7:23:42 3:54:25
5:48:22 2:59:20 15:09:34 31:42:21 6:42:56
21:37:35 2:02:47 20:14:07 19:52:40 15:28:55
2:23:35 2:27:39 22:53:29 11:55:01 0:44:27
6:55:00 9:06:29 0:45:40 3:13:20 6:22:10
16:46:32 0:35:26 33:52:42 0:24:20 2:32:18
;
/* Run PROC CAPABILITY to create an OUTHISTOGRAM= data set */
proc capability data=test graphics noprint;
histogram downtime / outhistogram=outhist;
run;
/* Create macro variable &MIDPTLST for the MIDPOINTS= list
of actual values and macro variable &VALLST for the
VALUE= list of formatted values */
%let midptlst=;
%let vallst=;
data _null_;
set outhist;
call symput('midpt',trim(left(_midpt_)));
call execute('%let midptlst=&midptlst &midpt;');
call symput('fmtmidpt',"'"||trim(left(put(_midpt_,&fmt)))||"'");
call execute('%let vallst=&vallst &fmtmidpt;');
run;
/* Create the HISTROGRAM with formatted values of the midpoints */
axis1 value=(&vallst);
proc capability data=test graphics noprint;
histogram downtime / haxis=axis1
midpoints=&midptlst;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Prior to Version 7, PROC CAPABILITY did not use formatted values of the analysis variable and FORMAT statements are ignored. This program provides a method of formatting through the use of the VALUE= option on an AXIS statement.
| Type: | Sample |
| Topic: | SAS Reference ==> Procedures ==> CAPABILITY Analytics ==> Process Capability Analysis Analytics ==> Distribution Analysis Analytics ==> Descriptive Statistics
|
| Date Modified: | 2005-04-08 03:01:49 |
| Date Created: | 2005-01-13 15:03:19 |
Operating System and Release Information
| SAS System | SAS/QC | All | 6.12 | 6.12 |