Resources

Histogram with Superimposed Beta Curve

 /****************************************************************/
 /*          S A S   S A M P L E   L I B R A R Y                 */
 /*                                                              */
 /*    NAME: CAPBETA                                             */
 /*   TITLE: Histogram with Superimposed Beta Curve              */
 /* PRODUCT: QC                                                  */
 /*  SYSTEM: ALL                                                 */
 /*    KEYS: Capability Analysis, Beta Distribution,             */
 /*   PROCS: CAPABILITY                                          */
 /*    DATA:                                                     */
 /*                                                              */
 /*     REF: SAS/QC Software:  Examples                          */
 /*    MISC:                                                     */
 /*                                                              */
 /****************************************************************/

options ps=60 ls=80;


data plates;
   label gap='Plate Gap in cm';
   input gap @@;
   cards;
0.746  0.357  0.376  0.327  0.485
1.741  0.241  0.777  0.768  0.409
0.252  0.512  0.534  1.656  0.742
0.378  0.714  1.121  0.597  0.231
0.541  0.805  0.682  0.418  0.506
0.501  0.247  0.922  0.880  0.344
0.519  1.302  0.275  0.601  0.388
0.450  0.845  0.319  0.486  0.529
1.547  0.690  0.676  0.314  0.736
0.643  0.483  0.352  0.636  1.080
;

title1 'Fitted Beta Distribution of Plate Gaps';
title2 '50 Measurements';

proc capability data=plates noprint;
   var gap;
   specs lsl=0.3 clsl=white llsl=1  wlsl=2
         usl=0.8 cusl=white lusl=20 wusl=2;
   histogram /
      beta(theta=0 scale=1.9 color=yellow w=2)
      midpoints = 0.2 to 1.8 by 0.2
      legend    = legend1
      cframe    = gray
      cfill     = green;
   legend1 cframe=gray cborder=black;
run;

goptions reset=all;