Panel Partial accumulation for each unit
-
vtsa
- Posts: 19
- Joined: Thu Oct 10, 2013 7:25 am
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 938 times
-
TomDoan
- Posts: 7825
- Joined: Wed Nov 01, 2006 4:36 pm
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)-
vtsa
- Posts: 19
- Joined: Thu Oct 10, 2013 7:25 am
Re: Panel Partial accumulation for each unit
Thank You very much! 