Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
XSCHART Statement

Creating Charts for Means and Standard Deviations from Raw Data

See SHWXS1 in the SAS/QC Sample Library

A petroleum company uses a turbine to heat water into steam, which is then pumped into the ground to make oil more viscous and easier to extract. This process occurs 20 times daily, and the amount of power (in kilowatts) used to heat the water to the desired temperature is recorded. The following statements create a SAS data set named TURBINE, which contains the power output measurements for 20 days:

   data turbine;
      informat day date7.;
      format day date5.;
      input day @;
      do i=1 to 10;
         input kwatts @;
         output;
         end;
      drop i;
      datalines;
   04JUL94 3196 3507 4050 3215 3583 3617 3789 3180 3505 3454
   04JUL94 3417 3199 3613 3384 3475 3316 3556 3607 3364 3721
   05JUL94 3390 3562 3413 3193 3635 3179 3348 3199 3413 3562
   05JUL94 3428 3320 3745 3426 3849 3256 3841 3575 3752 3347
   06JUL94 3478 3465 3445 3383 3684 3304 3398 3578 3348 3369
   06JUL94 3670 3614 3307 3595 3448 3304 3385 3499 3781 3711
   07JUL94 3448 3045 3446 3620 3466 3533 3590 3070 3499 3457
   07JUL94 3411 3350 3417 3629 3400 3381 3309 3608 3438 3567
   08JUL94 3568 2968 3514 3465 3175 3358 3460 3851 3845 2983
   08JUL94 3410 3274 3590 3527 3509 3284 3457 3729 3916 3633
   09JUL94 3153 3408 3741 3203 3047 3580 3571 3579 3602 3335
   09JUL94 3494 3662 3586 3628 3881 3443 3456 3593 3827 3573
   10JUL94 3594 3711 3369 3341 3611 3496 3554 3400 3295 3002
   10JUL94 3495 3368 3726 3738 3250 3632 3415 3591 3787 3478
   11JUL94 3482 3546 3196 3379 3559 3235 3549 3445 3413 3859
   11JUL94 3330 3465 3994 3362 3309 3781 3211 3550 3637 3626
   12JUL94 3152 3269 3431 3438 3575 3476 3115 3146 3731 3171
   12JUL94 3206 3140 3562 3592 3722 3421 3471 3621 3361 3370
   13JUL94 3421 3381 4040 3467 3475 3285 3619 3325 3317 3472
   13JUL94 3296 3501 3366 3492 3367 3619 3550 3263 3355 3510
   14JUL94 3795 3872 3559 3432 3322 3587 3336 3732 3451 3215
   14JUL94 3594 3410 3335 3216 3336 3638 3419 3515 3399 3709
   15JUL94 3850 3431 3460 3623 3516 3810 3671 3602 3480 3388
   15JUL94 3365 3845 3520 3708 3202 3365 3731 3840 3182 3677
   16JUL94 3711 3648 3212 3664 3281 3371 3416 3636 3701 3385
   16JUL94 3769 3586 3540 3703 3320 3323 3480 3750 3490 3395
   17JUL94 3596 3436 3757 3288 3417 3331 3475 3600 3690 3534
   17JUL94 3306 3077 3357 3528 3530 3327 3113 3812 3711 3599
   18JUL94 3428 3760 3641 3393 3182 3381 3425 3467 3451 3189
   18JUL94 3588 3484 3759 3292 3063 3442 3712 3061 3815 3339
   19JUL94 3746 3426 3320 3819 3584 3877 3779 3506 3787 3676
   19JUL94 3727 3366 3288 3684 3500 3501 3427 3508 3392 3814
   20JUL94 3676 3475 3595 3122 3429 3474 3125 3307 3467 3832
   20JUL94 3383 3114 3431 3693 3363 3486 3928 3753 3552 3524
   21JUL94 3349 3422 3674 3501 3639 3682 3354 3595 3407 3400
   21JUL94 3401 3359 3167 3524 3561 3801 3496 3476 3480 3570
   22JUL94 3618 3324 3475 3621 3376 3540 3585 3320 3256 3443
   22JUL94 3415 3445 3561 3494 3140 3090 3561 3800 3056 3536
   23JUL94 3421 3787 3454 3699 3307 3917 3292 3310 3283 3536
   23JUL94 3756 3145 3571 3331 3725 3605 3547 3421 3257 3574
   ;

