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.

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!

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.

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