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: comparing conditions


From   A Loumiotis <[email protected]>
To   [email protected]
Subject   st: comparing conditions
Date   Tue, 14 Dec 2010 13:45:05 +0200

Suppose I have this dataset:
clear
input str5 var_name str40 var_filter
v1
v2
v3    v2==2 | v2==1
v4    v3==1
v5    v1==1
v6    v2==2 | v2==1
v7
v8    v7>0
v9    v7>1
v10  v2==2
end

I would like to generate another string variable, call it var_reg,
that for each var_name it lists all the other var_name that have the
same filter or looser filter.  This is how I want var_reg to look
like:

var_name    var_reg
v1    v2 v7
v2    v1 v7
v3    v1 v2 v6 v7
v4    v1 v2 v7
v5    v1 v2 v7
v6    v1 v2 v3 v7
v7    v1 v2
v8    v1 v2 v7
v9    v1 v2 v7 v8
v10  v1 v2 v3 v6 v7

Is there anyway to do this automatically?  I guess my main question is
how to check whether one condition is looser than another condition?

Thanks,
Antonis Loumiotis
*
*   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