[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: Duplicates drop
When using duplicates drop, Stata will keep the first occurrence and
drop any subsequent ones. If you want to selectively drop specific
duplicates, then I suggest you do it manually, for example:
bysort id: gen dup=_n
gen dup2="YES" if dup>1
replace dup2="NO" if dup==1
then, you can selectively drop the observations you want according to
the value of some other variable, for example:
drop if dup2=="YES" & some_variable=="something_value"
Hope this helps,
Department of Oncology
Tom Baker Cancer Centre
1331 - 29th Street N.W.
Calgary, AB, T2N 4N4
Tel. (403) 521-3370
This e-mail and any attachments may contain confidential and
privileged information. If you are not the intended recipient,
please notify the sender immediately by return e-mail, delete this
e-mail and destroy any copies. Any dissemination or use of this
information by a person other than the intended recipient is
unauthorized and may be illegal.
* For searches and help try: