I can't speak for STATA. In Stata this sounds like
. bysort id : drop if _N < 4
Nick
[email protected]
Dirk Nachbar (modulo deprecated HTML)
I want to run xtlogit with many explanatory variables, but some individuals have only few observations. Now I need to find a neat way to exclude those which have few obs. In pseudocode this would be
for id=1 to 10000
drop rows(id) if numobs(id)<4
end
But how do I do this is STATA?
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/