data(zach)
oldpal <- palette()
palette(gray((1:8)/8))
plot(zach, vertex.col="role", displaylabels=TRUE, edge.col="contexts")
palette(oldpal)
# \donttest{
# Fit a binomial-reference ERGM.
zach.fit1 <- ergm(zach~nonzero+sum+nodefactor("role",base=2)+absdiffcat("faction.id"),
response="contexts", reference=~Binomial(8))
mcmc.diagnostics(zach.fit1)
summary(zach.fit1)
# }
if (FALSE) {
# This is much slower.
zach.fit2 <- ergm(zach~nonzero+sum+nodefactor("role",base=2)+transitiveties,
response="contexts", reference=~Binomial(8),
eval.loglik=FALSE)
mcmc.diagnostics(zach.fit2)
summary(zach.fit2)
}
Run the code above in your browser using DataLab