You can calculated the difference between a value from the current onservation and the value of a previous observation using the DIF or LAG functions. To format a percentage value you can make use of the PUT function together with the PERCENT. format. The CAT... family of functions allow you to concatenate char values together. Find below a sample program that illustrates the use of these functions. This should help you to get the desired result.
data ds1;
input year $ mid $ resp exp rev;
datalines;
s_700 d_2016 0.83 0.83 0.47
s_700 d_2015 0.43 0.83 0.47
;
proc sort data=ds1;
by year mid;
run;
data want;
set ds1;
diff_resp = dif1(resp);
length text $ 256;
text = catx(" "
, put(resp, percent9.)
, "of total of score with 700 or greater, up"
, diff_resp * 100
, "BPS compared to last year"
);
run;
Bruno
... View more