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
perform a regression for each crossid in a panel workfile and store the slopes
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Posts: 3
- Joined: Sat Jan 05, 2019 10:50 pm
-
- EViews Developer
- Posts: 563
- Joined: Thu Apr 25, 2013 7:48 pm
Re: perform a regression for each crossid in a panel workfile and store the slopes
Hello,
You just need to create the auxiliary storage for the betas and then copy them out of the equation objects one at a time.
You just need to create the auxiliary storage for the betas and then copy them out of the equation objects one at a time.
Code: Select all
vector(1200) betas
for !i=1 to 1200
smpl if @crossid=!i
equation linreg{!i}.LS Y C X1 X2
betas(!i) = linreg{!i}.@coefs(2)
next
-
- Posts: 3
- Joined: Sat Jan 05, 2019 10:50 pm
Re: perform a regression for each crossid in a panel workfile and store the slopes
Hi Matt,
thanks for your help
Cheers
thanks for your help
Cheers
Who is online
Users browsing this forum: Majestic-12 [Bot] and 29 guests