A listing of TURBINE is shown in Figure 44.1.

 
Kilowatt Power Output Data

Obs day kwatts
1 04JUL 3196
2 04JUL 3507
3 04JUL 4050
4 04JUL 3215
5 04JUL 3583
6 04JUL 3617
7 04JUL 3789
8 04JUL 3180
9 04JUL 3505
10 04JUL 3454
11 04JUL 3417
12 04JUL 3199
13 04JUL 3613
14 04JUL 3384
15 04JUL 3475
16 04JUL 3316
17 04JUL 3556
18 04JUL 3607
19 04JUL 3364
20 04JUL 3721
21 05JUL 3390
22 05JUL 3562
23 05JUL 3413
24 05JUL 3193
25 05JUL 3635
26 05JUL 3179
27 05JUL 3348
28 05JUL 3199
29 05JUL 3413
30 05JUL 3562
31 05JUL 3428
32 05JUL 3320
33 05JUL 3745
34 05JUL 3426
35 05JUL 3849
36 05JUL 3256
37 05JUL 3841
38 05JUL 3575
39 05JUL 3752
40 05JUL 3347
41 06JUL 3478
42 06JUL 3465
43 06JUL 3445
44 06JUL 3383
45 06JUL 3684
46 06JUL 3304
47 06JUL 3398
48 06JUL 3578
49 06JUL 3348
50 06JUL 3369
51 06JUL 3670
52 06JUL 3614
53 06JUL 3307
54 06JUL 3595
55 06JUL 3448
56 06JUL 3304
57 06JUL 3385
58 06JUL 3499
59 06JUL 3781
60 06JUL 3711
61 07JUL 3448
62 07JUL 3045
63 07JUL 3446
64 07JUL 3620
65 07JUL 3466
66 07JUL 3533
67 07JUL 3590
68 07JUL 3070
69 07JUL 3499
70 07JUL 3457
71 07JUL 3411
72 07JUL 3350
73 07JUL 3417
74 07JUL 3629
75 07JUL 3400
76 07JUL 3381
77 07JUL 3309
78 07JUL 3608
79 07JUL 3438
80 07JUL 3567
81 08JUL 3568
82 08JUL 2968
83 08JUL 3514
84 08JUL 3465
85 08JUL 3175
86 08JUL 3358
87 08JUL 3460
88 08JUL 3851
89 08JUL 3845
90 08JUL 2983
91 08JUL 3410
92 08JUL 3274
93 08JUL 3590
94 08JUL 3527
95 08JUL 3509
96 08JUL 3284
97 08JUL 3457
98 08JUL 3729
99 08JUL 3916
100 08JUL 3633
101 09JUL 3153
102 09JUL 3408
103 09JUL 3741
104 09JUL 3203
105 09JUL 3047
106 09JUL 3580
107 09JUL 3571
108 09JUL 3579
109 09JUL 3602
110 09JUL 3335
111 09JUL 3494
112 09JUL 3662
113 09JUL 3586
114 09JUL 3628
115 09JUL 3881
116 09JUL 3443
117 09JUL 3456
118 09JUL 3593
119 09JUL 3827
120 09JUL 3573
121 10JUL 3594
122 10JUL 3711
123 10JUL 3369
124 10JUL 3341
125 10JUL 3611
126 10JUL 3496
127 10JUL 3554
128 10JUL 3400
129 10JUL 3295
130 10JUL 3002
131 10JUL 3495
132 10JUL 3368
133 10JUL 3726
134 10JUL 3738
135 10JUL 3250
136 10JUL 3632
137 10JUL 3415
138 10JUL 3591
139 10JUL 3787
140 10JUL 3478
141 11JUL 3482
142 11JUL 3546
143 11JUL 3196
144 11JUL 3379
145 11JUL 3559
146 11JUL 3235
147 11JUL 3549
148 11JUL 3445
149 11JUL 3413
150 11JUL 3859
151 11JUL 3330
152 11JUL 3465
153 11JUL 3994
154 11JUL 3362
155 11JUL 3309
156 11JUL 3781
157 11JUL 3211
158 11JUL 3550
159 11JUL 3637
160 11JUL 3626
161 12JUL 3152
162 12JUL 3269
163 12JUL 3431
164 12JUL 3438
165 12JUL 3575
166 12JUL 3476
167 12JUL 3115
168 12JUL 3146
169 12JUL 3731
170 12JUL 3171
171 12JUL 3206
172 12JUL 3140
173 12JUL 3562
174 12JUL 3592
175 12JUL 3722
176 12JUL 3421
177 12JUL 3471
178 12JUL 3621
179 12JUL 3361
180 12JUL 3370
181 13JUL 3421
182 13JUL 3381
183 13JUL 4040
184 13JUL 3467
185 13JUL 3475
186 13JUL 3285
187 13JUL 3619
188 13JUL 3325
189 13JUL 3317
190 13JUL 3472
191 13JUL 3296
192 13JUL 3501
193 13JUL 3366
194 13JUL 3492
195 13JUL 3367
196 13JUL 3619
197 13JUL 3550
198 13JUL 3263
199 13JUL 3355
200 13JUL 3510
201 14JUL 3795
202 14JUL 3872
203 14JUL 3559
204 14JUL 3432
205 14JUL 3322
206 14JUL 3587
207 14JUL 3336
208 14JUL 3732
209 14JUL 3451
210 14JUL 3215
211 14JUL 3594
212 14JUL 3410
213 14JUL 3335
214 14JUL 3216
215 14JUL 3336
216 14JUL 3638
217 14JUL 3419
218 14JUL 3515
219 14JUL 3399
220 14JUL 3709
221 15JUL 3850
222 15JUL 3431
223 15JUL 3460
224 15JUL 3623
225 15JUL 3516
226 15JUL 3810
227 15JUL 3671
228 15JUL 3602
229 15JUL 3480
230 15JUL 3388
231 15JUL 3365
232 15JUL 3845
233 15JUL 3520
234 15JUL 3708
235 15JUL 3202
236 15JUL 3365
237 15JUL 3731
238 15JUL 3840
239 15JUL 3182
240 15JUL 3677
241 16JUL 3711
242 16JUL 3648
243 16JUL 3212
244 16JUL 3664
245 16JUL 3281
246 16JUL 3371
247 16JUL 3416
248 16JUL 3636
249 16JUL 3701
250 16JUL 3385
251 16JUL 3769
252 16JUL 3586
253 16JUL 3540
254 16JUL 3703
255 16JUL 3320
256 16JUL 3323
257 16JUL 3480
258 16JUL 3750
259 16JUL 3490
260 16JUL 3395
261 17JUL 3596
262 17JUL 3436
263 17JUL 3757
264 17JUL 3288
265 17JUL 3417
266 17JUL 3331
267 17JUL 3475
268 17JUL 3600
269 17JUL 3690
270 17JUL 3534
271 17JUL 3306
272 17JUL 3077
273 17JUL 3357
274 17JUL 3528
275 17JUL 3530
276 17JUL 3327
277 17JUL 3113
278 17JUL 3812
279 17JUL 3711
280 17JUL 3599
281 18JUL 3428
282 18JUL 3760
283 18JUL 3641
284 18JUL 3393
285 18JUL 3182
286 18JUL 3381
287 18JUL 3425
288 18JUL 3467
289 18JUL 3451
290 18JUL 3189
291 18JUL 3588
292 18JUL 3484
293 18JUL 3759
294 18JUL 3292
295 18JUL 3063
296 18JUL 3442
297 18JUL 3712
298 18JUL 3061
299 18JUL 3815
300 18JUL 3339
301 19JUL 3746
302 19JUL 3426
303 19JUL 3320
304 19JUL 3819
305 19JUL 3584
306 19JUL 3877
307 19JUL 3779
308 19JUL 3506
309 19JUL 3787
310 19JUL 3676
311 19JUL 3727
312 19JUL 3366
313 19JUL 3288
314 19JUL 3684
315 19JUL 3500
316 19JUL 3501
317 19JUL 3427
318 19JUL 3508
319 19JUL 3392
320 19JUL 3814
321 20JUL 3676
322 20JUL 3475
323 20JUL 3595
324 20JUL 3122
325 20JUL 3429
326 20JUL 3474
327 20JUL 3125
328 20JUL 3307
329 20JUL 3467
330 20JUL 3832
331 20JUL 3383
332 20JUL 3114
333 20JUL 3431
334 20JUL 3693
335 20JUL 3363
336 20JUL 3486
337 20JUL 3928
338 20JUL 3753
339 20JUL 3552
340 20JUL 3524
341 21JUL 3349
342 21JUL 3422
343 21JUL 3674
344 21JUL 3501
345 21JUL 3639
346 21JUL 3682
347 21JUL 3354
348 21JUL 3595
349 21JUL 3407
350 21JUL 3400
351 21JUL 3401
352 21JUL 3359
353 21JUL 3167
354 21JUL 3524
355 21JUL 3561
356 21JUL 3801
357 21JUL 3496
358 21JUL 3476
359 21JUL 3480
360 21JUL 3570
361 22JUL 3618
362 22JUL 3324
363 22JUL 3475
364 22JUL 3621
365 22JUL 3376
366 22JUL 3540
367 22JUL 3585
368 22JUL 3320
369 22JUL 3256
370 22JUL 3443
371 22JUL 3415
372 22JUL 3445
373 22JUL 3561
374 22JUL 3494
375 22JUL 3140
376 22JUL 3090
377 22JUL 3561
378 22JUL 3800
379 22JUL 3056
380 22JUL 3536
381 23JUL 3421
382 23JUL 3787
383 23JUL 3454
384 23JUL 3699
385 23JUL 3307
386 23JUL 3917
387 23JUL 3292
388 23JUL 3310
389 23JUL 3283
390 23JUL 3536
391 23JUL 3756
392 23JUL 3145
393 23JUL 3571
394 23JUL 3331
395 23JUL 3725
396 23JUL 3605
397 23JUL 3547
398 23JUL 3421
399 23JUL 3257
400 23JUL 3574
Figure 44.1: Listing of the Data Set TURBINE

