Learn R Programming

xergm (version 1.5.3)

plot.btergmgof: Plot or print btergmgof objects

Description

Plot or print formatted goodness-of-fit statistics and degeneracy checks from btergmgof objects.

Usage

## S3 method for class 'btergmgof':
plot(x, boxplot = TRUE, boxplot.mfrow = TRUE, 
    boxplot.dsp = TRUE, boxplot.esp = TRUE, boxplot.geodist = TRUE, 
    boxplot.degree = TRUE, boxplot.idegree = TRUE, 
    boxplot.odegree = TRUE, boxplot.kstar = TRUE, boxplot.istar = TRUE, 
    boxplot.ostar = TRUE, boxplot.dsp.max = NULL, 
    boxplot.esp.max = NULL, boxplot.geodist.max = NULL, 
    boxplot.degree.max = NULL, boxplot.idegree.max = NULL, 
    boxplot.odegree.max = NULL, boxplot.kstar.max = NULL, 
    boxplot.istar.max = NULL, boxplot.ostar.max = NULL, 
    boxplot.transform = function(x) x, boxplot.border = "darkgray", 
    boxplot.mean.col = "black", boxplot.median.col = "black", 
    boxplot.lwd = 0.8, boxplot.outline = FALSE, boxplot.ylab = "Frequency", 
    boxplot.main = NULL, boxplot.ylim = NULL, roc = TRUE, pr = TRUE, 
    rocpr.add = FALSE, rocpr.avg = c("none", "horizontal", "vertical", 
    "threshold"), rocpr.spread = c("boxplot", "stderror", "stddev"), 
    rocpr.lwd = 3, roc.main = NULL, roc.random = FALSE, roc.col = "#bd0017", 
    roc.random.col = "#bd001744", pr.main = NULL, pr.random = FALSE, 
    pr.col = "#5886be", pr.random.col = "#5886be44", pr.poly = 0, ...)

## S3 method for class 'btergmgof': print(x, classicgof = TRUE, rocprgof = TRUE, degeneracy = TRUE, ...)

## S3 method for class 'btergmgof': summary(object, classicgof = TRUE, rocprgof = TRUE, degeneracy = TRUE, ...)

Arguments

x
A btergmgof object created by calling the gof.btergm method.
boxplot
Create a plot where simulated statistics are summarized as boxplots and observed networks as lines (= classic statnet-style GOF plots)?
boxplot.mfrow
Should the classic GOF plots come out separately (boxplot.mfrow = FALSE), or should all statistics be aligned in a single diagram (boxplot.mfrow = TRUE)? Returning the plots separately can be helpful if the output is redirected t
boxplot.dsp
Plot a GOF diagram for dyad-wise shared partners?
boxplot.esp
Plot a GOF diagram for edge-wise shared partners?
boxplot.geodist
Plot a GOF diagram for geodesic distances?
boxplot.degree
Plot a GOF diagram for the degree distribution?
boxplot.idegree
Plot a GOF diagram for the indegree distribution?
boxplot.odegree
Plot a GOF diagram for the outdegree distribution?
boxplot.kstar
Plot a GOF diagram for the kstar distribution?
boxplot.istar
Plot a GOF diagram for the instar distribution?
boxplot.ostar
Plot a GOF diagram for the outstar distribution?
boxplot.dsp.max
Upper bound of dyad-wise shared partners to report.
boxplot.esp.max
Upper bound of edge-wise shared partners to report.
boxplot.geodist.max
Upper bound of geodesic distances to report (excluding Inf values).
boxplot.degree.max
Upper bound of the degree statistic to report.
boxplot.idegree.max
Upper bound of the indegree statistic to report.
boxplot.odegree.max
Upper bound of the outdegree statistic to report.
boxplot.kstar.max
Upper bound of the kstar statistic to report.
boxplot.istar.max
Upper bound of the istar statistic to report.
boxplot.ostar.max
Upper bound of the ostar statistic to report.
boxplot.transform
A function which transforms the y values used for the boxplots. For example, if some of the values become very large and make the output illegible, boxplot.transform = function(x) x^0.1 or a similar transformation of the values can be used. N
boxplot.border
Color of the borders of the boxplots.
boxplot.mean.col
Color of the mean of the observed network statistic.
boxplot.median.col
Color of the median of the observed network statistic.
boxplot.lwd
Scaling factor for the line width of the boxplots and of the line for the observed network statistics.
boxplot.outline
Print outliers in the boxplots?
boxplot.ylab
Label of the y-axis of a GOF plot.
boxplot.main
Main title of a GOF plot. Note: The same main title is used for all resulting diagrams. To obtain diagrams with varying main titles, plot each statistic separately using a new call of the plot.btergm method.
boxplot.ylim
Vertical limit of the boxplots. Only the maximum value must be provided because the minimum is always 0. Providing a vertical limit may be sensible if multiple models have to be compared side by side.
roc
Should the ROC curve(s) be plotted?
pr
Should the precision-recall curve(s) be plotted?
rocpr.add
Add the ROC and/or PR curve to an existing plot?
rocpr.avg
Averaging pattern for the ROC and PR curve(s) if multiple target time steps were used. Allowed values are "none" (plot all curves separately), "horizontal" (horizontal averaging), "vertical" (vertical averaging), and
rocpr.spread
When multiple target time steps are used and curve averaging is enabled, the variation around the average curve can be visualized as standard error bars ("stderror"), standard deviation bars ("stddev"), or by using box plots (
rocpr.lwd
Line width of the ROC and PR curve(s).
roc.main
Main title of the ROC plot.
roc.random
Draw an additional ROC curve for random graphs with the same tie probability (as a reference value)?
roc.col
Color of the ROC curve(s). By default, a dark red color is used.
roc.random.col
Color of the random graph ROC curve.
pr.main
Main title of the ROC plot.
pr.random
Draw an additional PR curve for random graphs with the same tie probability (as a reference value)?
pr.col
Color of the precision-recall curve(s). By default, a blue color is used.
pr.random.col
Color of the random graph PR curve.
pr.poly
If a value of 0 is set, nothing special happens. If a value of 1 is set, a straight line is fitted through the PR curve and displayed. Values between 2 and 9 fit higher-order polynomial curves through th
classicgof
Print tables with t-tests comparing observed and simulated networks, as in statnet?
rocprgof
Print tables with the area under the curve (AUC) for the PR and ROC curves at each time step of the observed network(s)?
degeneracy
Print tables with t-tests comparing the global statistics of observed and simulated networks for each observed time step? This is essentially a degeneracy check.
object
A btergmgof object created by calling the gof.btergm method.
...
Further arguments. These arguments are passed on to the plot command. This facilitates customization of the plots.

Details

These methods plot or print nicely formatted goodness-of-fit statistics from btergmgof objects to the R console. The typical workflow is to estimate a TERGM using the btergm function and save it as an object, then use the gof function to produce a btergmgof object, and finally use the functions and methods described here to show the output of this resulting object to assess the goodness of fit.

The plot method plots (1) boxplots of network statistics and draws the observed statistics as lines (classic statnet-like GOF boxplots) and (2) receiver operating characteristics (ROC) and precision recall (PR) curves.

The print and summary methods show (1) observed versus simulated network statistics (classic statnet-like GOF tables), (2) the area under the ROC curve (AUC) for each observed network, and (3) degeneracy checks by comparing global statistics of simulated versus observed networks.

See Also

xergm-package btergm simulate.btergm gof