Thank you Allin for the code. After running the code the output looks like
this now:
gretl version 1.8.7
Current session: 2010-03-11 21:09
? scalar numofunits = max($unit)
Generated scalar numofunits = 612
? matrix betas = {}
Generated matrix betas
? loop for i=1..numofunits
smpl $unit=i --restrict
ols Aktie const Leitregion CDAX --quiet
b1 = $coeff[2]
b2 = $coeff[3]
betas |= { b1, b2 }
smpl full
endloop
loop: i = 1
? smpl $unit=i --restrict
Full data set: 110160 observations
Current sample: 180 observations
? ols Aktie const Leitregion CDAX --quiet
? b1 = $coeff[2]
? b2 = $coeff[3]
? betas |= { b1, b2 }
? smpl --full
Full data range: 1:001 - 612:180 (n = 110160)
loop: i = 2
...
loop: i = 16
? smpl $unit=i --restrict
Full data set: 110160 observations
Current sample: 180 observations
? ols Aktie const Leitregion CDAX --quiet
Missing values encountered
> ols Aktie const Leitregion CDAX --quiet
Unfortunately it stops here and I don't know why. Is it a problem with
missing values? Does Gretl has to know somehow how to work with missing
values?
-----Ursprüngliche Nachricht-----
Von: gretl-users-bounces(a)lists.wfu.edu
[mailto:gretl-users-bounces@lists.wfu.edu] Im Auftrag von Allin Cottrell
Gesendet: Donnerstag, 11. März 2010 16:24
An: Gretl list
Betreff: Re: [Gretl-users] Panel Data, print out estimated betas
On Wed, 10 Mar 2010, [iso-8859-1] Peter Blömeke wrote:
Ok, regressions are working perfectly now but gretl prints out a
complete regression-output for each model and stops at i = 16
instead of 612.
Here's a tested example of doing the sort of thing you want,
as interpreted by Sven. I'm using one of the panel datasets
supplied with gretl which has 6 cross-sectional units. The script
runs two regressions for each unit and stores the slope
coefficients, producing a 6 x 2 matrix once all is done.
<script>
open greene14_1.gdt
logs C Q PF
scalar numofunits = max($unit)
matrix betas = {}
loop for i=1..numofunits
smpl $unit=i --restrict
ols l_C 0 l_Q --quiet
b1 = $coeff[2]
ols l_C 0 l_PF --quiet
b2 = $coeff[2]
betas |= { b1, b2 }
smpl full
endloop
print betas
</script>
Allin Cottrell
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users