Contributor
Posts: 45

# Proc Shewhart Tests=2 to 4 Not Working with Missing Data Point (SAS 9.2)

Hello,

I am wondering if there is a way to get the Tests=2 to 4 to signal when a data point is missing.  For example, 10 data points (out of many) may consist of:

Lot 7 - 9.2

Lot 8 - 9.6

Lot 9 - 10

Lot 10 - 8.8

Lot 11 - 8.6

Lot 12 - . (Missing Data Point)

Lot 13 - 9.3

Lot 14 - 9.2

Lot 15 - 8.9

Lot 16 - 9.0

Lets say the mean is 8.5, which would indicate that all data present is above the mean (Test 2 = 9 consecutive data points above the mean).  The reason for the missing data in this one particular test is due to the lot being rejected.  So any test/process after the lot is rejected, no data will be generated.  However, I am not getting the signal for Test 2 being positive.  I assume this is because of the missing data point.  How can this be changed to ignore the missing data point so that Test 2 is positive for the data?

Thank you,

Jeff S. O.

Super Contributor
Posts: 297

## Re: Proc Shewhart Tests=2 to 4 Not Working with Missing Data Point (SAS 9.2)

Was there a decision made to not post the data value for the rejected lot?

OR

Is there no data value for the rejected lot?

If there is a valid data value, use it. If there isn't a valid data value, you could insert the mean of the lot 11 and lot 13 values and flag it as an estimated value.

wd

Contributor
Posts: 45

## Re: Proc Shewhart Tests=2 to 4 Not Working with Missing Data Point (SAS 9.2)

There was no data generated because this lot was rejected before it reached this process/test.  For the first N processes I have data, but it was rejected and did not continue through the remaining processes (including this one).

Thanks,
Jeff S. O.

Posts: 2,125

## Re: Proc Shewhart Tests=2 to 4 Not Working with Missing Data Point (SAS 9.2)

Since the lot was rejected (and therefore you know WHY the data are missing), you could remove it from your data stream [e.g. DATA=xxx(WHERE=(assay>.)) ].

I am a bit concerned about the suggestion to impute some sort of a 'mean' (the mean of before and after is a variation on 'last observation carried forward').  There is a substantial literature about the potential biases that might cause due to the hidden assumptions involved.

Super Contributor
Posts: 297

## Re: Proc Shewhart Tests=2 to 4 Not Working with Missing Data Point (SAS 9.2)

Doc, I agree with your concern about an estimated value in this case where the lot never made it to the test station - and dropping the failed lot out of the equation. If it was strictly a bad test result because of a testing problem and all of the production parameters were in statistical control, an estimate may be valid, if noted as such. After all, an in statistical control process should produce in statistical control test results - testing is just a confirmation.

PROC Star
Posts: 1,460

## Re: Proc Shewhart Tests=2 to 4 Not Working with Missing Data Point (SAS 9.2)

Hi,

I don't see any easy option for this.  I would consider:

• Adding a where statement to the proc that would result exclude this lot: where not missing (Y)
• See SHEWART manual section "customizing tests with data step programs"  (looks like you output data, then make your own test results, and feed that back into shewhart)
• Make your own custom chart (using ODS graphics or whatever).  Use shewhart to compute the limits and whatever else you want, output those to data, write your own code for Westgard rules, and then generate you own custom chart.

Those may be in ascending order of effort (I've never tried second option).  The benefit of the last is that if you need a customized chart, you can make it be whatever you want.

But reasonable to wish that there was an option to ignore missing values when applying Westgard rules.  So if you submit that as an idea here, I'll vote for it.

--Q.

Discussion stats
• 5 replies
• 315 views
• 1 like
• 4 in conversation