'Artur
perhaps I was not clear. Sometimes observations on say Y may be updated or revised. That means after I change those in Gretl any transformation such as ln Y  or difference Y  that I may have created before the update will still use the original Y data as they do not update automatically. When I try to delete these variables, because they have been used in the session, Gretl will not allow me delete them in order to re-create them using the updated Y.

I have figured a workaround which is to define a variable  YNEW=Y  and then create the transforms needed using YNew. But that is not very elegant!
Brian

On Wed, 23 Dec 2020 at 12:07, Artur Tarassow <atecon@posteo.de> wrote:
Am 23.12.20 um 12:00 schrieb Brian Revell:
> Is there any way to update variables that are functions of another, if
> the original variable Y has been amended or updated . The former is
> straightforward to edit Y's values. But I am not clear that for
> example, l-Y  is automatically recalculated. And if  l-Y  has already
> been used in a session, Gretl will not let it be deleted giving the
> error message cannot be deleted variable in use..
> Suggestions around this issue welcomed

Hi Brian,

Nothing gets automatically re-computed -- which is good. If you want to
re-compute anything, you should make use of a function which needs to be
called each time you have new/ different input variables. See the
following example.

With rehard to your second point: Could you give an example please?

<hansl>
scalar X = 4
scalar Y = 3
scalar Z = X - Y
print X Y Z

# changes in Y do not affect previously assigned Z
scalar Y = 2
print X Y Z

# Make use of a function for 'updating' Z
function scalar compute_z (scalar X, scalar Y)
     return X - Y
end function

scalar Y = 3
eval compute_z(X, Y)
scalar Y = 2
eval compute_z(X, Y)
</hansl>


Artur
_______________________________________________
Gretl-users mailing list -- gretl-users@gretlml.univpm.it
To unsubscribe send an email to gretl-users-leave@gretlml.univpm.it
Website: https://gretlml.univpm.it/postorius/lists/gretl-users.gretlml.univpm.it/