Run LM test in the loop

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Run LM test in the loop

Postby Amber » Tue Oct 02, 2012 10:31 am

Dear Eviews Expert,

I am trying to run the LM serial correlation test with lag 6 across 200 series, and collect the p-value for them.

I have created the loop, but I don't know how to collect the LM p-val in Eviews code (my guess is something like "lm.@series"), is it possible to do this in Eviews?

If it is possible, will you please tell me how to do it?

I really appreciate your kind help!

Best regards,

Amber

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13309
Joined: Tue Sep 16, 2008 5:38 pm

Re: Run LM test in the loop

Postby EViews Gareth » Tue Oct 02, 2012 10:32 am

Follow us on Twitter @IHSEViews

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: Run LM test in the loop

Postby Amber » Tue Oct 02, 2012 10:35 am

Absolutely brilliant! Cheers!

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: Run LM test in the loop

Postby Amber » Tue Oct 02, 2012 10:47 am

Dear Gareth,

I have tried:

Code: Select all

freeze(tab1) eq1.lm lag=6
scalar chi_pvalue = @val(tab1(4,4))


But it is not working, can you correct the code for me?

Thanks!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13309
Joined: Tue Sep 16, 2008 5:38 pm

Re: Run LM test in the loop

Postby EViews Gareth » Tue Oct 02, 2012 10:52 am

According to the Object Reference, the correct command for performing the auto correlation LM test is equation.auto(lags)
Follow us on Twitter @IHSEViews

Amber
Posts: 31
Joined: Wed Aug 03, 2011 4:35 am

Re: Run LM test in the loop

Postby Amber » Tue Oct 02, 2012 10:58 am

Thanks, it works like charm!

I will post the code here:

Code: Select all

freeze(tab1) eq1.auto(6)
scalar chi_pvalue = @val(tab1(4,5))


Just in case, might be helpful to others.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 11 guests