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!
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
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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.