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

I am using a macro to go through a list of parameters to do proc capability for each single parameter. 

In  "inset" step I am getting some statistical results, including ppk and cpk calculation. The simple version of the code is as follow:

 

 

ods trace on;
%if .... %then %do; ods select histogram; proc capability data=have; specs lsl=&lsl; var result; histogram / normal(indices) WEIBULL(indices)Gamma(indices) Lognormal(indices); by par1 par2; inset mean std cv n ppk="Ppk" normal(ESTPCTLSS) WEIBULL(CPK) WEIBULL(ESTPCTLSS) Gamma(CPK) Gamma(ESTPCTGTR)lognormal(CPK) lognormal(ESTPCTGTR) normal(ksdpval) WEIBULL(ksdpval)/ cfill=white pos=nw; run; quit; %end;

Running the code I have a nice graph with a legend next to that which shows mean, std, ..., and CPK calculated based on different distributions (normal, weibull, etc.)

 

 

My question:

What I want to do is to get a SAS table that includes all the CPK. so as an example I want to have a table that has two columns  that these columns are coming from that inset step that I have in proc capability step

 

col1            col2
normal ppk yyy weibull cpk xxx gamma cpk zzz

 

What I did so far was trying to use

ods trace on;

which I was not successful to get the result.

Any help is much appreciated! 

 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello,

Can you live with below solution?

The capability indices are in work.FitIndices!

data Amps;
   label Decibels = 'Amplification in Decibels (dB)';
   input Decibels @@;
   datalines;
4.54 4.87 4.66 4.90 4.68 5.22 4.43 5.14 3.07 4.22
5.09 3.41 5.75 5.16 3.96 5.37 5.70 4.11 4.83 4.51
4.57 4.16 5.73 3.64 5.48 4.95 4.57 4.46 4.75 5.38
5.19 4.35 4.98 4.87 3.53 4.46 4.57 4.69 5.27 4.67
5.03 4.50 5.35 4.55 4.05 6.63 5.32 5.24 5.73 5.08
5.07 5.42 5.05 5.70 4.79 4.34 5.06 4.64 4.82 3.24
4.79 4.46 3.84 5.05 5.46 4.64 6.13 4.31 4.81 4.98
4.95 5.57 4.11 4.15 5.95
;

*ods select histogram;
ods graphics on;
ods trace on;
title 'Boosting Power of Telephone Amplifiers';
ods output FitIndices=work.FitIndices;
proc capability data=Amps;
   specs  target = 5 lsl = 4 usl = 6;
   var Decibels;
 histogram / normal(indices) WEIBULL(indices) Gamma(indices) Lognormal(indices);
 inset mean std cv n ppk="Ppk" 
       normal(ESTPCTLSS) WEIBULL(CPK) WEIBULL(ESTPCTLSS) Gamma(CPK) Gamma(ESTPCTGTR)
lognormal(CPK) lognormal(ESTPCTGTR) normal(ksdpval) WEIBULL(ksdpval) / cfill=white pos=nw; run; quit; /* end of program */

Kind regards,

Koen

View solution in original post

2 REPLIES 2
Reeza
Super User
ODS TRACE just tells you the table/output names. You need to figure out which one it is and then capture it via ODS OUTPUT.
Since we don't have your data and can't run the code, posting that may be at least helpful. Since this is still using SAS/GRAPH not sure how much of this approach is possible with this procedure......
sbxkoenk
SAS Super FREQ

Hello,

Can you live with below solution?

The capability indices are in work.FitIndices!

data Amps;
   label Decibels = 'Amplification in Decibels (dB)';
   input Decibels @@;
   datalines;
4.54 4.87 4.66 4.90 4.68 5.22 4.43 5.14 3.07 4.22
5.09 3.41 5.75 5.16 3.96 5.37 5.70 4.11 4.83 4.51
4.57 4.16 5.73 3.64 5.48 4.95 4.57 4.46 4.75 5.38
5.19 4.35 4.98 4.87 3.53 4.46 4.57 4.69 5.27 4.67
5.03 4.50 5.35 4.55 4.05 6.63 5.32 5.24 5.73 5.08
5.07 5.42 5.05 5.70 4.79 4.34 5.06 4.64 4.82 3.24
4.79 4.46 3.84 5.05 5.46 4.64 6.13 4.31 4.81 4.98
4.95 5.57 4.11 4.15 5.95
;

*ods select histogram;
ods graphics on;
ods trace on;
title 'Boosting Power of Telephone Amplifiers';
ods output FitIndices=work.FitIndices;
proc capability data=Amps;
   specs  target = 5 lsl = 4 usl = 6;
   var Decibels;
 histogram / normal(indices) WEIBULL(indices) Gamma(indices) Lognormal(indices);
 inset mean std cv n ppk="Ppk" 
       normal(ESTPCTLSS) WEIBULL(CPK) WEIBULL(ESTPCTLSS) Gamma(CPK) Gamma(ESTPCTGTR)
lognormal(CPK) lognormal(ESTPCTGTR) normal(ksdpval) WEIBULL(ksdpval) / cfill=white pos=nw; run; quit; /* end of program */

Kind regards,

Koen

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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