Page 1 of 1

Panel Partial accumulation for each unit

Posted: Wed Jan 29, 2025 8:42 am
by vtsa
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.
PNARDL.rpf
(1007 Bytes) Downloaded 559 times

Re: Panel Partial accumulation for each unit

Posted: Thu Jan 30, 2025 12:32 pm
by TomDoan
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

Posted: Fri Jan 31, 2025 7:37 am
by vtsa
Thank You very much! :D