Panel Partial accumulation for each unit
Panel Partial accumulation for each unit
Dear Tom,
I couldn't compute the partial sums of series for each unit in the panel data set. When I run the accumulate instruction, the prog accumulates partial sums for the entire series but not for each cross-section unit. How can I fix it. Please help! Pleae find the prog attached. I will appreciate your responce.
I couldn't compute the partial sums of series for each unit in the panel data set. When I run the accumulate instruction, the prog accumulates partial sums for the entire series but not for each cross-section unit. How can I fix it. Please help! Pleae find the prog attached. I will appreciate your responce.
- Attachments
-
- Data.xlsx
- (41.71 KiB) Downloaded 518 times
Re: Panel Partial accumulation for each unit
This will do the same thing as ACCUMULATE within each panel individual.
Code: Select all
dec real total
set ly_p 1//1992:1 6//2023:1 = total=%if(%indiv(t)<>%indiv(t-1),0.0,total),$
%if(%valid(dly_p),total=total+dly_p,%na)Re: Panel Partial accumulation for each unit
Thank You very much! 