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: referencing values of others on a variable


From   Viktor Emonds <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: referencing values of others on a variable
Date   Tue, 9 Jul 2013 08:58:24 +0000

Hello,

I have a file where for each student, there are as many observations as there are possible ties to other classmates (directed, based on nomination), with the following basic structure:

id student  id alter     tie

001               002      1      
001               003      0
001               004      0
001               005      1
002              001        0
002             003         0
002              004       0
002              005       1

I would like to compute indices of friendship segregation along ethnic lines and need to evaluate whether the ethnicities of ego and alter match or not. How to do so in Stata syntax?

I know you can refer to values on a variable for another observation, e.g. samevalue= var==var[_n-1], but I cannot seem to extend this to something like samerace= race==race[idstudent=idalter]. Any ideas on how I can do this? Thanks!

Best,

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