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]

Re: st: how to make list of network ties from long data


From   Brendan Halpin <[email protected]>
To   [email protected]
Subject   Re: st: how to make list of network ties from long data
Date   Fri, 05 Oct 2012 23:36:59 +0100

On Fri, Oct 05 2012, Caleb Southworth wrote:

> I would like to make a list of people who are connected on some
> identical variable, such as publishing in the same journal.
>
> So I have . list date-magazine
>
>      +----------------------------+
>      | date   author     magazine |
>      |----------------------------|
>   1. | 1920    Woolf         Dial |
>   2. | 1921    Woolf      Mercury |
>   3. | 1930    Woolf       Nation |
>   4. | 1925    Joyce         Dial |
>   5. | 1930    Joyce   Transition |
>      |----------------------------|
>   6. | 1927        L         Dial |
>   7. | 1930        L   Transition |
>      +----------------------------+
>
> And the desired outcome would be:
>
> Woolf Joyce
> Woolf L
> Joyce Woolf
> Joyce L
> L Woolf
> L Joyce

input year2 str20 name2 str20 magazine
1920    Woolf         Dial
1921    Woolf      Mercury
1930    Woolf       Nation
1925    Joyce         Dial
1930    Joyce   Transition
1927        L         Dial
1930        L   Transition
end

sort magazine
save alter, replace

rename year2 year1
rename name2 name1

joinby magazine using alter

drop if name1==name2 & year1==year2
list


-- 
Brendan Halpin,   Department of Sociology,   University of Limerick,   Ireland
Tel: w +353-61-213147  f +353-61-202569  h +353-61-338562;  Room F1-009 x 3147
mailto:[email protected]    ULSociology on Facebook: http://on.fb.me/fjIK9t
http://teaching.sociology.ul.ie/bhalpin/wordpress         twitter:@ULSociology
*
*   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