General F testing
General F testing
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
How do I finish my code?
linreg lny
# constant lx2 lx3 lx4 lx5
Re: General F testing
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
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
Re: General F testing
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?
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?
Re: General F testing
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.