[Gretl-users] abs: where is the problem?

artur.tarasow artur.tarassow at googlemail.com
Mon Jun 29 19:45:49 EDT 2009


Riccardo (Jack) Lucchetti schrieb:
> On Tue, 30 Jun 2009, artur.tarasow wrote:
>
>> Hello,
>>
>> I tried to program a little request which looks like:
>>
>> script:
>> loop foreach i x y
>>   ols $i const time --quiet
>>   genr t_$i = $coeff(time)/$stderr(time)
>>   if t_$i < abs(1.97)
>>       adf 8 $i --c --test-down
>>  else
>>       adf 8 $i --ct --test-down
>>   endif
>> endloop
>> :end script
>>
>> I define the request of the t-values as absolute values ( abs(1.97) ) 
>> but gretl does not consider this for negative ones. Though the 
>> t-value is e.g. -3.37 it does not take into account that the absolute 
>> value is bigger than 1.97. For positive t-values there is no problem.
>>
>> Do you know what the problem is?
>
> Surely you mean
>
>     if abs(t_$i) < 1.97
>
> no?
>
> Riccardo (Jack) Lucchetti
> Dipartimento di Economia
> Università Politecnica delle Marche
>
> r.lucchetti at univpm.it
> http://www.econ.univpm.it/lucchetti
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users at lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
Yes, you are right. I was trying and trying everything. Now it works - 
thanks for that!

Artur



More information about the Gretl-users mailing list