[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: re: balanced sub-panel to test for selection bias
Thank you very much for your help, but last command
results in removing
ALL my observations. Maybe I am doing smth wrong?
egen nfarm = count(farm),by(year)
summarize nfarm, meanonly
by year: keep if nfarm == `r(max)'
Yes, you must be doing something wrong (perhaps mangling the
punctuation around r(max)?) as it must be true that at least one farm
has the maximum number of observations signalled by the summarize
command. Try putting in
after the summarize and see what the distribution of the count is in
your sample. I tried this with a hacked version of the Grunfeld data
and it worked fine. Then take out the -tab- and try the lines above
exactly as punctuated.
Kit Baum, Boston College Economics and DIW Berlin
An Introduction to Modern Econometrics Using Stata:
* For searches and help try: