Works well, thanks Allin!!!
Dnia 10-08-2011 o godz. 21:17 Allin Cottrell napisał(a):
On Wed, 10 Aug 2011, mariusz doszyń wrote:
> I'm using loops for i=1..8 and j=1..10 to estimate, lets say, $j$is
> coefficients (s is the name of coefficient). How to make gretl to create
j
> variables with values sji? Or how to create matrix with values of s$j$i
> (where given values will be respectively add to matrix)? When I'm using
> 'series' command I've got values with the last estimate of sji. For
example,
> when I'm using: series s$j$i for j=1 I've got series with 8 values of s18
> (i=8) but I need values s11, s12, s13,...,s18.
If I've got the general idea of what you're trying to do,
here's a template.
<hansl>
nulldata 30
# create some artificial series
loop i=1..8 -q
series y_$i = normal()
endloop
loop j=1..10 -q
series x_$j = normal()
endloop
matrix s = zeros(8, 10)
loop i=1..8 -q
loop j=1..10 -q
# estimate a coefficient and stick into matrix
ols y_$i 0 x_$j -q
s[i,j] = $coeff[2]
endloop
endloop
print s
</hansl>
Allin Cottrell