Fixed Effects Vector
Posted: Mon Jun 16, 2014 10:10 am
Hello
I want to save the fixed effects of a panel regression that is estimated in a rolling period fashion. The problem is that the @effects function creates a table that drops some of the cross sections. Due to the fact that I need to assign the values to each cross-section I created a loop that searches the effects vector for the correct cross-section and saves the respective value in a new vector. However, due to the high volume of data I have this takes a lot of time. Is there any other way to do it?
The code is as follows:
for !n=1 to !firms
for !b=1 to equc.@ncross
if @val(@right((effects_p(!b+1,2)),9))=!n then
effects(!n,1)=@val(@right((effects_p(!b+1,2)),9))
effects(!n,2)=@val(@right((effects_p(!b+1,3)),9))
Exitloop
Endif
next
next
I want to save the fixed effects of a panel regression that is estimated in a rolling period fashion. The problem is that the @effects function creates a table that drops some of the cross sections. Due to the fact that I need to assign the values to each cross-section I created a loop that searches the effects vector for the correct cross-section and saves the respective value in a new vector. However, due to the high volume of data I have this takes a lot of time. Is there any other way to do it?
The code is as follows:
for !n=1 to !firms
for !b=1 to equc.@ncross
if @val(@right((effects_p(!b+1,2)),9))=!n then
effects(!n,1)=@val(@right((effects_p(!b+1,2)),9))
effects(!n,2)=@val(@right((effects_p(!b+1,3)),9))
Exitloop
Endif
next
next