xergm-package | R Documentation |
Extensions of Exponential Random Graph Models (ERGM).
The xergm package implements extensions of exponential random
graph models, in particular Temporal ERGMs (btergm),
Generalized ERGMs (GERGM), and Relational Event Models (rem).
This package acts as a meta-package for the packages btergm,
GERGM, rem, and xergm.common. To display citation
information, type citation("xergm")
.
Philip Leifeld (https://www.philipleifeld.com)
Skyler J. Cranmer (https://polisci.osu.edu/people/cranmer.12)
Bruce A. Desmarais (https://sites.psu.edu/desmaraisgroup/)
## Not run:
# example: temporal exponential random graph model (see ?btergm)
library("statnet")
set.seed(5)
networks <- list()
for(i in 1:10){ # create 10 random networks with 10 actors
mat <- matrix(rbinom(100, 1, .25), nrow = 10, ncol = 10)
diag(mat) <- 0 # loops are excluded
nw <- network(mat) # create network object
networks[[i]] <- nw # add network to the list
}
covariates <- list()
for (i in 1:10) { # create 10 matrices as covariate
mat <- matrix(rnorm(100), nrow = 10, ncol = 10)
covariates[[i]] <- mat # add matrix to the list
}
fit <- btergm(networks ~ edges + istar(2) +
edgecov(covariates), R = 100)
summary(fit) # show estimation results
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.