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 on April 23, and its replacement, 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 <>
Subject   st: strange "not sorted" error
Date   Mon, 14 Nov 2011 20:32:33 -0600


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)
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?


Tatyana Deryugina

Lecturer, Department of Finance
University of Illinois, Urbana-Champaign
(925) 349 - 8999 (cell)
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index