Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dyadic panel data: how to identify id overlaps between dyads over time? (common partners)

    Dear Stata experts,

    I have posted the question a couple of weeks back but didn't receive any feedback. I hope this is not a violation of the forum's rules if I re-post, witith a hopefully more meaningful title.

    I am currently working on a project using panel data with 20.286 observations.

    It is a dyadic panel in which a good (ship) has been chartered from an owner (identified with an "AOS owner" number) to a charterer (identified with an "AOS charterer" number). The panel is based on a dyadic identified (combining both AOS ids) and years from 2000-2017.

    The dependent variable is a dummy "tie" capturing an existign transaction (deal) between the two (I filled in the panel forward based on existing deals).

    The most important independent variable pertains to geography and is a dummy taking the value of one if both :the charterer and owner share the same geographic location *variable "same continent"). This is how the panel data looks like:


    clear
    input float dyad str14(aoscharterer aosowner) float(samecont tie) int Year
    1 "
    4081249" "175805" 0 1 2016
    1 "
    4081249" "175805" 0 0 2010
    1 "
    4081249" "175805" 0 0 2012
    1 "
    4081249" "175805" 0 0 2019
    1 "
    4081249" "175805" 0 0 2015
    1 "
    4081249" "175805" 0 0 2013
    1 "
    4081249" "175805" 0 0 2014
    1 "
    4081249" "175805" 0 0 2008
    1 "
    4081249" "175805" 0 0 2001
    1 "
    4081249" "175805" 0 0 2006
    1 "
    4081249" "175805" 0 0 2011
    1 "
    4081249" "175805" 0 0 2003
    1 "
    4081249" "175805" 0 0 2005
    1 "
    4081249" "175805" 0 0 2017
    1 "
    4081249" "175805" 0 0 2002
    1 "
    4081249" "175805" 0 0 2000
    1 "
    4081249" "175805" 0 0 2009
    1 "
    4081249" "175805" 0 0 2004
    1 "
    4081249" "175805" 0 0 2018
    1 "
    4081249" "175805" 0 0 2007
    1 "
    4081249" "175805" 0 0 1999
    2 "
    4081249" "5073238" 0 1 2017
    2 "
    4081249" "5073238" 0 0 2009
    2 "
    4081249" "5073238" 0 0 2007
    2 "
    4081249" "5073238" 0 0 2008
    2 "
    4081249" "5073238" 0 0 2012
    2 "
    4081249" "5073238" 0 0 2011
    2 "
    4081249" "5073238" 0 0 2016
    2 "
    4081249" "5073238" 0 0 1999
    2 "
    4081249" "5073238" 0 0 2000
    2 "
    4081249" "5073238" 0 0 2005
    2 "
    4081249" "5073238" 0 0 2004
    2 "
    4081249" "5073238" 0 0 2003
    2 "
    4081249" "5073238" 0 0 2006
    2 "
    4081249" "5073238" 0 0 2015
    2 "
    4081249" "5073238" 0 0 2018
    2 "
    4081249" "5073238" 0 0 2014
    2 "
    4081249" "5073238" 0 0 2013
    2 "
    4081249" "5073238" 0 0 2010
    2 "
    4081249" "5073238" 0 0 2001
    2 "
    4081249" "5073238" 0 0 2002
    2 "
    4081249" "5073238" 0 0 2019
    3 "
    4081249" "5851601" 0 1 2017
    3 "
    4081249" "5851601" 0 0 2002
    3 "
    4081249" "5851601" 0 0 2003
    3 "
    4081249" "5851601" 0 0 2019
    3 "
    4081249" "5851601" 0 0 2008
    3 "
    4081249" "5851601" 0 0 2015
    3 "
    4081249" "5851601" 0 0 2005
    3 "
    4081249" "5851601" 0 0 2007
    3 "
    4081249" "5851601" 0 0 2009
    3 "
    4081249" "5851601" 0 0 2010
    3 "
    4081249" "5851601" 0 0 2016
    3 "
    4081249" "5851601" 0 0 2018
    3 "
    4081249" "5851601" 0 0 2011
    3 "
    4081249" "5851601" 0 0 2006
    3 "
    4081249" "5851601" 0 0 2013
    3 "
    4081249" "5851601" 0 0 1999
    3 "
    4081249" "5851601" 0 0 2000
    3 "
    4081249" "5851601" 0 0 2001
    3 "
    4081249" "5851601" 0 0 2004
    3 "
    4081249" "5851601" 0 0 2012
    3 "
    4081249" "5851601" 0 0 2014
    4 "
    4081249" "6004384" 0 1 2018
    4 "
    4081249" "6004384" 0 0 2003
    4 "
    4081249" "6004384" 0 0 2002
    4 "
    4081249" "6004384" 0 0 2016
    4 "
    4081249" "6004384" 0 0 2007
    4 "
    4081249" "6004384" 0 0 2010
    4 "
    4081249" "6004384" 0 0 1999
    4 "
    4081249" "6004384" 0 0 2005
    4 "
    4081249" "6004384" 0 0 2000
    4 "
    4081249" "6004384" 0 0 2012
    4 "
    4081249" "6004384" 0 0 2013
    4 "
    4081249" "6004384" 0 0 2015
    4 "
    4081249" "6004384" 0 0 2014
    4 "
    4081249" "6004384" 0 0 2011
    4 "
    4081249" "6004384" 0 0 2004
    4 "
    4081249" "6004384" 0 0 2017
    4 "
    4081249" "6004384" 0 0 2008
    4 "
    4081249" "6004384" 0 0 2019
    4 "
    4081249" "6004384" 0 0 2001
    4 "
    4081249" "6004384" 0 0 2009
    4 "
    4081249" "6004384" 0 0 2006
    5 "
    4081249" "765050" 1 1 2018
    5 "
    4081249" "765050" 1 0 2002
    5 "
    4081249" "765050" 1 0 2016
    5 "
    4081249" "765050" 1 0 2011
    5 "
    4081249" "765050" 1 0 2010
    5 "
    4081249" "765050" 1 0 2019
    5 "
    4081249" "765050" 1 0 2005
    5 "
    4081249" "765050" 1 0 2009
    5 "
    4081249" "765050" 1 0 2013
    5 "
    4081249" "765050" 1 0 2006
    5 "
    4081249" "765050" 1 0 2003
    5 "
    4081249" "765050" 1 0 2015
    5 "
    4081249" "765050" 1 0 2004
    5 "
    4081249" "765050" 1 0 2001
    5 "
    4081249" "765050" 1 0 2008
    5 "
    4081249" "765050" 1 0 2012
    end
    [/CODE]
    ------------------ copy up to and including the previous line ------------------

    Listed 100 out of 20286 observations
    Use the count() option to list more



    Now my question: I am interested in having a measure of closing triads (closing structural holes). It occurs if for example: A and B have a tie (relation) and B and C have a tie (relation) in t=0. If then a tie is further created between A and C in t=1, I would consider the triad closed (Simmelian).
    What I would like to have is a dummy for either owner or charterer in my data that would indicate that he/she was the basis for a closing triad (time variant measure).
    I realize such measure is usually used in network analysis, which requires a generation of a matrix based on the two identifiers, year by year, but I hope that maybe this can also be solved with some more complex coding in a panel data structure too.

    Thank you so much for your help.
    Best regards

    Aga

  • #2
    You will probably want to start out by checking the nwcommands package by Thomas Grund. It is an entire suite of commands for importing and manipulating networks, generating networks, calculating centrality and dissimilarity measures, visualizing networks, etc. See here and here. Note that there is also an entire forum focused on answering questions regarding using nwcommands to do network analysis here

    There is also another package called datanet (help datanet or ssc install datanet) "Datanet : a Stata routine for organizing a dataset for network analysis purposes" see here

    You may also want to see the Statalist post "Data management for Network Analysis" here

    Comment


    • #3
      Also note, somehow the data that you posted in #1 somehow wrapped. I've re-posted it below in case that helps others coming along later.

      ----------------------- copy starting from the next line -----------------------
      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input float dyad str14(aoscharterer aosowner) float(samecont tie) int Year
      1 "4081249" "175805"  0 0 2000
      1 "4081249" "175805"  0 0 2001
      1 "4081249" "175805"  0 0 2002
      1 "4081249" "175805"  0 0 2003
      1 "4081249" "175805"  0 0 2004
      1 "4081249" "175805"  0 0 2005
      1 "4081249" "175805"  0 0 2006
      1 "4081249" "175805"  0 0 2007
      1 "4081249" "175805"  0 0 2008
      1 "4081249" "175805"  0 0 2009
      1 "4081249" "175805"  0 0 2010
      1 "4081249" "175805"  0 0 2011
      1 "4081249" "175805"  0 0 2012
      1 "4081249" "175805"  0 0 2013
      1 "4081249" "175805"  0 0 2014
      1 "4081249" "175805"  0 0 2015
      1 "4081249" "175805"  0 0 2017
      1 "4081249" "175805"  0 0 2018
      1 "4081249" "175805"  0 0 2019
      1 "4081249" "175805"  0 1 2016
      2 "4081249" "175805"  0 0 1999
      2 "4081249" "5073238" 0 0 1999
      2 "4081249" "5073238" 0 0 2000
      2 "4081249" "5073238" 0 0 2001
      2 "4081249" "5073238" 0 0 2002
      2 "4081249" "5073238" 0 0 2003
      2 "4081249" "5073238" 0 0 2004
      2 "4081249" "5073238" 0 0 2005
      2 "4081249" "5073238" 0 0 2006
      2 "4081249" "5073238" 0 0 2007
      2 "4081249" "5073238" 0 0 2008
      2 "4081249" "5073238" 0 0 2009
      2 "4081249" "5073238" 0 0 2010
      2 "4081249" "5073238" 0 0 2011
      2 "4081249" "5073238" 0 0 2012
      2 "4081249" "5073238" 0 0 2013
      2 "4081249" "5073238" 0 0 2014
      2 "4081249" "5073238" 0 0 2015
      2 "4081249" "5073238" 0 0 2016
      2 "4081249" "5073238" 0 0 2018
      2 "4081249" "5073238" 0 1 2017
      3 "4081249" "5073238" 0 0 2019
      3 "4081249" "5851601" 0 0 1999
      3 "4081249" "5851601" 0 0 2000
      3 "4081249" "5851601" 0 0 2001
      3 "4081249" "5851601" 0 0 2002
      3 "4081249" "5851601" 0 0 2003
      3 "4081249" "5851601" 0 0 2004
      3 "4081249" "5851601" 0 0 2005
      3 "4081249" "5851601" 0 0 2006
      3 "4081249" "5851601" 0 0 2007
      3 "4081249" "5851601" 0 0 2008
      3 "4081249" "5851601" 0 0 2009
      3 "4081249" "5851601" 0 0 2010
      3 "4081249" "5851601" 0 0 2011
      3 "4081249" "5851601" 0 0 2012
      3 "4081249" "5851601" 0 0 2013
      3 "4081249" "5851601" 0 0 2014
      3 "4081249" "5851601" 0 0 2015
      3 "4081249" "5851601" 0 0 2016
      3 "4081249" "5851601" 0 0 2018
      3 "4081249" "5851601" 0 0 2019
      3 "4081249" "5851601" 0 1 2017
      4 "4081249" "6004384" 0 0 1999
      4 "4081249" "6004384" 0 0 2000
      4 "4081249" "6004384" 0 0 2001
      4 "4081249" "6004384" 0 0 2002
      4 "4081249" "6004384" 0 0 2003
      4 "4081249" "6004384" 0 0 2004
      4 "4081249" "6004384" 0 0 2005
      4 "4081249" "6004384" 0 0 2006
      4 "4081249" "6004384" 0 0 2007
      4 "4081249" "6004384" 0 0 2008
      4 "4081249" "6004384" 0 0 2009
      4 "4081249" "6004384" 0 0 2010
      4 "4081249" "6004384" 0 0 2011
      4 "4081249" "6004384" 0 0 2012
      4 "4081249" "6004384" 0 0 2013
      4 "4081249" "6004384" 0 0 2014
      4 "4081249" "6004384" 0 0 2015
      4 "4081249" "6004384" 0 0 2016
      4 "4081249" "6004384" 0 0 2017
      4 "4081249" "6004384" 0 0 2019
      4 "4081249" "6004384" 0 1 2018
      5 "4081249" "765050"  1 0 2001
      5 "4081249" "765050"  1 0 2002
      5 "4081249" "765050"  1 0 2003
      5 "4081249" "765050"  1 0 2004
      5 "4081249" "765050"  1 0 2005
      5 "4081249" "765050"  1 0 2006
      5 "4081249" "765050"  1 0 2008
      5 "4081249" "765050"  1 0 2009
      5 "4081249" "765050"  1 0 2010
      5 "4081249" "765050"  1 0 2011
      5 "4081249" "765050"  1 0 2012
      5 "4081249" "765050"  1 0 2013
      5 "4081249" "765050"  1 0 2015
      5 "4081249" "765050"  1 0 2016
      5 "4081249" "765050"  1 0 2019
      5 "4081249" "765050"  1 1 2018
      end
      ------------------ copy up to and including the previous line ------------------

      Code:
      NOTE: Obs 21 may be an error (dyad should be 1 I would think)
      . list if inrange(dyad, 1,2) & Year<=2010, sepby(dyad) abbrev(12)
      
           +--------------------------------------------------------+
           | dyad   aoscharterer   aosowner   samecont   tie   Year |
           |--------------------------------------------------------|
        1. |    1        4081249     175805          0     0   2000 |
        2. |    1        4081249     175805          0     0   2001 |
        3. |    1        4081249     175805          0     0   2002 |
        4. |    1        4081249     175805          0     0   2003 |
        5. |    1        4081249     175805          0     0   2004 |
        6. |    1        4081249     175805          0     0   2005 |
        7. |    1        4081249     175805          0     0   2006 |
        8. |    1        4081249     175805          0     0   2007 |
        9. |    1        4081249     175805          0     0   2008 |
       10. |    1        4081249     175805          0     0   2009 |
       11. |    1        4081249     175805          0     0   2010 |
           |--------------------------------------------------------|
       21. |    2        4081249     175805          0     0   1999 |
       22. |    2        4081249    5073238          0     0   1999 |
       23. |    2        4081249    5073238          0     0   2000 |
       24. |    2        4081249    5073238          0     0   2001 |
       25. |    2        4081249    5073238          0     0   2002 |
       26. |    2        4081249    5073238          0     0   2003 |
       27. |    2        4081249    5073238          0     0   2004 |
       28. |    2        4081249    5073238          0     0   2005 |
       29. |    2        4081249    5073238          0     0   2006 |
       30. |    2        4081249    5073238          0     0   2007 |
       31. |    2        4081249    5073238          0     0   2008 |
       32. |    2        4081249    5073238          0     0   2009 |
       33. |    2        4081249    5073238          0     0   2010 |
           +--------------------------------------------------------+
      .

      Comment


      • #4
        Thank you so much for replying, David. I will check the issue with dyad consistency. I also tried to check out the dedicated network forum, but it looks very inactive. Anyways, I will pursue the investigation on network analysis.

        Comment

        Working...
        X