Description Usage Arguments Details Value Methods (by class) Note See Also Examples
gof
calculates pvalues for geodesic distance, degree,
and reachability summaries to diagnose the goodnessoffit of exponential
family random graph models. See ergm
for more information on
these models.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39  gof(object, ...)
## S3 method for class 'ergm'
gof(
object,
...,
coef = coefficients(object),
GOF = NULL,
constraints = object$constraints,
control = control.gof.ergm(),
verbose = FALSE
)
## S3 method for class 'formula'
gof(
object,
...,
coef = NULL,
GOF = NULL,
constraints = ~.,
basis = eval_lhs.formula(object),
control = NULL,
unconditional = TRUE,
verbose = FALSE
)
## S3 method for class 'gof'
print(x, ...)
## S3 method for class 'gof'
plot(
x,
...,
cex.axis = 0.7,
plotlogodds = FALSE,
main = "Goodnessoffit diagnostics",
normalize.reachability = FALSE,
verbose = FALSE
)

object 
Either a formula or an 
... 
Additional arguments, to be passed to lowerlevel functions. 
coef 
When given either a formula or an object of class ergm,

GOF 
formula; an formula object, of the form 
constraints 
A onesided formula specifying one or more constraints on
the support of the distribution of the networks being modeled. See the help
for similarlynamed argument in 
control 
A list of control parameters for algorithm tuning,
typically constructed with 
verbose 
A logical or an integer to control the amount of
progress and diagnostic information to be printed. 
basis 
a value (usually a 
unconditional 
logical; if 
x 
an object of class 
cex.axis 
Character expansion of the axis labels relative to that for the plot. 
plotlogodds 
Plot the odds of a dyad having given characteristics (e.g., reachability, minimum geodesic distance, shared partners). This is an alternative to the probability of a dyad having the same property. 
main 
Title for the goodnessoffit plots. 
normalize.reachability 
Should the reachability proportion be normalized to make it more comparable with the other geodesic distance proportions. 
A sample of graphs is randomly drawn from the specified model. The first
argument is typically the output of a call to ergm
and the
model used for that call is the one fit.
For GOF = ~model
, the model's observed sufficient statistics are
plotted as quantiles of the simulated sample. In a good fit, the observed
statistics should be near the sample median (0.5).
By default, the sample consists of 100 simulated networks, but this sample
size (and many other settings) can be changed using the control
argument described above.
gof
, gof.ergm
, and
gof.formula
return an object of class gof.ergm
, which inherits from class gof
. This
is a list of the tables of statistics and pvalues. This is typically
plotted using plot.gof
.
ergm
: Perform simulation to evaluate goodnessoffit for
a specific ergm()
fit.
formula
: Perform simulation to evaluate goodnessoffit for
a model configuration specified by a formula
, coefficient,
constraints, and other settings.
gof
: print.gof
summaries the diagnostics such as the
degree distribution, geodesic distances, shared partner
distributions, and reachability for the goodnessoffit of
exponential family random graph models. See ergm
for
more information on these models. (summary.gof
is a deprecated
alias that may be repurposed in the future.)
gof
: plot.gof
plots diagnostics such as the degree
distribution, geodesic distances, shared partner distributions, and
reachability for the goodnessoffit of exponential family random graph
models. See ergm
for more information on these models.
For gof.ergm
and gof.formula
, default behavior depends on the
directedness of the network involved; if undirected then degree, espartners,
and distance are used as default properties to examine. If the network in
question is directed, “degree” in the above is replaced by idegree
and odegree.
ergm()
, network()
, simulate.ergm()
, summary.ergm()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  data(florentine)
gest < ergm(flomarriage ~ edges + kstar(2))
gest
summary(gest)
# test the gof.ergm function
gofflo < gof(gest)
gofflo
# Plot all three on the same page
# with nice margins
par(mfrow=c(1,3))
par(oma=c(0.5,2,1,0.5))
plot(gofflo)
# And now the logodds
plot(gofflo, plotlogodds=TRUE)
# Use the formula version of gof
gofflo2 <gof(flomarriage ~ edges + kstar(2), coef=c(1.6339, 0.0049))
plot(gofflo2)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.