Page 1 of 1

Convert values to numerical values

Posted: Wed Jan 06, 2021 1:02 pm
by Pantera
Hello all,

I have a variable (let's say a variable X) which has negative and positive values. Problem: I want to make a variable Y which is the numerical value of X (all values are positive). I guess it is possible to use the genr-function to do the converting, i.e. Genr Y = ???? -- but how do we do it?

Regards,
T.L.

Re: Convert values to numerical values

Posted: Wed Jan 06, 2021 1:55 pm
by EViews Gareth
Not sure on your terminology - negative numbers are still "numerical".

But perhaps you want the @abs function?

Code: Select all

series Y = @abs(X)

Re: Convert values to numerical values

Posted: Wed Jan 06, 2021 3:32 pm
by Pantera
Thanks Gareth -- problem solved. You understood me correctly. I meant "absolute value" :-)

Regrads,
T.L.