Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: what's wrong with this statement?


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: what's wrong with this statement?
Date   Tue, 23 Sep 2008 14:25:12 -0400

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index