Page 1 of 1
coefficient covariance matrix change to WHITE
Posted: Tue Jun 15, 2010 12:58 am
by wuruonan
Hey Guys
I need your help!!
I have run over 1000 regressions with coefficient covariance matrix under "estimation default", I can change each equation to "white" one by one
but I would like to use a programme which can choose all the equations and allow me to change all the equation to "white"
I just start learning programming, I have the the following programme which will allow me to put selection names, but I don't know how to define and select all the equations, the next part will allow me to choose white for the equation, but I don't have the middle part, would you able to help me on how to select all the equations, thank you sososososo much!!!
%eqname = "e*"
scalar ret = @uiedit(%eqname, "Enter a list of equations, use * to select all equations")
!choice = 2
!doDF = 1
%list = "Default White HAC"
scalar ret = @uidialog("caption", "Covariance Options", "list", !choice, "Covariance method", %list, "check", !doDF, "DF-adjust")
In the pic, I want to select all the fr_ equations and change to White heteroskedasticity-consistent standard errors & covariance, currenly all under esimation default.
Re: coefficient covariance matrix change to WHITE
Posted: Tue Jun 15, 2010 8:16 am
by EViews Gareth
At the end of your current program you will have a list of potential equation names in the variable %eqnames. You can then loop through those equations and re-estimate them one at a time with White standard errors:
Code: Select all
if @instr(%eqnames,*) then
%eqnames = @wlookup(%eqnames,"Equation") 'this code handles the wildcard in %eqnames
endif
for !i=1 to @wcount(%eqnames) 'now we loop through the equations
%currenteq = @word(%eqnames) 'get the name of the current equation
{%currenteq}.ls(cov=white) 're-estimate current equation
next
You can look up the LS proc in the Equation section of the Object Reference to find other estimation options.
Re: coefficient covariance matrix change to WHITE
Posted: Wed Jun 16, 2010 12:02 am
by wuruonan
sorry to bother you again, in this case, if I run programme like this
---------------------------------------------------------------------------------------------------------------
%eqname = "e*"
scalar ret = @uiedit(%eqname, "Enter a list of equations, use * to select all equations")
if @instr(%eqnames,*) then
%eqnames = @wlookup(%eqnames,"Equation")
endif
for !i=1 to @wcount(%eqname)
%currenteq = @word(%eqname)
{%currenteq}.ls(cov=white)
next
--------------------------------------------------------------------------------------------------------------------
I will be able to select all the equations I needed and once I have selected, all the euqations will re-estimate under white, right?
when I'm running the programme, it comes as error
error message
syntax error in "if @instr("",*)then"
I'm not very sure which one do I need to change, please advice, thank you very much for your help...
Re: coefficient covariance matrix change to WHITE
Posted: Wed Jun 16, 2010 8:13 am
by EViews Gareth
sorry, my mistake.
It should be @instr(%eqnames,"*")
Re: coefficient covariance matrix change to WHITE
Posted: Wed Jun 16, 2010 9:36 pm
by wuruonan
Hi Gareth
sorry to bother you again,
if I apply this programme
----------------------------------------------------------------------------------------------------------
%eqnames = "e*"
scalar ret = @uiedit(%eqnames, "Enter a list of equations, use * to select all equations")
if @instr(%eqnames,"*") then
%eqnames = @wlookup(%eqnames,"Equation")
endif
for !i=1 to @wcount(%eqnames)
%currenteq = @word(%eqnames)
{%currenteq}.ls(cov=white)
next
-----------------------------------------------------------------------------------------------------------
just there is another error message
incorrect number of arguments in %currenteq = @word("fr*")"
I try to change the programme, but still can't get the white test, please advice on the attached file, if I can change all the euquations to white test and change back by the programme. thank you so so so much.
Re: coefficient covariance matrix change to WHITE
Posted: Wed Jun 16, 2010 10:42 pm
by EViews Gareth
%currenteq = @word(%eqnames,!i)
Re: coefficient covariance matrix change to WHITE
Posted: Thu Jun 17, 2010 12:58 am
by wuruonan
thank you very much for your great help, just last question
when I run the programme with below code
--------------------------------------------------------
%eqnames = "e*"
scalar ret = @uidialog("edit",%eqnames,"Enter a list of equation names", "text"," (use * as a wildcard)")
if @instr(%eqnames,"*") then
%eqnames = @wlookup(%eqnames,"Equation")
endif
for !i=1 to @wcount(%eqnames)
%currenteq = @word(%eqnames,!i)
{%currenteq}.ls(cov=white)
next
-------------------------------------------------------
it automatically exsit from Eviews7, once I re enter into the workfile, nothing has been done or changed, I don't know if it is any other problem there
would you able to have a test with the above france.wf1 ? see if it is the same problem.
also if I want to change all the euqations back to default or HAC estimate in the future checking, shall I just change this line {%currenteq}.ls(cov=white) to default or HAC, right?
thanks again.
Re: coefficient covariance matrix change to WHITE
Posted: Thu Jun 17, 2010 8:07 am
by EViews Gareth
Is your copy of EViews 7 up to date? (You can check the build date by clicking on Help->About EViews).
Yes, to re-estimate using a difference covariance structure, you can just modify that one line.
Re: coefficient covariance matrix change to WHITE
Posted: Thu Jun 17, 2010 9:09 pm
by wuruonan
It works perfect, thank you so so so so much for your great help....