General F testing

Econometrics questions and discussions

General F testing

Postby bearlotus » Sat Oct 13, 2012 5:56 pm

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
bearlotus
 
Posts: 10
Joined: Thu Sep 24, 2009 9:27 am
Location: University of North Florida

Re: General F testing

Postby TomDoan » Sun Oct 14, 2012 9:50 am

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
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: General F testing

Postby bearlotus » Sun Oct 14, 2012 4:00 pm

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?
bearlotus
 
Posts: 10
Joined: Thu Sep 24, 2009 9:27 am
Location: University of North Florida

Re: General F testing

Postby TomDoan » Sun Oct 14, 2012 5:39 pm

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.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to General Econometrics

Who is online

Users browsing this forum: No registered users and 2 guests