DM 'LOG; CLEAR; OUT; CLEAR;'; * ODS PRINTER PDF file='C:\COURSES\ST528\SAS\PCHART3.PDF'; ODS LISTING; OPTIONS NODATE NONUMBER LS=76 PS=54; *******************************************************; *** P-chart (with unequal sample sizes) ***; *** The response is the number of failing batteries ***; *** from 25 lots of varying size ***; *******************************************************; DATA battery; INPUT lot $ nfailed sampsize @@;; LABEL nfailed ='Number Failed' lot ='Lot Identifier' sampsize='Number Sampled'; LINES; AE3 6 151 AE4 5 142 AE9 6 145 BR3 9 149 BR7 3 150 BR8 0 156 BR9 4 150 DB1 9 158 DB2 4 152 DB3 0 162 DB5 9 140 DB6 7 161 DS4 6 154 DS6 1 144 DS8 5 154 JG1 3 151 MC3 8 148 MC4 2 143 MK6 4 150 MM1 4 147 MM2 0 150 RT5 2 154 RT9 8 149 SP1 3 160 SP3 9 153 ; /* The following p chart has control limits that vary with the subgroup sample size. */ TITLE 'Proportion of Battery Failures'; SYMBOL1 VALUE=square WIDTH=3; PROC SHEWHART DATA=battery ; PCHART nfailed*lot='1' / TESTS = 1 to 8 SUBGROUPN = sampsize TABLETESTS TABLELEGEND; LABEL nfailed='Proportion Failed' lot = 'Lot ID'; RUN;