Help using Base SAS procedures

Proc Shewhart: Reading Limits data into the INSET statement for CPK, CPKLCL, and CPKUCL

Accepted Solution Solved
Reply
Contributor
Posts: 45
Accepted Solution

Proc Shewhart: Reading Limits data into the INSET statement for CPK, CPKLCL, and CPKUCL

[ Edited ]

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.


Accepted Solutions
Solution
‎06-16-2016 08:42 AM
SAS Super FREQ
Posts: 3,475

Re: Proc Shewhart: Reading Limits data into the INSET statement for CPK, CPKLCL, and CPKUCL

You already have the limits in a SAS data set. To get those values to appear in the inset, you can use the DATA step to create an inset data set.  The inset data set contains the variables _LABEL_ and _VALUE_, and you can assign them any values you want. You use the DATA= keyword on the INSET statement to specify the name of the inset data set. This enables you to completely customize the inset to display whatever you want. See the Getting Started Example for the INSET statement.

View solution in original post


All Replies
Solution
‎06-16-2016 08:42 AM
SAS Super FREQ
Posts: 3,475

Re: Proc Shewhart: Reading Limits data into the INSET statement for CPK, CPKLCL, and CPKUCL

You already have the limits in a SAS data set. To get those values to appear in the inset, you can use the DATA step to create an inset data set.  The inset data set contains the variables _LABEL_ and _VALUE_, and you can assign them any values you want. You use the DATA= keyword on the INSET statement to specify the name of the inset data set. This enables you to completely customize the inset to display whatever you want. See the Getting Started Example for the INSET statement.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 197 views
  • 0 likes
  • 2 in conversation