Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: AW: tagging observations where either x or y are true


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: AW: tagging observations where either x or y are true
Date   Sun, 25 Oct 2009 23:13:25 +0100

<> 

Get the tag via

*************
bys sampleid: gen byte tag=_N>1
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Michael
McCulloch
Gesendet: Sonntag, 25. Oktober 2009 23:08
An: Statalist Statalist
Betreff: st: tagging observations where either x or y are true

I'd appreciate advice on this problem which although apparently simple  
is somewhat vexing.
Note that for:
	sample 30.1 only y is true,
	sample 34.3 only x is true,
but 	sample 34.1 both x and y are true,

     sampleid   x     y
         30.1         0      1
         34.1         1      0
         34.1         0      1
         34.3         1      0

What I'd like to achieve is only one entry for 34.1, where both x and  
y ==1.
I can identify 34.1 with -duplicates-, but can't figure out the next  
step of concatenating observations for that sampleid such that x=y=1.


Michael McCulloch
Pine Street Foundation
124 Pine Street
San Anselmo, CA 94960-2674
tel:	415-407-1357
fax: 	206-338-2391
mm@pinestreetfoundation.org






*
*   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