BookmarkSubscribeRSS Feed
Andy
Calcite | Level 5
Hi,

When using Proc Univariate to pick out percentiles is there any way to not specify the percentiles by putting in a number but instead putting in a variable name that contains the number of the percentile I'm trying to find? Here's a what I mean in code

I want to say this

proc univariate data=test normal plot;
by t j;
where replicate le 2000 & t=1;
var y10;
output out=work.BCT1_95lower_y10 pctlpts= lowerlimit_y10
pctlpre=y10;
run;


but this doesn't work the pctlpts option appears to only work if you specify the number....

please help....
Thanks
3 REPLIES 3
mftuchman
Quartz | Level 8
In essence, what I'm hearing you say is that you want a different percentile point for each BY group, and the particular percentile is stored in the variable y10.

Am I reading this correctly?
Andy
Calcite | Level 5
yeah but the the different percentile points are stored in the variable lowerlimit_y10
mftuchman
Quartz | Level 8
You may be better off with a PROC RANK - rank your variable, then do a second pass with a data step using the same BY groups to subtract the percentile rank from the value of lower_limit. Then OUTPUT the first observation greater than the value in y10_lowerlimit.

Or something like that. Obviously, you're closer to the situation than I am so I cannot make a definitive statement.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 1633 views
  • 0 likes
  • 2 in conversation