Help using Base SAS procedures

Proc Univariate pctlpts?????

Reply
New Contributor
Posts: 2

Proc Univariate pctlpts?????

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
Contributor
Posts: 43

Re: Proc Univariate pctlpts?????

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?
New Contributor
Posts: 2

Re: Proc Univariate pctlpts?????

Posted in reply to mftuchman
yeah but the the different percentile points are stored in the variable lowerlimit_y10
Contributor
Posts: 43

Re: Proc Univariate pctlpts?????

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.
Ask a Question
Discussion stats
  • 3 replies
  • 247 views
  • 0 likes
  • 2 in conversation