OPTIONS NODATE NONUMBER LS=80 PS=60; ******************************************************; *** P-chart (with specified p) ***; *** The response is the number of failing circuits ***; *** from 20 batches of size 500 ***; ******************************************************; data circuits; input batch fail @@; cards; 1 5 2 6 3 11 4 6 5 4 6 9 7 17 8 10 9 12 10 9 11 8 12 7 13 7 14 15 15 8 16 18 17 12 18 16 19 4 20 7 21 17 22 12 23 8 24 7 25 15 26 6 27 8 28 12 29 7 30 9 ; /* You can Specify the Standard Average Proportion with */ /* the P0= Option (as Shown in the Following Statments) */ title1 'p Chart for Failing Circuits'; title2 'Using Data in CIRCUITS and Standard Value P0=0.02'; symbol v=star c=black; proc shewhart data=circuits graphics; pchart fail*batch / subgroupn = 500 p0 = 0.02 psymbol = p0 tests = 1 to 8 ltests = 20 zonelabels tabletests tablelegend needles; label batch = 'Batch Number' fail = 'Fraction Failing'; run;