Extreme actors
Johan Koskinen
Analysing outliers in ergm
Koskinen et al. (2018) propose a number of measures for detecting outliers in ERGM. A selection of these have been implemented in the program MPNet (Wang et al. 2014).
Load packages
library(sna)
library(network)
library(ergm)
library(plotly)
## Warning: package 'plotly' was built under R version 3.6.2
library(data.table)
library(Bergm)
ERGM
With the convention that \(z(Y,X)\) is a vector of statistics calculated for the network \(X\) on node set \(V\), and \(\theta\) is a vector of statistical parameters, we can write any ERGM compactly as
\[ p_{\theta}(y)=\exp\left\{\theta^{\top}z(y,x) -\psi(\theta ) \right\} \]
The inner product will be a weighted sum of features \(\theta^{\top}z(y,x)=\sum_{s=1}^p \theta_s z_s(y,x)\), and \(\psi\) is a normalising constant to ensure that the probability \(p_\theta\) sums to 1 over all possbile networks \(y^{\prime}\).
Leave one out
In Koskinen et al. (2018) and outlier is defined on the level of the node and is called an outlier if the estimate \(\hat{\theta}^{(i)}_{\mathbf{ML}}\) of an ERGM for \(Y\) when \(i\) has been removed is different from the estimate \(\hat{\theta}_{\mathbf{ML}}\) based on the entire datset.
Read in the functions
source('https://raw.githubusercontent.com/johankoskinen/BayesERGM/main/ergm.gcd.R')
Test dataset
This is a network of members of the Revolutionary Organization 17 November group. We use the format as described in Koskinen et al. (2018).
temp <- tempfile()
download.file("https://raw.githubusercontent.com/johankoskinen/BayesERGM/main/data/greekAdjacent.txt",temp)
greekBomb<- read.table(temp)# this two adjacency matrices stacked on top of each other in a text file
unlink(temp)
greekBomb[4,18] <- 1# an error in the dataset
greekBomb.net <- as.network( greekBomb , directed=FALSE)# translate the matrix to a network object
greekBomb.net
## Network attributes:
## vertices = 18
## directed = FALSE
## hyper = FALSE
## loops = FALSE
## multiple = FALSE
## bipartite = FALSE
## total edges= 46
## missing edges= 0
## non-missing edges= 46
##
## Vertex attribute names:
## vertex.names
##
## No edge attributes
Plot it
plot( greekBomb.net )
Estimate model
est <- ergm( greekBomb.net ~ edges+
altkstar(2, fixed=TRUE)+
gwesp(log(2), fixed=TRUE),
control=control.ergm(init=c(-1.4070,-1.1974,2.1890),
MCMC.interval=5024))
## Starting Monte Carlo maximum likelihood estimation (MCMLE):
## Iteration 1 of at most 20:
## NOTE: Messages 'Error in mcexit(0L)...' may appear; please disregard them.
## Optimizing with step length 1.
## The log-likelihood improved by 0.007366.
## Step length converged once. Increasing MCMC sample size.
## Iteration 2 of at most 20:
## NOTE: Messages 'Error in mcexit(0L)...' may appear; please disregard them.
## Optimizing with step length 1.
## The log-likelihood improved by 0.001231.
## Step length converged twice. Stopping.
## Finished MCMLE.
## Evaluating log-likelihood at the estimate. Using 20 bridges: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .
## This model was fit using MCMC. To examine model diagnostics and check
## for degeneracy, use the mcmc.diagnostics() function.
Check results
summary(est)
##
## ==========================
## Summary of model fit
## ==========================
##
## Formula: greekBomb.net ~ edges + altkstar(2, fixed = TRUE) + gwesp(log(2),
## fixed = TRUE)
##
## Iterations: 2 out of 20
##
## Monte Carlo MLE Results:
## Estimate Std. Error MCMC % z value Pr(>|z|)
## edges -1.3960 1.2713 0 -1.098 0.2722
## altkstar.2 -1.2110 0.4184 0 -2.894 0.0038 **
## gwesp.fixed.0.693147180559945 2.2131 0.4649 0 4.761 <1e-04 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Null Deviance: 212.1 on 153 degrees of freedom
## Residual Deviance: 150.9 on 150 degrees of freedom
##
## AIC: 156.9 BIC: 166 (Smaller is better.)
Do MPNet-type convergence check
We can perform a Phase-3 simulation to recalculate
Effect | Coeficient | SE | Convergence t-statistic | SACF |
---|---|---|---|---|
statnet name |
based on est |
root of diagonal element \(cov_{\theta_{\mathrm{ML}}} (ZZ^{\top})^{-1}\) | \(\frac{z_{\mathrm{obs}} -E_{\theta_{\mathrm{ML}} }(Z)} {sd_{\theta_{\mathrm{ML}}}(Z)}\) | \(SACF(Z_{t-1},Z_t)\) |
convergence.test(greekBomb.net ~ edges+
altkstar(2, fixed=TRUE)+
gwesp(log(2), fixed=TRUE),
ergm.est=est,# parameters are taked from the estimation
multiplication.factor=30)# this is the same multiplication factor as in MPNet
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: Use of 'statsonly=' argument has been deprecated. Use 'output='stats''
## instead.
## coef se convergence t SACF
## edges -1.395982 1.2711596 -0.04003708 0.1836639
## altkstar.2 -1.211027 0.4183779 -0.03628536 0.1859955
## gwesp.fixed.0.693147180559945 2.213067 0.4648084 -0.03389391 0.1787979
# nsim= est$control$MCMC.samplesize is the default number of graphs in Phase 3,
# burnin= est$control$MCMC.burnin, is the default burnin for graphs in Phase 3,
If we compare the MPNet-like table with the statnet table, as well as the additional convergence statistics and SACF we can conclude
The standard errors only differ in the fourth decimal. Converngence t-statistics are all less than 0.1 in absolute value and the SACF is less than 0.4
Calculate the GCD
In the routines, the function ergm.gcd
calculates the generalised Cooks distance \[
||\hat{\theta}^{(i)}_{\mathbf{ML}}-\hat{\theta}_{\mathbf{ML}}||_{\Sigma}
\] where \(\hat{\theta}^{(i)}_{\mathbf{ML}}\) is the MLE of the model where \(Y_{\mathrm{obs}}\) has been replaced with \(Y^{(i)}\), which has elements \((Y_{\mathrm{obs}})_{j,k}\) for \(j,k \in V \backslash \{i\}\), and the rows and columns for \(i\) set to NA.
The actual calculation is based on an approximation that does not require re-estimation of \(\hat{\theta}^{(i)}_{\mathbf{ML}}\). Instead, for each \(i \in V\), the ties \(Y_{ij}\) are simulated from the conditional model, conditional on \(Y_{jk}\), for \(j,k \in V \backslash \{i\}\). The difference \[ E_{\hat{\theta}_{\mathbf{ML}}} \left[ z(Y)|Y_{jk}=y_{jk},j,k \in V \backslash \{i\}\right]-z(Y_{\mathrm{obs}}) \] is then weighted together by an appropriate weight matrix.
Call the function
GCD <- ergm.gcd(greekBomb.net ~ edges+
altkstar(2, fixed=TRUE)+
gwesp(log(2), fixed=TRUE),
ergm.est=est)# the following elements have defaults taken from the estimation object
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Calculating GCD for actor:
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#nsim= est$control$MCMC.samplesize,
#burnin=est$control$MCMC.burnin,
#thinning =est$control$MCMC.interval )
# these defaults can be altered to make computations quicker or to increase precision
The function returns three obbjects
names(GCD)
## [1] "observed.stats" "expected.stats" "GCDMVP"
where the expected.stats
provide the expected value \[
E_{\hat{\theta}_{\mathbf{ML}}} \left[ z(Y)|Y_{jk}=y_{jk},j,k \in V \backslash \{i\}\right]
\] for each node.
gcd.scores <- data.frame(edges=GCD$expected.stats[,1],altkstar.2=GCD$expected.stats[,2],gwesp = GCD$expected.stats[,3],gcd.mvp= GCD$GCDMVP)
fig <- plot_ly(gcd.scores, x = ~edges, y = ~altkstar.2, z = ~gwesp,
marker = list(color = ~gcd.mvp, colorscale = c('#FFE1A1', '#683531'), showscale = TRUE))
fig <- fig %>% add_markers()
fig <- fig %>% layout(scene = list(xaxis = list(title = 'Edges'),
yaxis = list(title = 'Altstar2'),
zaxis = list(title = 'GWESP')),
annotations = list(
x = 1.13,
y = 1.05,
text = 'Generalised Cooks Dist',
xref = 'paper',
yref = 'paper',
showarrow = FALSE
))
fig
## Warning: `arrange_()` is deprecated as of dplyr 0.7.0.
## Please use `arrange()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
It is clear that the node that contributes the most to all statistics here is the most influential node
Printing the generalised Cooks distances it is clear that node in question is node 1
GCD$GCDMVP
## V1 V2 V3 V4 V5 V6 V7
## 2.83370200 0.81859831 1.07650195 1.08189227 0.17017831 0.24443105 0.08434240
## V8 V9 V10 V11 V12 V13 V14
## 0.10426107 0.59794348 0.14832566 0.15057507 0.06139388 0.15517531 0.82375354
## V15 V16 V17 V18
## 0.51367174 0.35777040 0.06748063 0.39894446
To get an idea of just how skewed the outlier scores are, we can plot them in a histogram
hist(GCD$GCDMVP)
Testing outlier score
While it is clear that one node node has a much higher influence score than others, we also know that we may end up with very high-degree nodes in graphs if the degree-distribution is skewed. So, how likely is it to get as high a score as 3.07?
We test this by a Monte Carlo by simulating \(Y^{(r)} \thicksim ERGM(\hat{\theta}_{\mathbf{ML}})\) and recalculating the GCD for all \(r=1,\ldots,R\).
Warning: this might take a while (also, Pavel broke some functionality so the current version is a bit slow)
MCMC.GCD.test <- test.gcd(greekBomb.net ~ edges+
altkstar(2, fixed=TRUE)+
gwesp(log(2), fixed=TRUE),
ergm.est=est,numreps=50,# number of replicate datasets used, R
nsim=1000,# number of samples of i's ties
burnin=100,# burnin for the samples of i's ties
thinning =1000,# thinning inbetween samples of i's ties
burnin.rep = 10000)# this is the burnin for replicate networks - probably should be large
## Calculating observed GCD for actor:
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
##
## Doing replicate number:
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## 10
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## 20
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## 30
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## 40
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## 50
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
Investigate results
The object MCMC.GCD.test
has two main objects
names(MCMC.GCD.test)
## [1] "GCDobs" "GCDReps"
Where GCDReps
is the node by rep, \(n \times R\) matrix of GCD scores across the \(R\) simulated networks. You can investigate these in many ways but one convenient way is to use
test.gcd.plot(MCMC.GCD.test)
## Actor GCDVMP p-val
## 1 V1 2.82665434 0.98
## 2 V2 0.81735082 0.98
## 3 V3 1.06539741 0.98
## 4 V4 1.07041244 0.98
## 5 V5 0.17097431 1.00
## 6 V6 0.24822851 1.00
## 7 V7 0.07228699 1.00
## 8 V8 0.09965990 0.98
## 9 V9 0.57950159 1.00
## 10 V10 0.16170067 1.00
## 11 V11 0.15441298 1.00
## 12 V12 0.06058251 1.00
## 13 V13 0.15627456 1.00
## 14 V14 0.81104295 1.00
## 15 V15 0.51000088 1.00
## 16 V16 0.35000564 1.00
## 17 V17 0.06393147 0.98
## 18 V18 0.40952055 1.00
## Actor GCDVMP p-val
## 1 V1 2.82665434 0.98
## 2 V2 0.81735082 0.98
## 3 V3 1.06539741 0.98
## 4 V4 1.07041244 0.98
## 5 V5 0.17097431 1.00
## 6 V6 0.24822851 1.00
## 7 V7 0.07228699 1.00
## 8 V8 0.09965990 0.98
## 9 V9 0.57950159 1.00
## 10 V10 0.16170067 1.00
## 11 V11 0.15441298 1.00
## 12 V12 0.06058251 1.00
## 13 V13 0.15627456 1.00
## 14 V14 0.81104295 1.00
## 15 V15 0.51000088 1.00
## 16 V16 0.35000564 1.00
## 17 V17 0.06393147 0.98
## 18 V18 0.40952055 1.00
The vertical reference line is the maximum score and the horizontal like is the \(\Pr(S^{(n)}<k)\), where \(S^{(1)},\ldots,S^{(n)}\) are the ordered scores.
This is the CDF of the maximum GCD score - is our actor number 1 really extreme?
ERGM with attributes
You might have thought that since the previous model did not have any attributes, the simulated conditional expectations \(E_{\hat{\theta}_{\mathbf{ML}}} \left[ z(Y)|Y_{jk}=y_{jk},j,k \in V \backslash \{i\}\right]\) should be the same for all \(i\), provided we condition on a simulated networks \(Y\). That is absolutely right! We really do not need to calculate the GCDs for every actor in our Monte Carlo.
If we have attributes, however, then we expect some actors to have, say, higher degree because of their attributes.
Lazega
Load the Lazega lawfirm partner data set (Lazega 2001).
temp <- tempfile()
download.file("https://www.stats.ox.ac.uk/~snijders/siena/LazegaLawyers.zip", temp)
LazLawer <- fread(unzip(temp, files = "ELwork36.dat"))
LasAtt <- fread(unzip(temp, files = "ELattr.dat"))
rm(temp)
LazLawer <- as.matrix(LazLawer)
senior <- LasAtt[,1]
sex <- LasAtt[,3]-1
office <- LasAtt[,4]
LazNet <- network(LazLawer,
directed = FALSE)
LazNet %v% "practice" <- LasAtt[,7]-1
LazNet %v% "senior" <- senior/36
LazNet %v% "sex" <- sex
LazNet %v% "office" <- office
Have a look
plot( LazNet ,
vertex.cex = degree(LazNet,gmode="digraph" )/max(degree(LazNet,gmode="digraph" ))+1,
vertex.col = "practice", edge.col='grey')
Estimate model
m3 <- ergm(LazNet ~ edges
+ nodecov("practice")
+ nodecov("senior")
+ match("practice")
+ match("sex")
+ match("office")
+ gwesp(0.7781, fixed = TRUE),control=control.ergm(MCMC.samplesize=5000,MCMC.interval=5000))
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: `set_attrs()` is deprecated as of rlang 0.3.0
## This warning is displayed once per session.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
Inspect results
summary(m3)
##
## ==========================
## Summary of model fit
## ==========================
##
## Formula: LazNet ~ edges + nodecov("practice") + nodecov("senior") + match("practice") +
## match("sex") + match("office") + gwesp(0.7781, fixed = TRUE)
##
## Iterations: 2 out of 20
##
## Monte Carlo MLE Results:
## Estimate Std. Error MCMC % z value Pr(>|z|)
## edges -6.5065 0.5790 0 -11.238 < 1e-04 ***
## nodecov.practice 0.4091 0.1160 0 3.526 0.000422 ***
## nodecov.senior 0.8517 0.2368 0 3.597 0.000322 ***
## nodematch.practice 0.7591 0.1948 0 3.897 < 1e-04 ***
## nodematch.sex 0.7011 0.2544 0 2.756 0.005849 **
## nodematch.office 1.1452 0.1945 0 5.887 < 1e-04 ***
## gwesp.fixed.0.7781 0.8982 0.1474 0 6.094 < 1e-04 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Null Deviance: 873.4 on 630 degrees of freedom
## Residual Deviance: 457.6 on 623 degrees of freedom
##
## AIC: 471.6 BIC: 502.7 (Smaller is better.)
Check convergence
convergence.test(LazNet ~ edges +
nodecov("practice")+
nodecov("senior")+
match("practice")+
match("sex") +
match("office")+
gwesp(0.7781, fixed = TRUE),
ergm.est=m3,# parameters are taked from the estimation
multiplication.factor=30,# this is the same multiplication factor as in MPNet
nsim= 1000)
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## coef se convergence t SACF
## edges -6.5064845 0.5789576 0.03990178 0.06182609
## nodecov.practice 0.4091122 0.1160368 0.01516211 0.04673909
## nodecov.senior 0.8517138 0.2367810 0.04011018 0.05001454
## nodematch.practice 0.7591331 0.1947709 0.04858649 0.05973165
## nodematch.sex 0.7010655 0.2543587 0.05527992 0.08245520
## nodematch.office 1.1452017 0.1945311 0.02208252 0.03178745
## gwesp.fixed.0.7781 0.8982200 0.1473822 0.03015685 0.04965234
Calculate outlier scores
GCD <- ergm.gcd(LazNet ~ edges +
nodecov("practice")+
nodecov("senior")+
match("practice")+
match("sex") +
match("office")+
gwesp(0.7781, fixed = TRUE),
ergm.est=m3,
nsim= 1000,
burnin=3000,
thinning = 100)
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Calculating GCD for actor:
## 1
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 2
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 3
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 4
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 5
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 6
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 7
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 8
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 9
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 10
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 11
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 12
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 13
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 14
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 15
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 16
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 17
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 18
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 19
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 20
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 21
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 22
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 23
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 24
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 25
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 26
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 27
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 28
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 29
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 30
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 31
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 32
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 33
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 34
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 35
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## 36
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'nodecov' in package 'ergm': Network size or bipartite group
## size is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
## Warning: In term 'match' in package 'ergm': Network size or bipartite group size
## is not a multiple of the length of vertex attributes.
# these defaults can be altered to make computations quicker or to increase precision
Inspect the scores for Lazega
The scores
GCD$GCDMVP
## V1 V2 V3 V4 V5 V6 V7
## 0.05343509 0.13048144 0.08943292 0.10657638 0.27238258 0.10862898 0.27606511
## V8 V9 V10 V11 V12 V13 V14
## 0.14896399 0.27494553 0.68825687 0.08230309 0.24154105 0.15851463 0.05259329
## V15 V16 V17 V18 V19 V20 V21
## 2.02963389 0.27821151 0.34367830 0.24191925 0.04896191 0.01532272 0.15439221
## V22 V23 V24 V25 V26 V27 V28
## 0.28566681 0.24415972 0.21340499 0.19182691 0.45348481 0.21059930 0.77450609
## V29 V30 V31 V32 V33 V34 V35
## 0.65317627 0.10927788 0.84476593 0.47289100 0.23979224 0.28360862 0.32845855
## V36
## 0.45118797
should be the same as in column MDMVP in Table 2 in Koskinen et al. (2018).
gcd.scores <- data.frame(edges=GCD$expected.stats[,1],altkstar.2=GCD$expected.stats[,6],gwesp = GCD$expected.stats[,7],gcd.mvp= GCD$GCDMVP)
fig <- plot_ly(gcd.scores, x = ~edges, y = ~altkstar.2, z = ~gwesp,
marker = list(color = ~gcd.mvp, colorscale = c('#FFE1A1', '#683531'), showscale = TRUE))
fig <- fig %>% add_markers()
fig <- fig %>% layout(scene = list(xaxis = list(title = 'Edges'),
yaxis = list(title = 'Office hom'),
zaxis = list(title = 'GWESP')),
annotations = list(
x = 1.13,
y = 1.05,
text = 'Generalised Cooks Dist',
xref = 'paper',
yref = 'paper',
showarrow = FALSE
))
fig
Actor 15 clearly adds a lot of triangles and edges and does not contribute a lot to office match
Bayesian estimation
If you are estiamting parameters using Bayesian estimation, rather than ML, then the following expectations can be used instead \[ E_{\theta| Y_{\mathrm{obs}}} \left\{ E\left[ z(Y)|Y_{jk}=y_{jk},j,k \in V \backslash \{i\},\theta\right] \right\}-z(Y_{\mathrm{obs}}) \] where the outer expectation is with respect to the posterior \(p(\theta \mid Y_{\mathrm{obs}})\).
Bayesian outliers
Load the florentine data set
data(florentine)
Run estimation
Just run the simulation with one chain
# Posterior parameter estimation:
p.flo <- bergm(flomarriage ~ edges + kstar(2),
burn.in = 50,
aux.iters = 500,
main.iters = 1000)
## > MCMC start
summary(p.flo)
##
## Posterior Density Estimate for Model: y ~ edges + kstar(2)
##
## Mean SD Naive SE Time-series SE
## theta1 (edges) -1.29839753 0.7663665 0.012117318 0.06392302
## theta2 (kstar2) -0.08112078 0.1603257 0.002534972 0.01279014
##
## 2.5% 25% 50% 75% 97.5%
## theta1 (edges) -2.6421648 -1.822519 -1.34665640 -0.79979027 0.2595328
## theta2 (kstar2) -0.4329601 -0.180103 -0.06702454 0.03486567 0.1891226
##
## Acceptance rate: 0.47
##
##
Run outlier calculation
GCD <- ergm.gcd(flomarriage ~ edges + kstar(2),
ergm.est=p.flo,
nsim= 100,#
burnin=100,# this becomes the thinning in the Bayesian version
thinning = 100)
## ergm.est is bergm output, Bayesian GCD will be tried
## Warning: 'ergm.getmodel' is deprecated.
## Use 'ergm_model' instead.
## See help("Deprecated")
## Warning: 'ergm.getglobalstats' is deprecated.
## Use 'summary.ergm_model' instead.
## See help("Deprecated")
## Calculating GCD for actor:
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Results
Check out the outlier scores
GCD$GCDMVP
## Acciaiuoli Albizzi Barbadori Bischeri Castellani Ginori
## 0.278801428 0.030207670 0.061497818 0.028982295 0.067862049 0.094796308
## Guadagni Lamberteschi Medici Pazzi Peruzzi Pucci
## 0.345394400 0.157277038 0.716718656 0.126933392 0.013061934 0.451474406
## Ridolfi Salviati Strozzi Tornabuoni
## 0.168462466 0.008513728 0.169149377 0.151071546
Medici tops the group but is their score extreme?
plot(GCD$expected.stats[,1],GCD$GCDMVP,pch=3,xlab=range( GCD$observed.stats[,1],GCD$expected.stats[,1]))
text(GCD$expected.stats[,1],GCD$GCDMVP,labels =names(GCD$GCDMVP) )
References
Koskinen, Johan, Peng Wang, Garry Robins, and Philippa Pattison. 2018. “Outliers and Influential Observations in Exponential Random Graph Models.” Psychometrika 83 (4). Springer: 809–30.
Lazega, Emmanuel. 2001. The Collegial Phenomenon: The Social Mechanisms of Cooperation Among Peers in a Corporate Law Partnership. Oxford University Press on Demand.
Wang, Peng, Garry Robins, Philippa Pattison, and Johan H Koskinen. 2014. “MPNet: Program for the Simulation and Estimation of (P*) Exponential Random Graph Models for Multilevel Networks.” Melbourne: Melbourne School of Psychological Sciences, the University of Melbourne.