Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: manual F-test


From   nolaa@sportmgt.umass.edu
To   statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index