Problem resolved. It turns out that all observations had been
inadvertently dropped. And whereas if one has an empty dataset
and does:
gen dup=1
a variable is created, though there are no observations. Whereas,
bys myvar: gen dup=1
gives no error and creates no variable. Minor bug, I guess, or
at least minor inconsistency.
thanks,
Jeph
Jeph Herrin wrote:
I've done this many times (in the past) to identify duplicate records;
I've typed and retyped this several times. What's going wrong?
. bys faccode pat_mrn admit_datetime discharge_datetime: gen dups=_N
. tab dups
variable dups not found
r(111);
Notice, the first line does NOT produce an error. However, it also
does not produce a new variable!
Thanks in advance for pointing out what must be an obvious error.
Jeph
*
* 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/
*
* 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/