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 on April 23, and its replacement, statalist.org is already up and running.


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

st: How to keep if freq of var is >= 100 for both group (Alcohol "1" and non-alcohol "0")?


From   Caliph Omar Moumin <sheikmoumin@yahoo.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   st: How to keep if freq of var is >= 100 for both group (Alcohol "1" and non-alcohol "0")?
Date   Mon, 24 Sep 2012 23:53:21 -0700 (PDT)

Dear stata-helpers
 
I have a large dataset which more than 500,000 observations; and more than 7000 diagnoses,  which is grouped into two groups alcohol coded as "1" and nonlacloh as "0"
the data structure is like this
 
obs                id                                      diagnosis        group............other variables
  1               2338                                     A120             1
 
 2                3838                                     m23              0                      
.              
.
.
.
 500,000      45566                                    y678            1                           


So i want to keep if observations is  >= 100 for both groups alcohol and nonalcohol based on daignoses. For example if daignoses A120 has more than 100 observations for both alcohol and nonalcohol keep if not drop it.

I would appreciate if any could help

Kind Regards,
Caliph 
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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index