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

Riccardo (Jack) Lucchetti r.lucchetti at univpm.it
Mon Jun 29 19:33:30 EDT 2009


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


More information about the Gretl-users mailing list