Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

st: RE: creating group property in a panel data


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: creating group property in a panel data
Date   Wed, 25 Apr 2012 18:28:44 +0100

It seems that you have something like this:  

id   diagnosis 

123   0 
123   0 
123   1

234   0 
234   0 
234   0 

345   1
345   1

And you are interested in classifying patients. 

If you go 

egen ever_alc = max(diagnosis) , by(id) 
egen ever_nonalc = min(diagnosis) , by(id) 
gen both = is_alc != is_nonalc 

you may get something relevant. Otherwise I think we need to see a clear example, as your word description is a bit fuzzy. 

Nick 
n.j.cox@durham.ac.uk 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Caliph Omar Moumin
Sent: 25 April 2012 18:16
To: statalist@hsphsun2.harvard.edu
Subject: st: creating group property in a panel data

dear statlist
 
My panel data is patient registry of one year which includes variable ID,  and variable daignosis. I group classified daignosis into two groups
those related to alcohol and those not related to alcohol.
 
so a varaible name called groupdaig is created with 0 for non-related to alcohol and 1 = for related to alcohol. That was so far good.
 
since my data is a panel data same observation in the ID variable is included in both non-alcohol related daignosis and the alcohol related diagnosis. 
 
How can i make unique property, or code to this group? the observatios (patients) which are treated both alcohol and non-alcohol related daignosis?
 
I tried to apply this
http://www.stata.com/support/faqs/data/members.html
 
but i didn't fit to my data structure.
 
 
Kind Regards,
Moumin

Email:  sheikmoumin@yahoo.com 


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