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: How to keep if freq of var is >= 100 for both group (Alcohol "1" and non-alcohol "0")?


From   Caliph Omar Moumin <[email protected]>
To   "[email protected]" <[email protected]>
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:  [email protected] 


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