BookmarkSubscribeRSS Feed
jeremy4
Quartz | Level 8

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)?

5 REPLIES 5
ballardw
Super User

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.

 

jeremy4
Quartz | Level 8

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;

 

 

 

ed_sas_member
Meteorite | Level 14

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;
jeremy4
Quartz | Level 8

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;

PaigeMiller
Diamond | Level 26

@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.

 

 

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 3101 views
  • 5 likes
  • 4 in conversation