The data set is said to be in "strung-out" form since each observation contains the day and power output for a single heating. The first 20 observations contain the power outputs for the first day, the second 20 observations contain the power outputs for the second day, and so on. Because the variable DAY classifies the observations into rational subgroups, it is referred to as the subgroup-variable. The variable KWATTS contains the power output measurements and is referred to as the process variable (or process for short).

You can use \bar{X} and s charts to determine whether the heating process is in control. The following statements create the \bar{X} and s charts shown in Figure 44.2:

   title 'Mean and Standard Deviation Charts for Power Output';
   symbol v=dot c=salmon;
   proc shewhart data=turbine;
      xschart kwatts*day / cframe   = lib
                           cinfill  = bwh
                           cconnect = salmon;
   run;

This example illustrates the basic form of the XSCHART statement. After the keyword XSCHART, you specify the process to analyze (in this case KWATTS), followed by an asterisk and the subgroup-variable (DAY).

The input data set is specified with the DATA= option in the PROC SHEWHART statement.

xsgs2.gif (6005 bytes)

Figure 44.2: \bar{X} and s Charts for Power Output Data

Each point on the \bar{X} chart represents the mean of the measurements for a particular day. For instance, the mean plotted for the first day is (3196 + 3507 + ... + 3721)/20 = 3487.4.

Each point on the s chart represents the standard deviation of the measurements for a particular day. For instance, the standard deviation plotted for the first day is

\sqrt{ \frac{(3196-3487.4)^2 + (3507-3487.4)^2 +  ...  +
 (3721-3487.4)^2}{19}} = 220.26

Since all the points lie within the control limits, it can be concluded that the process is in statistical control.

By default, the control limits shown are 3\sigma limits estimated from the data; the formulas for the limits are given in Table 44.22. You can also read control limits from an input data set; see "Reading Preestablished Control Limits" .

For computational details, see "Constructing Charts for Means and Standard Deviations" . For more details on reading raw data, see "DATA= Data Set" .

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.