if (FALSE) { # rlang::is_installed("ergm")
# load libraries for models and data
library(ergm)
# load the Florentine marriage network data
data(florentine)
# fit a model where the propensity to form ties between
# families depends on the absolute difference in wealth
gest <- ergm(flomarriage ~ edges + absdiff("wealth"))
# show terms, coefficient estimates and errors
tidy(gest)
# show coefficients as odds ratios with a 99% CI
tidy(gest, exponentiate = TRUE, conf.int = TRUE, conf.level = 0.99)
# take a look at likelihood measures and other
# control parameters used during MCMC estimation
glance(gest)
glance(gest, deviance = TRUE)
glance(gest, mcmc = TRUE)
}
Run the code above in your browser using DataLab