Dear all, I am working with panel data and I want to run a loop with time
dummies. Unfortunately, I encounter a problem when trying to do so. loop i=1..4
# this loop needs to be performed 4 times genr k=($i*12)
genr Z=k-11
matrix Big=zeros(25,14)
list R= dt_$Z..dt_$k scalar j=0
loop foreach x R
smpl $x --dummy Here is the first part of my script where things go
wrong. I need to make the list R 4 times. First with dt_1 to dt_12, in the
second loop from dt_13 to dt_24 and so.After running this script Gretl returns
the error value: ? list R= dt_$Z..dt_$k
The symbol 'dt_' is undefined
>> list R= dt_$Z..dt_$k When I run the following script I get the right values
>> for k and Z but they have 6decimal digits (0's) (for instance Z=1,000000
>> instead of 1):loop i=1..4 # this loop needs to be performed 4 times genr
>> k=($i*12)
genr Z=k-11
print k Zendloop Therefore I assume that the problem is that Gretl does not
recognize dt_1,000000. I tried to use the function int() and round() to get rid
off those decimal digits but these functions did not help. Is there any other
solution to get rid off the decimal digits so that Gretl gets as input dt_$Z =
dt_1 instead of dt_1,000000? Many thanks in advance. Best regards, Kevin
Vermeiren
|
Dear all,
I am working with panel data and I want to run a loop with time dummies. Unfortunately, I encounter a problem when trying to do so. loop i=1..4 # this loop needs to be performed 4 times genr k=($i*12) genr Z=k-11 matrix Big=zeros(25,14) list R= dt_$Z..dt_$k scalar j=0 loop foreach x R smpl $x --dummy Here is the first part of my script where things go wrong. I need to make the list R 4 times. First with dt_1 to dt_12, in the second loop from dt_13 to dt_24 and so. After running this script Gretl returns the error value: ? list R= dt_$Z..dt_$k The symbol 'dt_' is undefined >> list R= dt_$Z..dt_$k When I run the following script I get the right values for k and Z but they have 6decimal digits (0's) (for instance Z=1,000000 instead of 1): loop i=1..4 # this loop needs to be performed 4 times genr k=($i*12) genr Z=k-11 print k Z endloop Therefore I assume that the problem is that Gretl does not recognize dt_1,000000. I tried to use the function int() and round() to get rid off those decimal digits but these functions did not help. Is there any other solution to get rid off the decimal digits so that Gretl gets as input dt_$Z = dt_1 instead of dt_1,000000? Many thanks in advance. Best regards, Kevin Vermeiren |
