I want to create three pfos for each year. my variable using to cut the observation is index1.
i want to use the mean and construct
pfo1: from the lowest number to mean - 1 std dev.
pfo 2: mean - 1 std dev to mean - 1 std dev.
pfo 3: mean + 1 std dev to highest number
for each year.
i know how to obtain 1st and 99th percentile of the observations of each year
proc univariate data=pfo.merged_A1 noprint; var index1; by pfoyr;
output out=mean pctlpts=1 99 pctlpre=p; run;
i feel like i have to use something in that sort....
Many thx,
aaron
If you are okay with proc sql then you can try something like
proc sql;
create table want as
select pfoyr,min(index1) - std(index1) as profile1,
avg(index1) - std(index1) as profile2,
avg(index1) + std(index1) as profile3
from pfo.merged_A1
group by pfoyr;
quit;
If I understood what you mean.
data class; set sashelp.class; run; proc sort data=class;by sex;run; proc summary data=class ; by sex; var weight; output out=stat(drop=_:) mean=mean std=std; run; data want; merge class stat; by sex; select; when(weight(mean+std)) pfo=3; otherwise pfo=2; end; run;
Xia Keshan
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.