Em 10 de dezembro de 2010 Allin Cottrell <cottrell@wfu.edu> escreveu:

On Fri, 10 Dec 2010, Henrique Andrade wrote:

> There's a problem that appears with a considerable frequency here at
> my work: To delete unused variables inside a Gretl session.
>
> Please take a look at the .gretl file attached.
>
> The variables "fora_de_uso", "fora_de_uso2", and "fora_de_uso3" (ID
> numbers: 9, 5, and 18, respectively) cannot be deleted even though
> they are not being used.
>
> Why does this happen?

It happens because if you were to delete those variables this
would result in the re-numbering of several variables that appear
as dependent or as regressors in saved models, which would totally
confuse gretl.

Perhaps the error message should be adjusted in this case: saying
that the variable is "in use" is not quite accurate. But the
substantive point is correct: you really can't delete those series
without destroying your session file.

Dear Allin,

In my humble opinion this behavior doesn't look good. Suppose
the following script:

<script>
open australia.gdt
ldiff PAU PUS E
"Modelo 1" <- ols ld_E const ld_PAU ld_PUS
delete IAU IUS ius2 iau2 e2 lpus lpau
# Now save the results in a Gretl session
</script>

Now suppose you want to share this model with other Gretl
users in a more "clean" way, ie, you want to exclude all the
irrelevant information inside the session (like the variables that
are not in use, saved models, graphs, etc.).

I know we can delete the series before the calculations (log,
ldiff, etc.), but sometimes only after our "job" has finished we
can see which series are useless.

Best,
Henrique