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: duplicate cases in data cleaning


From   "Fernando Rios Avila" <f.rios.a@gmail.com>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Jet
Sent: Monday, May 02, 2011 12:21 PM
To: statalist@hsphsun2.harvard.edu
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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index