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: keeping variables and subjects with specific observations


From   Nicholas Winters <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: keeping variables and subjects with specific observations
Date   Fri, 18 Oct 2013 00:07:20 +0000

I have a data set with multiple entries per subject, I want to keep only the entries were two variables are equal (Year and int_year). So i want all entries for for all variables in my data set but only for when Year=int_year

data looks like this:

subject          exposure         Year           int_year
1                       3                1990            1991
1                       4                1991            1991
1                       3                1992            1991
1                       4                1993            1991
2                       3                1990            1990
2                       5                1991            1990
3                       3                1990            1990
3                       4                1991            1992
3                       3                1992            1992

Any ideas how?

Nick
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index