SOCIAL SOCIAL NET NETWORK ORK AN ANAL ALYSIS SIS USING USING ST STATA
10 June 2016 German Stata User Meeting GESIS, Cologne Thomas Grund University College Dublin thomas.u.grund@gmail.com www.grund.co.uk
SOCIAL SOCIAL NET NETWORK ORK AN ANAL ALYSIS SIS USING ST - - PowerPoint PPT Presentation
SOCIAL SOCIAL NET NETWORK ORK AN ANAL ALYSIS SIS USING ST USING STATA 10 June 2016 German Stata User Meeting GESIS, Cologne Thomas Grund University College Dublin thomas.u.grund@gmail.com www.grund.co.uk International art fairs
10 June 2016 German Stata User Meeting GESIS, Cologne Thomas Grund University College Dublin thomas.u.grund@gmail.com www.grund.co.uk
International art fairs Changes 2005 - 2006
Yogev, T. and Grund, T. (2012) Structural Dynamics and the Market for Contemporary Art: The Case
Grund, T. and Densley, J. (2012) Ethnic Heterogeneity in the Activity and Structure of a Black Street
Grund, T. and Densley, J. (2015). Ethnic homophily and triad closure: Mapping internal gang structure using exponential random graph models. Journal of Contemporary Criminal Justice, 31(3), 354β370
Caribbean East Africa UK West Africa
9/9/2006, Old Trafford
Grund, T. (2012) Network Structure and Team Performance: The Case of English Premier League Soccer Teams. Social Networks, 34(4), 682-690.
where π = 1,2, . . , π is a set of βverticesβ (or βnodesβ) and πΉ β π, π | π, π β π is a set of βedgesβ (or βtiesβ, βarcsβ). Edges are simply pairs of vertices, e.g. πΉ β 1,2 , 2,5 β¦ .
if π, π β πΉ), and π§ππ = 0 otherwise.
. findit nwcommands
Twitter: nwcommands GoogleGroup: nwcommands Search βnwcommandsβ to find a channel with video tutorials.
for handling, manipulating, plotting and analyzing networks.
βnetworkβ, βsnaβ, βigraphβ, βnetworkDynamicβ.
handling/dealing with networks in Stata.
nwcommands is very easy.
Type Files LoC .ado 94 14548 .dlg 57 5707 .sthlp 97 9954 Downloads Over 13 000 (since Jan 2015)
. nwinstall, all
that accept a netname, e.g. nwdrop, nwkeep, nwclear, nwtabulate, nwcorrelate, nwcollapse, nwexpand, nwreplace, nwrecode, nwunab and more.
netname.
just like when refer to a variable with its varname.
Syntax:
Check out the return vector. Both commands populate it as well. These are the names of the networks in memory. You can refer to these networks by their name.
Pajek, Ucinet, by nwimport.
nwexport.
dropping and keeping variables.
You can also drop/keep nodes of a specific network.
have a wealth of 10.
nwset nwdrop nwds nwkeep nwcurrent nwimport webnwuse
. webnwuse gang . nwplot gang, color(Birthplace) scheme(s2network)
nwplot gang, color(Birthplace) symbol(Prison) size(Arrests)
acciaiuoli albizzi barbadori bischeri castellani ginori guadagni lamberteschi medici pazzi peruzzi pucci ridolfi salviati strozzi tornabuoni
. webnwuse florentine . nwplot flomarriage, lab
. nwplotmatrix flomarriage, lab
. nwplotmatrix flomarriage, sortby(wealth) label(wealth)
. webnwuse klas12 . nwmovie klas12_wave1-klas12_wave4
. nwmovie _all, colors(col_t*) sizes(siz_t*) edgecolors(edge_t*)
M: mutual A: asymmetric N: null
nwsummarize nwtabulate nwdyads nwtriads
Marriage ties Business ties
nwrecode nwreplace nwsync nwtranspose nwsym nwgen
Who are the neighbors?
What is the average wealth of the βalbizziβsβ network neighbors?
nwneighbor nwcontext
Length of a shortest connecting path defines the (geodesic) distance between two nodes.
πππ‘π’πππππ‘ = 1 1 1 2 1 2 2 2 1 1 3 3 1 2 2 2 1 3 3 1
3 1 2 4 5
ππ€πππ πππ π‘βππ π’ππ‘π’ πππ’β πππππ’β = 1.8
How can one get from the βperuzziβ to the βmediciβ?
nwgeodesic nwpath nwplot
What is βwell-connected?β
Degree centrality
centrality, outdegree centrality
π=1 π
π=1 π
Betweeness centrality
a e b c d π·πππ’π₯ππππππ‘π‘ π = 6
π·πππ’π₯ππππππ‘π‘ π = 0
Betweeness centrality
a e b c d e What about multiple shortest paths? E.g. there are two shortest paths from c to d (one via a and another
Give each shortest path a weight inverse to how many shortest paths there are between two nodes.
nwrandom 15, prob(.1)
Each tie has the same probability to exist, regardless of any other ties.
nwrandom 15, prob(.5)
nwlattice 5 5 nwring 15, k(2) undirected
nwsmall 10, k(2) shortcuts(3) undirected
nwpref 10, prob(.5)
nwhomophily gender, density(0.05) homophily(5)
πππ π
πππ‘ = 0.372
Test-statistic
πππ‘ = 0.372
Distribution of test- statistic under null hypothesis
π πππππ =? ?
(randomly re-label the nodes), i.e. the actual network does not change, however, the position each node takes does.
permuted networks and compare it with test-statistic on the unscrambled network.
Network structure is βcontrolledβ for. Keeps dependencies.
permutation
1 1
1
2 3 4 4 3 1 2
1 1
1
nwcorrelate flobusiness flomarriage, permutations(100)
1 2 3 4
.2 .4 correlation
based on 100 QAP permutations of network flobusiness
Corr(flobusiness, flomarriage)
10 June 2016 German Stata User Meeting GESIS, Cologne Thomas Grund University College Dublin thomas.u.grund@gmail.com www.grund.co.uk
logit π π
ππ = 1 π πππ’ππ π‘, π ππ π
= ΰ·
π=1 πΏ
ππππ‘π π
Probability that there is a tie from i to j. Given, n actors AND the rest
dyad in question!
π
ππ π = all dyads other than π ππ
Amount by which the feature π‘π π§ changes when π
ππ is
toggled from 0 to 1.
π = ππππππ ππππππππ, a randomly selected network from the pool of all potential networks π = ππππππππ ππππππππ, here observed network
Probability to draw βourβ observed network y from all potential networks A score given to our network y using some parameters π and the network features s of y
πΎ = ππππππππππ, to be estimated
A score given to all
could have observed
ERGMβs ultimately give you an estimate for various parameters ππ, which meanβ¦
If a potential tie π
ππ = 1
(between i and j) would change the network statistic π‘π by one unit. This changes the log-
ππ to
actually exist by ππ.
Consider an ERGM for an undirected network with parameters for these three statistics: π‘πππππ‘ π§ = ΰ· π§ππ π‘2π‘π’ππ π‘ π§ = ΰ· π§ππ π§ππ π‘π’π πππππππ‘ π§ = ΰ· π§ππ π§πππ§ππ
1) number of edges 2) number of 2-stars 3) number of triangles
π π = π π β π ππππππ‘π‘πππππ‘ π§ + π2π‘π’ππ π‘π‘2π‘π’ππ π‘ π§ + ππ’π πππππππ‘π‘π’π πππππππ‘ π§
Then the 3-parameter ERG distribution function is:
10 June 2016 German Stata User Meeting GESIS, Cologne Thomas Grund University College Dublin thomas.u.grund@gmail.com www.grund.co.uk