09-11-2014 02:24 PM
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....
09-11-2014 02:53 PM
If you are okay with proc sql then you can try something like
create table want as
select pfoyr,min(index1) - std(index1) as profile1,
avg(index1) - std(index1) as profile2,
avg(index1) + std(index1) as profile3
group by pfoyr;
09-12-2014 09:49 AM
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;