Dear community, I have trouble when I try to write code for rolling window regression for a company. I need to get the estimate for each company within a rolling window of 60-month. I searched for the belowing solution, but it ignores different companies. For example, the last observations of first company A will be computed into the second company B. What I NEED is for each company, the rolling window regression is computed from the beginning. Could you please help me to solve this issue, I need improvement for the code. Let the code tell different company when it goes through the rolling window. Best regards!!!!!!!!!!!! DATA rwin / view=rwin; ws = 60; nwin = nrecs - ws +1; do w=1 to nwin; do p=w to w + ws -1; set part1 point=p nobs=nrecs; output; end; end; run;
... View more