if (FALSE) {
data(samplike)
fit_basic <- ernm(samplike ~ edges() + nodeCount("group") + nodeMatch("group") | group)
fit_tri <- ernm(samplike ~ edges() + nodeCount("group") + nodeMatch("group") + triangles() | group)
# how well is the triangle term fit?
gof <- ernm_gof(
list(
basic = fit_basic,
with_triangles = fit_tri
),
observed_network = samplike,
stats_formula = samplike ~ triangles(),
n_sim = 100
)
# look at the fit over all edgewise shared partners
gof <- ernm_gof(
list(
basic = fit_basic,
with_triangles = fit_tri
),
style="boxplot",
observed_network = samplike,
stats_formula = samplike ~ esp(1:10),
n_sim = 100
)
}
Run the code above in your browser using DataLab