Dear Stata experts,

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