General F testing

Econometrics questions and discussions
bearlotus
Posts: 10
Joined: Thu Sep 24, 2009 9:27 am

General F testing

Unread post by bearlotus »

Using the F ratio '= [(R^2unrestricted - R^2restricted)/m]/[(1-R^2unrestricted)/(n-k)]' to test B4=B5=0.
How do I finish my code?
linreg lny
# constant lx2 lx3 lx4 lx5
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: General F testing

Unread post by TomDoan »

I assume that you are doing this for illustrative purposes. If you just want the result, the simplest thing to do is

linreg lny
# constant lx2 lx3 lx4 lx5
exclude
# lx4 lx5

Doing this by restricted and unrestricted:

linreg lny
# constant lx2 lx3
compute rssr=%rss,ndfr=%ndf
linreg lny
# constant lx2 lx3 lx4 lx5
compute fstat=(rssr-%rss)/(2*%seesq)
cdf(title="Exclusion Restriction") ftest fstat 2 %ndf
bearlotus
Posts: 10
Joined: Thu Sep 24, 2009 9:27 am

Re: General F testing

Unread post by bearlotus »

Thank you. You are correct I am doing this for illustrative purposes.

Here is the code I was using, wasn't sure if it was the same test.

linreg lny
# constant lx2 lx3 lx4 lx5

TEST(ZEROS)
# 4 5

When I run both test they have the same output for the F test, but it does not agree with my book.
F = 1.1224

All R^2 values agree, is the difference rounding error?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: General F testing

Unread post by TomDoan »

If the sum of squares in the book calculations are heavily rounded (to, say, three significant digits), then it's quite possible that the results will differ fairly substantially.
Post Reply