Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: manual F-test


From   [email protected]
To   [email protected]
Subject   st: manual F-test
Date   Tue, 20 Apr 2010 12:15:17 -0400

Hi -
I recently conducted a manual F-test to determine whether I could pool both large and small market data. Test worked great. (see code below)
   I now have two questions, the first of which is most important.

1. I now need to conduct a similar test using -regress- (instead of xtpcse). Since Stata does not collect e(n_cf) in -regress- is there a way for me to re-write the code to still perform this manual test after using -regress-?

2. Is there a built in command I don't know about that would make this all a lot easier?

Thanks,
Nola

-----code-------

* Step 1 F test - only small markets
xtpcse ..etc.. if big==0
display e(rss)
display e(n_cf)
generate rssS = e(rss)
generate KS = e(n_cf)

* Step 2 of F test - only big markets
xtpcse ..etc.. if big==1
display e(rss)
display e(n_cf)
generate rssB = e(rss)
generate KB = e(n_cf)

* Step 3 of F test - all markets (restricted model)
xtpcse ..etc..
display e(rss)
display e(n_cf)
generate rssR = e(rss)
generate KR = e(n_cf)
generate N = e(N)

* Step 4 of F test - do the math
generate rssU = rssS + rssB
generate KU = KS + KB

generate Fcalc = ((rssR-rssU)/(KU-KR))/(rssU/(N-KU))
display Fcalc
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index