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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 5 replies
  • 2763 views
  • 5 likes
  • 4 in conversation