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: generating variables for group members conditional on member's own values and values for other group members‏


From   erik.aadland@bi.no
To   statalist@hsphsun2.harvard.edu
Subject   st: generating variables for group members conditional on member's own values and values for other group members‏
Date   Sun, 9 Jan 2011 18:36:20 +0100

Dear statalist.
 
I have data with the following structure:
 
project_id     org_id             org_elite     org_new     new_niche
1                      1               1        0.9                0 
1                      2               0.9      0.2                1
1                      3               0.1      0.3                0
1                      6               0        0                  0
2                      4               0.5      0.86               1
2                      5               .        .                  0 
2                      1               1        0.9                0 
3                      6               0.5      0.9                1
3                      7               .        0.9                0
 
I am trying to generate a variable X by project_id and org_id that does the following:
 
if org_id (i) has an org_elite value that is ( > 0 <.) , and collaborates with another org_id (j) with an org_new value (> 0.85) and that org_id (j) has a new niche value =1, then org_id (i) gets a value of 1 and 0 otherwise on the new variable X.
 
Similarly, I am trying to generate a variable X2 by project_id and org_id that does the following:
 
if org_id (i) has a new niche value =1, and collaborates with another org_id (j) that has an org_elite value ( <.), then org_id (i) gets a value on the new variable X2 that equals the org_elite value for org_id (j).
 
Any and all help is very much appreciated.
 
Sincerely,
Erik Aadland.
*
*   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