Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • clogit error: not sorted

    Dear all,

    I'm using Stata 12.1 on a Mac.

    The -clogit- command is giving me problems. I have panel data; panels are identified by <id> and <year>. I try to run -clogit Y X1 L(0/1).X2 i.year, group(id) vce(cluster C)-, but this gives the error 'not sorted' and exits with r(5). I -xtset id year- the data before issuing the -clogit- command. Running the same command but with -, vce(robust)- works without error. Also, the command with -clogit, nonest- gives no error. I've checked the clustering, and <id> is always nested in the <C> cluster, so there should be no problem there. I cannot replicate the issue with the union.dta data set given in the clogit help file.

    Am I correct that the problem is probably in the clusters, rather than the data being 'not sorted' (in which case I think the error message is not informative)? If not, what other things can I check to find out what is wrong? I've checked for correct clustering by -assert-ing that for each <id> the minimum value of <C> (which is numeric) equals the maximum value, and this is always the case. Should I check something else, and, if so, what?

    Thanks for your help
    Matthijs
Working...
X