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: Network - double back relation


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Network - double back relation
Date   Wed, 6 Nov 2013 09:32:05 +0000

gen pair = string(min(source, target)) + " " + string(max(source, target))
bysort pair : drop if _n == 2

SImilar questions are often discussed on this list, e.g. search for posts citing

SJ-8-4  dm0043  . Tip 71: The problem of split identity, or how to group dyads
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
        Q4/08   SJ 8(4):588--591                                 (no commands)
        tip on how to handle dyadic identifiers

accessible at http://www.stata-journal.com/sjpdf.html?articlenum=dm0043

Nick
[email protected]


On 6 November 2013 09:24, Simon Falck <[email protected]> wrote:
> Hi Statalist,
>
> Using Stata 13.1 and aiming at a simple descriptive network plot but bump
> into the issue of double back relations among the edges, i.e. some of the
> networks actually double back on themselves. Here is an sample of my
> dataset:
>
> source    target    weight
> 1    1    1
> 2    2    1
> 3    3    3
> 3    5    3
> 3    8    3
> 4    4    1
> 5    3    3
> 5    5    16
> 5    8    3
> 6    6    1
> 7    7    1
> 8    3    3
> 8    5    3
> 8    8    21
> 9    9    1
>
> For instance, there is a relationship between source '3' and target '5', and
> thus also between target '5' and source '3'. My question is how do I manage
> to only keep one way relation between 'source' and 'target', i.e. how do I
> delete (drop) the double back relationship?
>
> I could be noted that double back relationships has been mentioned in an
> earlier discussion:
> http://www.stata.com/statalist/archive/2013-09/msg00142.html
>
> Thanks in advance!
>
> Best,
> Simon
> *
> *   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/
*
*   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