Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: duplicate cases in data cleaning


From   "Fernando Rios Avila" <[email protected]>
To   <[email protected]>
Subject   st: RE: duplicate cases in data cleaning
Date   Mon, 2 May 2011 12:24:44 -0400

Check the help with collapse and/or egen
help collapse
help egen


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jet
Sent: Monday, May 02, 2011 12:21 PM
To: [email protected]
Subject: st: duplicate cases in data cleaning

Hi,

    Could anyone point me to how to resolve the following situation during
the stage of data cleaning?

The structure of the data is like this. If an individual has taken any type
of hypertension medicine, then drug is coded as 1.

    ID    Drug
  101      1
  101      0
  200      1
  200      1

Now I need to combine cases by adding up the "drug" variable such that it
looks like:

   ID    Drug
  101      1
  200      2

Thank you  very much


   Jeff
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index