BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kimberley
Calcite | Level 5

Hi,

I am creating control charts using Proc Shewart. I created a data set containing limits.

When these limits are being applied to my data, they vary because the sample size varies.  I would like my limits to not vary according to sample size, just to take the Process mean and the standard deviation specified in the limits table to create the limits. Stability in the limits will make it easier for our operators to interpret.

I think there should be an easy way to do this, but I don't know what it is!

Thank you!

Kim

1 ACCEPTED SOLUTION

Accepted Solutions
blchri
SAS Employee

Hi Kimberley,

Could you post a code snippet of what you're trying to do?  There are many different charts which can be produced by proc shewhart, and they have different default behavior for control limits based upon the underlying statistical assumptions.  I see the "xsxhart" tag- is that really the "xschart" statement?

In the SAS/QC user's guide, there are a couple examples in the "xschart" section showing control charts with fixed limits.

title 'Mean and Standard Deviation Charts for Power Output';

proc shewhart data=Turbine;

xschart KWatts*Day ;

run;

If you wish to set your own limits, such as when you have limits created on an initial set of data, and wish to apply them to a new set of data, the the answer is to use the "LIMITS=" option to the PROC SHEWHART statement

http://support.sas.com/documentation/cdl/en/qcug/63964/HTML/default/viewer.htm#qcug_shewhart_a000000...

This option will read in a dataset produced by a previous run of the procedure.  Here is an example for a p-chart:

http://support.sas.com/documentation/cdl/en/qcug/63964/HTML/default/viewer.htm#qcug_shewhart_a000000...

First, generate the dataset with the limits you want using the OUTLIMITS dataset.

This example uses the pchart statement, but it should be almost identical for the xschart statement if that's what you're using.

title 'Proportion of Circuit Failures';

proc shewhart data=CircOne;

  pchart Fail*Batch / subgroupn = 500

  outindex = 'Trial Limits'

  outlimits = Faillim1

  odstitle = title;

run;

Then read that data set, "Faillim1", in when running PROC SHEWHART the next time.  (see the documentation for a more complicated version)

title 'p Chart with Revised Limits for Failed Circuits';

proc shewhart data=CircOne limits=Faillims1;

  pchart Fail*Batch / subgroupn = 500

  readindex = 'Revised Limits'

  vref = 0.0156 0.032226

  vreflabels = ('Trial P' 'Trial UCL')

  vreflabpos = 3

  odstitle = title

  nolegend;

  label Fail = 'Fraction Failed'

  Batch = 'Batch Index';

run;

ods graphics off;

Let me know if this helps, but it sounds like you might have figured it out.  Please post any code if you have any specific issues you'd like help with.

View solution in original post

2 REPLIES 2
Kimberley
Calcite | Level 5

I found my own answer I think.  I am using the LIMITN=n option, which I will set for my average sample size, unless someone has a better idea! feedback appreciated, Thanks!

blchri
SAS Employee

Hi Kimberley,

Could you post a code snippet of what you're trying to do?  There are many different charts which can be produced by proc shewhart, and they have different default behavior for control limits based upon the underlying statistical assumptions.  I see the "xsxhart" tag- is that really the "xschart" statement?

In the SAS/QC user's guide, there are a couple examples in the "xschart" section showing control charts with fixed limits.

title 'Mean and Standard Deviation Charts for Power Output';

proc shewhart data=Turbine;

xschart KWatts*Day ;

run;

If you wish to set your own limits, such as when you have limits created on an initial set of data, and wish to apply them to a new set of data, the the answer is to use the "LIMITS=" option to the PROC SHEWHART statement

http://support.sas.com/documentation/cdl/en/qcug/63964/HTML/default/viewer.htm#qcug_shewhart_a000000...

This option will read in a dataset produced by a previous run of the procedure.  Here is an example for a p-chart:

http://support.sas.com/documentation/cdl/en/qcug/63964/HTML/default/viewer.htm#qcug_shewhart_a000000...

First, generate the dataset with the limits you want using the OUTLIMITS dataset.

This example uses the pchart statement, but it should be almost identical for the xschart statement if that's what you're using.

title 'Proportion of Circuit Failures';

proc shewhart data=CircOne;

  pchart Fail*Batch / subgroupn = 500

  outindex = 'Trial Limits'

  outlimits = Faillim1

  odstitle = title;

run;

Then read that data set, "Faillim1", in when running PROC SHEWHART the next time.  (see the documentation for a more complicated version)

title 'p Chart with Revised Limits for Failed Circuits';

proc shewhart data=CircOne limits=Faillims1;

  pchart Fail*Batch / subgroupn = 500

  readindex = 'Revised Limits'

  vref = 0.0156 0.032226

  vreflabels = ('Trial P' 'Trial UCL')

  vreflabpos = 3

  odstitle = title

  nolegend;

  label Fail = 'Fraction Failed'

  Batch = 'Batch Index';

run;

ods graphics off;

Let me know if this helps, but it sounds like you might have figured it out.  Please post any code if you have any specific issues you'd like help with.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1589 views
  • 3 likes
  • 2 in conversation