dear all
i have to compute average of a variable in panel data set on rolling basis.
Earlier, i used the following commond to compute rolling standard deviation as suggested by the members in this community and it worked well.
roc sql;
create table want as
select *,
(select std(sales) from have
where Company_Name=a.Company_Name
and a.year-5 le year le a.year)
as stddev format=8.2
from have as a;
quit;
please let me know, what changes i have to do to compute rolling average for the same dataset.
thanks in advance