Hello!!!
All formulas I used to define the LR statistics didn't gave me same results as tests. I used following fomulas:
LR=-2LN(la)=-2(ln(L(q(restr))-ln(L(q(unrest)))
All formulas are for regression with linear restrictions, but in the 'Factor breakpoint test' restrictions are not linear, but in an additional variable form . Please, advise me some books to read, with the right computation formula.
Thank you very much!
Factor BT test
Moderators: EViews Gareth, EViews Moderator
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13323
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Factor BT test
I don't understand your question (if, indeed, there is one?)
Follow us on Twitter @IHSEViews
Re: Factor BT test
Well, I'll show you my problem with an example.
Here's a sample on which to build a regression and p1 add variable.
y x1 x2 x3 p1
25 11 1 2 0
30 15 3 5 0
35 13 2 8 0
43 2 8 3 0
36 8 5 9 0
85 20 7 4 0
25 11 1 2 0
30 15 3 5 0
35 13 2 8 0
43 2 8 3 1
36 8 5 9 1
85 20 7 4 1
25 11 1 2 1
30 15 3 5 1
35 13 2 8 1
43 2 8 3 1
36 8 5 9 1
85 20 7 4 1
25 11 1 2 1
30 15 3 5 1
In book EViewsHelp says that Log likelihood ratio statistic calculated by the formulas:
l=-T/2(1+log(2*pi)+log(e'e/T)
LR=-2(l(restr)-l(unrestr))
OR
In Ben Vogelvang - Econometrics.Theory and Applications with EViews says that
LR=-2Ln(lambda), lambda=L(teta)with restrictions / L(teta)without restrictions
in ex. l unrestr=-65,36157
l1restr=-29,85
l2restr=-35,27551
=> LR = -2 ((-29,85+-35,27551)-(-65,36157))=-0,47
but in Eviews I get 0.344791!!!
Here's a sample on which to build a regression and p1 add variable.
y x1 x2 x3 p1
25 11 1 2 0
30 15 3 5 0
35 13 2 8 0
43 2 8 3 0
36 8 5 9 0
85 20 7 4 0
25 11 1 2 0
30 15 3 5 0
35 13 2 8 0
43 2 8 3 1
36 8 5 9 1
85 20 7 4 1
25 11 1 2 1
30 15 3 5 1
35 13 2 8 1
43 2 8 3 1
36 8 5 9 1
85 20 7 4 1
25 11 1 2 1
30 15 3 5 1
In book EViewsHelp says that Log likelihood ratio statistic calculated by the formulas:
l=-T/2(1+log(2*pi)+log(e'e/T)
LR=-2(l(restr)-l(unrestr))
OR
In Ben Vogelvang - Econometrics.Theory and Applications with EViews says that
LR=-2Ln(lambda), lambda=L(teta)with restrictions / L(teta)without restrictions
in ex. l unrestr=-65,36157
l1restr=-29,85
l2restr=-35,27551
=> LR = -2 ((-29,85+-35,27551)-(-65,36157))=-0,47
but in Eviews I get 0.344791!!!
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13323
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Factor BT test
Hard to know where your calculations are coming from, but when I use that data, I get a restricted LR of -65.36157, and an unrestricted LR of -65.18918. Which does seem to give the LR test statistic of 0.344791
Follow us on Twitter @IHSEViews
Re: Factor BT test
Ok. Сan you show me how you calculate an unrestricted LR of -65.18918? how to construct an unrestricted regeres
I can stand it is not correct.
i using regression ls y c x1 x2 x3 => Log Likelihood ratio = -65.36157 this is restricted
next
ls y c x1 x2 x3 p1 => Log Likelihood ratio = -65.36008
short regression ls y c x1 x2 x3 (9 observations)=> Log Likelihood ratio = -29,85
short regression ls y c x1 x2 x3 (11 observations)=> Log Likelihood ratio = -35,27551
Now you can see what I can not get unrestr Log likelihood as you Please, help me!!!!
I can stand it is not correct.
i using regression ls y c x1 x2 x3 => Log Likelihood ratio = -65.36157 this is restricted
next
ls y c x1 x2 x3 p1 => Log Likelihood ratio = -65.36008
short regression ls y c x1 x2 x3 (9 observations)=> Log Likelihood ratio = -29,85
short regression ls y c x1 x2 x3 (11 observations)=> Log Likelihood ratio = -35,27551
Now you can see what I can not get unrestr Log likelihood as you Please, help me!!!!
Re: Factor BT test
or if restricted regression is y=c0+c1x1+c2x2+c3x3+e => unrestricted regression is ???
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13323
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Factor BT test
Code: Select all
equation eq1.ls y c x1 x2 x3
equation eq2.ls y c p1 x1 x1*p1 x2 x2*p1 x3 x3*p1
scalar lrstat = 2*(eq1.@logl-eq2.@logl)
show lrstat
Follow us on Twitter @IHSEViews
Re: Factor BT test
A very big thank you!!!!!!! You helped me a lot!
Re: Factor BT test
hello EViews Gareth
equation eq1.ls y c x1 x2 x3
equation eq2.ls y c p1 p2 x1 x1*p1 x1*p2 x2 x2*p2 x2*p1 x3 x3*p1 x3*p2
I use two limitations. tried to make unrest.regression, but have not received the required logl.
Can I see how to build unrestr.regression for this test if we have two limitations.?
equation eq1.ls y c x1 x2 x3
equation eq2.ls y c p1 p2 x1 x1*p1 x1*p2 x2 x2*p2 x2*p1 x3 x3*p1 x3*p2
I use two limitations. tried to make unrest.regression, but have not received the required logl.
Can I see how to build unrestr.regression for this test if we have two limitations.?
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13323
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Factor BT test
You need the dummy interactions too.
Code: Select all
create u 100
rndseed 1
series y=nrnd
series x1=nrnd
series x2=nrnd
series p1=nrnd>0
series p2=nrnd>0.4
equation eq1.ls y c x1 x2
equation eq2.ls y c p1 x1 x1*p1 x2 x2*p1 p2 p2*x1 p2*x2 p1*p2 p1*p2*x1 p1*p2*x2
scalar lrstat = -2*(eq1.@logl-eq2.@logl)
freeze(tab1) eq1.facbreak p1 p2
show tab1
show lrstat
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 30 guests