Page 1 of 1

Store and apply coefficients

Posted: Tue Jul 09, 2019 3:57 am
by fi99ggb
Hello

I am looking for a quick way to do the following and wondering whether you have any tips:

1. estimate equation (OLS regression): Y1 = a1 + b1*x1 + c1*z1
2. Store coefficient values b1 and c1
3. Estimate restricted OLS: Y2 = a2 + b1*x2 + c1*z2 (only a2 is estimated, b1 and c1 are taken from the first equation)

Step one is standard; step 3 is easy to do manually. I was wondering whether there is an easy way to programmatically pick up b1 and c1 from step 1 and plug them in the equation in step 3.

Thanks
George

Re: Store and apply coefficients

Posted: Tue Jul 09, 2019 7:26 am
by EViews Gareth

Code: Select all

equation eq1.ls y1 c x1 z1 equation eq2.ls (y2-eq1.@coef(1)*x2-eq1.@coef(1)*z2) c

Re: Store and apply coefficients

Posted: Tue Jul 09, 2019 9:59 am
by fi99ggb
Beautiful. Thank you.