Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- SAS Procedures
- /
- Proc Shewhart: Reading Limits data into the INSET statement for CPK, ...

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 06-15-2016 02:11 PM
(857 views)

Hello,

I am having an issue with my proc shewhart INSET values for CPK, CPKLCL, and CPKUCL. What I am doing is I have a set of data, for example n=60, and with this data I need to split the chart where a shift in the process/mean takes place. Such as there was a shift after data point 29, and starting with data point 30 I would want to calculated new control limits and capability estimates. I have no problems showing the shifts in the charts and calculating the new control limits for each range of data using the _PHASE_ and _INDEX_ options. Control limit and mean wise, everything looks great in the chart and aligns with the stats data set corresponding to the correct range of data. However, the Capability estimates, which I want based just on the last phase of data, are not matching to the limits. The current code I have has been provided below to help clear up the picture. The data is simple height versus observation number.

data physical;

set physical;

length _PHASE_ $2.;

if obs < 25 then _PHASE_ = 'A';

if obs >= 25 then _PHASE_ = 'B';

run;

(Phases created to determine with range of data gets which set of limits)

proc shewhart data=physical;

where obs < 25;

irchart Height*obs='*' / nochart2 totpanels=1 ciindices lsl=60 usl=80 outlimits=stats2;

inset stddev cpklcl='Cpk 95% Lower' cpk='Cpk' cpkucl='Cpk 95% Upper' / pos=nw format=6.2;

run;

(Creating the Stats2 data set to contain the limits for datapoints 1 through 24, or _PHASE_ 'A')

data stats2;

set stats2;

length _INDEX_ $2.;

_INDEX_ = 'A';

run;

(adding the _INDEX_ variable to match the limits dataset with the range of data that contains the corresponding _PHASE_ 'A')

proc shewhart data=physical;

where obs >= 25;

irchart Height*obs='*' / nochart2 totpanels=1 ciindices lsl=60 usl=80 outlimits=stats3;

inset stddev cpklcl='Cpk 95% Lower' cpk='Cpk' cpkucl='Cpk 95% Upper' / pos=nw format=6.2;

run;

(Creating the Stats3 data set to contain the limits for datapoints 25 through last data point, or _PHASE_ 'B')

data stats3;

set stats3;

length _INDEX_ $2.;

_INDEX_ = 'B';

run;

(adding the _INDEX_ variable to match the limits dataset with the range of data that contains the corresponding _PHASE_ 'B')

data stats;

set stats2 stats3;

run;

(stacking data sets stats2 and stats3 into one data set to be read into proc shewhart)

proc shewhart data=physical limits=stats;

irchart Height*obs='*' / nochart2 totpanels=1 ciindices lsl=60 usl=80 readindexes=all phaselegend;

inset stddev cpklcl='Cpk 95% Lower' cpk='Cpk' cpkucl='Cpk 95% Upper' / pos=nw format=6.2;

run;

(Here is the proc shewhart procedure in which I have the phases with their respective limits; however, the capability indices are not from stats3 - Which leads me to my question of how do I get the INSET statement to read the data directly from the stats for _PHASE_ B)

If I just run proc shewhart with obs >= 25, i get the correct capability information, but in the above procedure, it does not give me these sames estimates.

Any help is greatly appreciated.

Thank you,

Jeff S. O.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

1 REPLY 1

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

**If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. **

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.