Description Usage Arguments Value References Examples

This function estimates a FERGM

1 2 |

`net` |
A network object that is to be explained using the right_hand_vars argument. |

`form` |
A character string specified as "ergm.term1 + ergm.term2", must be terms supported for ERGMs. |

`seed` |
An integer that sets the seed for the random number generator to assist in replication. Defaults to 12345. Set to null to prevent internal seed setting. |

`chains` |
An integer that sets the number of Markov chains that should be used by Stan. |

`warmup` |
The number of warm up or burn-in iterations that should be used before posterior draws are taken. Defaults to 100. |

`iter` |
The number of total number of samples that should be taken including warm ups Defaults to 600 total iterations, leading to a posterior sample size of 500. |

`cores` |
The number of cores to used should parallel processing be desired. Defaults to 1. |

This function returns a list that includes the Stan output (stan.fit), the data object passed to Stan (stan.dta), and the original formula (form).

Box-Steffensmeier, Janet M., Dino P. Christenson, and Jason W. Morgan. 2018. â€śModeling Unobserved Heterogeneity in Social Networks with the Frailty Exponential Random Graph Model." *Political Analysis*. (26)1:3-19.

Stan Development Team (2016). RStan: the R interface to Stan. R package version 2.14.1. http://mc-stan.org/.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
## Not run:
set.seed(1)
data("faux.mesa.high")
mesa <- faux.mesa.high
mesa.fit <- ergm::ergm(mesa ~ edges +
nodematch('Sex') +
nodematch('Grade', diff = FALSE) +
nodematch('Race', diff = FALSE) +
gwesp(decay = 0.2, fixed = TRUE) +
altkstar(lambda = 0.6, fixed = TRUE))
library(fergm)
form <- c("edges + nodematch('Sex') + nodematch('Grade', diff = FALSE) +
nodematch('Race', diff = FALSE) +
gwesp(decay = 0.2, fixed = TRUE) + altkstar(lambda = 0.6, fixed = TRUE)")
fergm.fit <- fergm(net = mesa, form = form, chains = 2)
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.