Computes structural equivalence between ego and alter in a network
struct_equiv(graph, v = 1, inf.replace = 0, groupvar = NULL, ...)
# S3 method for class 'diffnet_se'
print(x, ...)
Any class of accepted graph format (see netdiffuseR-graphs
).
Numeric scalar. Cohesion constant (see details).
Deprecated.
Either a character scalar (if graph
is diffnet), or a
vector of size \(n\).
Further arguments to be passed to approx_geodesic
(not valid for the print method).
A diffnet_se
class object.
If graph
is a static graph, a list with the following elements:
SE
Matrix of size \(n\times n\) with Structural equivalence
d
Matrix of size \(n\times n\) Euclidean distances
gdist
Matrix of size \(n\times n\) Normalized geodesic distance
In the case of dynamic graph, is a list of size t
in which each element
contains a list as described before. When groupvar
is specified, the
resulting matrices will be of class dgCMatrix
,
otherwise will be of class matrix
.
Structure equivalence is computed as presented in Valente (1995), and Burt (1987), in particular
$$% SE_{ij} = \frac{(dmax_i - d_{ji})^v}{\sum_{k\neq i}^n(dmax_i-d_{ki})^v} $$
with the summation over \(k\neq i\), and \(d_{ji}\), Eucledian distance in terms of geodesics, is defined as
$$% d_{ji} = \left[(z_{ji} - z_{ij})^2 + \sum_k^n (z_{jk} - z_{ik})^2 + \sum_k^n (z_{ki} - z_{kj})^2\right]^\frac{1}{2} $$
with \(z_{ij}\) as the geodesic (shortest path) from \(i\) to \(j\), and \(dmax_i\) equal to largest Euclidean distance between \(i\) and any other vertex in the network. All summations are made over \(k\not\in \{i,j\}\)
Here, the value of \(v\) is interpreted as cohesion level. The higher its value, the higher will be the influence that the closests alters will have over ego (see Burt's paper in the reference).
Structural equivalence can be computed either for the entire graph or by groups
of vertices. When, for example, the user knows before hand that the vertices
are distributed accross separated communities, he can make this explicit to
the function and provide a groupvar
variable that accounts for this.
Hence, when groupvar
is not NULL
the algorithm will compute
structural equivalence within communities as marked by groupvar
.
Burt, R. S. (1987). "Social Contagion and Innovation: Cohesion versus Structural Equivalence". American Journal of Sociology, 92(6), 1287–1335. doi:10.1086/228667
Valente, T. W. (1995). "Network models of the diffusion of innovations" (2nd ed.). Cresskill N.J.: Hampton Press.
Other statistics:
bass
,
classify_adopters()
,
cumulative_adopt_count()
,
dgr()
,
ego_variance()
,
exposure()
,
hazard_rate()
,
infection()
,
moran()
,
threshold()
,
vertex_covariate_dist()
# Computing structural equivalence for the fakedata -------------------------
data(fakesurvey)
# Coercing it into a diffnet object
fakediffnet <- survey_to_diffnet(
fakesurvey, "id", c("net1", "net2", "net3"), "toa", "group"
)
# Computing structural equivalence without specifying group
se_all <- struct_equiv(fakediffnet)
# Notice that pairs of individuals from different communities have
# non-zero values
se_all
#> Structural equivalence for a dynamic graph
#> # nodes : 9
#> # of slices: 5
#> Access elements via [[nslice]]$ (as a nested list). Available elements are:
#> - SE : Structural equivalence matrix (n x n)
#> - d : Euclidean distances matrix (n x n)
#> - gdist : Geodesic distances matrix (n x n)
se_all[[1]]$SE
#> 9 x 9 Matrix of class "dgeMatrix"
#> 1 2 3 4 5 6 7
#> 1 0.000000000 0.40637925 0.2675568 0.0000000 0.08716001 0.05961925 0.07782794
#> 2 0.300678588 0.00000000 0.3624250 0.0000000 0.11623101 0.05485627 0.08458183
#> 3 0.034034875 0.50252488 0.0000000 0.0000000 0.32312115 0.03403487 0.10628421
#> 4 0.000000000 0.14698274 0.2366860 0.0000000 0.42669042 0.04731519 0.06403113
#> 5 0.000000000 0.12827358 0.2291256 0.2851207 0.00000000 0.08917249 0.10811028
#> 6 0.004813427 0.08242531 0.1173887 0.0000000 0.08242531 0.00000000 0.23764908
#> 7 0.005232795 0.09061077 0.1301072 0.0000000 0.09061077 0.24005932 0.00000000
#> 8 0.004437869 0.07562027 0.1073283 0.0000000 0.07562027 0.22689057 0.21056308
#> 9 0.004437869 0.07562027 0.1073283 0.0000000 0.07562027 0.22689057 0.21056308
#> 8 9
#> 1 0.05072838 0.05072838
#> 2 0.04061364 0.04061364
#> 3 0.00000000 0.00000000
#> 4 0.03914726 0.03914726
#> 5 0.08009869 0.08009869
#> 6 0.23764908 0.23764908
#> 7 0.22168955 0.22168955
#> 8 0.00000000 0.29953960
#> 9 0.29953960 0.00000000
# ... Now specifying a groupvar
se_group <- struct_equiv(fakediffnet, groupvar="group")
# Notice that pairs of individuals from different communities have
# only zero values.
se_group
#> Structural equivalence for a dynamic graph
#> # nodes : 9
#> # of slices: 5
#> Access elements via [[nslice]]$ (as a nested list). Available elements are:
#> - SE : Structural equivalence matrix (n x n)
#> - d : Euclidean distances matrix (n x n)
#> - gdist : Geodesic distances matrix (n x n)
se_group[[1]]$SE
#> 9 x 9 sparse Matrix of class "dgCMatrix"
#> 1 2 3 4 5 6 7 8
#> 1 . 0.5339395 0.3515414 . 0.1145191 . . .
#> 2 0.38581450 . 0.4650442 . 0.1491413 . . .
#> 3 0.03959012 0.5845481 . . 0.3758617 . . .
#> 4 . 0.1813797 0.2920754 . 0.5265448 . . .
#> 5 . 0.1996414 0.3566046 0.4437539 . . . .
#> 6 . . . . . . . .
#> 7 . . . . . 1.000000 . .
#> 8 . . . . . 0.155051 . .
#> 9 . . . . . 0.155051 . 0.844949
#> 9
#> 1 .
#> 2 .
#> 3 .
#> 4 .
#> 5 .
#> 6 .
#> 7 .
#> 8 0.844949
#> 9 .