Can someone please edit the code below in order to create a 99.9% confidence interval? Thanks!
Code
proc univariate data=all ;
by final_check;
var test;
output out=aaa pctlpts=0.05, 99.95 pctlpre=ci;
run;
Q: Should the two percentiles be 0.05 and 99.95 as the difference would create a 99.9% confidence interval (99.95-0.05)?
From the documentation:
PCTLPTS=percentiles
specifies one or more percentiles that are not automatically computed by the UNIVARIATE procedure.
If you want other than a 95% confidence interval or limits you need to set the PROC Univariate ALPHA= option to something other than the default 0.05. Alpha = 0.01 would create a 99% confidence limit and Alpha=0.001 would create 99.9% limits.
Percentiles are not affected by Alpha.
Thanks for your reply! If I want to output the lower and upper confidence limits for the 99.9% confidence interval, should the code be
proc univariate data=all Alpha=0.001;
by final_check;
var test;
output out=aaa pctlpts=0.05, 99.95 pctlpre=ci;
run;
You can use the following options in a proc means statement to retrieve confidence interval values:
proc means data=all mean uclm lclm alpha=0.001;
Thanks for your reply! Should the code therefore be
proc means data=all mean uclm lclm alpha=0.001;
by final_check;
var test;
run;
Q: Would the code I posted also technically create a 99.9% confidence interval, as I would like to see the lower and upper confidence limit outputs?
proc univariate data=all ;
by final_check;
var test;
output out=aaa pctlpts=0.05, 99.95 pctlpre=ci;
run;
@jeremy4 wrote:
Can someone please edit the code below in order to create a 99.9% confidence interval? Thanks!
Code
proc univariate data=all ;
by final_check;
var test;
output out=aaa pctlpts=0.05, 99.95 pctlpre=ci;
run;
Q: Should the two percentiles be 0.05 and 99.95 as the difference would create a 99.9% confidence interval (99.95-0.05)?
STOP RIGHT THERE!
Percenitle points are not confidence intervals. Confidence intervals are not percentile points. You can't compute one from the other.
So, what are you really trying to achieve with this analysis?
As pointed out by @ed_sas_member , you can get either confidence intervals from SAS, not via percentiles, but you have to be clear as to what exactly you want.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.