Likelihood ratio test

For questions regarding programming in the EViews programming language.

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

kenlopes
Posts: 2
Joined: Tue Nov 22, 2011 6:34 am

Likelihood ratio test

Postby kenlopes » Fri Jul 20, 2012 8:24 am

I'm trying to do the likelihood ratio test between two linear models. What command should I use. I used the command, but did not yield any result.
the command:
scalar lr = -2*(modelolinear2.@logl - modelolinear1.@logl)
scalar q =1
scalar lr_pval = 1 - @cchisq(lr,q)

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

Re: Likelihood ratio test

Postby EViews Gareth » Fri Jul 20, 2012 9:05 am

Could you be more specific? What do you mean "did not yield any result"? Were the scalars created?

beniam
Posts: 5
Joined: Tue Aug 28, 2012 1:39 am

Re: Likelihood ratio test

Postby beniam » Sun Sep 02, 2012 6:57 pm

Could you be more specific? What do you mean "did not yield any result"? Were the scalars created?
Gareth, I saw this post only after I posted mine in a different string. I thought I may post here as well in case other users face similar issues in the future. In my case, E-views sends an error message saying "LR is not defined". What could possibly be the reason?

Kindly,
Ben

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

Re: Likelihood ratio test

Postby EViews Gareth » Sun Sep 02, 2012 8:30 pm

Probably means you're referencing something called LR, which doesn't exist.

startz
Non-normality and collinearity are NOT problems!
Posts: 3798
Joined: Wed Sep 17, 2008 2:25 pm

Re: Likelihood ratio test

Postby startz » Sun Sep 02, 2012 11:46 pm

Check to see whether the scalar lr was created after the line

Code: Select all

scalar lr = -2*(modelolinear2.@logl - modelolinear1.@logl)
The last command should work.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests