perform a regression for each crossid in a panel workfile and store the slopes
Posted: Mon Jan 07, 2019 2:22 pm
Hi there,
I have a panel data with a 1200 cross section id with around 40 time series observations.
I need to run each crossid and obtain the "beta"
I know that this code is working properly.
for !i=1 to 1200
smpl if @crossid=!i
equation linreg{!i}.LS Y C X1 X2
next
however, it is not easy to store the "beta for X1 for 1200 regression by hand, I wonder if anyone can help me to create a new variable that contains all beta"s as a 1200*1 matrix
Cheers
I have a panel data with a 1200 cross section id with around 40 time series observations.
I need to run each crossid and obtain the "beta"
I know that this code is working properly.
for !i=1 to 1200
smpl if @crossid=!i
equation linreg{!i}.LS Y C X1 X2
next
however, it is not easy to store the "beta for X1 for 1200 regression by hand, I wonder if anyone can help me to create a new variable that contains all beta"s as a 1200*1 matrix
Cheers