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: strange "not sorted" error


From   Tatyana Deryugina <tatyanad@mit.edu>
To   statalist@hsphsun2.harvard.edu
Subject   st: strange "not sorted" error
Date   Mon, 14 Nov 2011 20:32:33 -0600

Hi,

I'm running a simple regression after which I would like to generate
predicted residuals. The code (for Stata 11) goes something like this:
tsset county_fips year
areg outcome depvar L.depvar i.year#i.state_fips, absorb(county_fips)
cluster(state_fips)
tsset county_fips year
predict outcome_r, residuals

The code breaks down on the fourth line and gives me an r(5) "not
sorted" error. Note that I added the second "tsset county_fips year"
during debugging - the code also breaks down when it is not there.
I've looked through the documentation to try to find what I'm supposed
to sort by, but I can't figure it out. Any suggestions?

Best,
Tatyana

---------------------------------------------------------------
Tatyana Deryugina

Lecturer, Department of Finance
University of Illinois, Urbana-Champaign
(925) 349 - 8999 (cell)
*
*   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