[Gretl-devel] remove unsignificant variables
Allin Cottrell
cottrell at wfu.edu
Wed Jan 9 10:26:16 EST 2008
On Wed, 9 Jan 2008, Ignacio Diaz-Emparanza wrote:
> I am trying to write a script that, based on a regression with a
> lot of variables and lags, drop unsignificant variables and
> leave only the significant regressors...
Funny you should ask... I've just finished adding documentation
("help omit") and a GUI handle for the newish --auto option to the
omit command.
ols y 0 xlist
omit --auto
sequentially omits the variable with the highest p-value, stopping
when the highest (two-sided) p-value is less than 0.10. You can
adjust the cutoff p-value in this way:
omit --auto=0.05
The GUI model test item now has an option to do sequential
omission, with a spinner for the p-value to be used.
This is in CVS and the Windows snapshot.
> I am having problems to identify the variable to drop in each
> iteration because gretl sometimes detects "exact" collinearity
> (but not perfect collinearity) and removes one regressor, so
> that the regressors I write in the ols command are not the same
> as gretl uses in the estimation, so it makes difficult to
> associate the coefficients in $coeff with my list of
> regressors...
>
> I think changing the ols source may be some solutions to resolve
> this problem. Gretl after the ols estimation could:
> 1- save the variable with highest t pvalue in a $ variable (for
> example its ID number in a scalar)
> 2- save a list with the regressors used in the estimation (or a
> row matrix with the ID numbers)
I quite like the idea of making available the list of regressors
actually used, after estimation. I'll think about how that might
be done.
Allin.
More information about the Gretl-devel
mailing list