Implements the bootstrapping method described in Snijders and Borgatti (1999).
This function is essentially a wrapper of boot
.
resample_graph(graph, self = NULL, useR = FALSE, ...) bootnet(graph, statistic, R, resample.args = list(self = FALSE), ...) # S3 method for diffnet_bootnet c(..., recursive = FALSE) # S3 method for diffnet_bootnet print(x, ...) # S3 method for diffnet_bootnet hist( x, main = "Empirical Distribution of Statistic", xlab = expression(Values ~ of ~ t), breaks = 20, annotated = TRUE, b0 = expression(atop(plain("") %up% plain("")), t[0]), b = expression(atop(plain("") %up% plain("")), t[]), ask = TRUE, ... )
graph | Any class of accepted graph format (see |
---|---|
self | Logical scalar. When |
useR | Logical scalar. When |
... | Further arguments passed to the method (see details). |
statistic | A function that returns a vector with the statistic(s) of interest. The first argument must be the graph, and the second argument a vector of indices (see details) |
R | Number of reps |
resample.args | List. Arguments to be passed to |
recursive | Ignored |
x | A |
main | Character scalar. Title of the histogram. |
xlab | Character scalar. x-axis label. |
breaks | Passed to |
annotated | Logical scalar. When TRUE marks the observed data average and the simulated data average. |
b0 | Character scalar. When |
b | Character scalar. When |
ask | Logical scalar. When |
A list of class diffnet_bootnet
containing the following:
The graph passed to bootnet
.
The resulting p-value of the test (see details).
The observed value of the statistic.
The average value of the statistic applied to the simulated networks.
A vector of length length(t0)
. Bootstrap variances.
Number of simulations.
The function statistic
passed to bootnet
.
A boot
class object as return from the call to boot
.
The list resample.args
passed to bootnet
.
Just like the boot
function of the boot package, the statistic
that is passed must have as arguments the original data (the graph in this case),
and a vector of indicides. In each repetition, the graph that is passed is a
resampled version generated as described in Snijders and Borgatti (1999).
When self = FALSE
, for pairs of individuals that haven been drawn more than
once the algorithm, in particular, resample_graph
, takes care of filling
these pseudo autolinks that are not in the diagonal of the network. By default
it is assumed that these pseudo-autolinks depend on whether the original graph
had any, hence, if the diagonal has any non-zero value the algorithm assumes that
self = TRUE
, skiping the 'filling algorithm'. It is important to notice
that, in order to preserve the density of the original network, when
assigning an edge value to a pair of the form \((i,i)\) (pseudo-autolinks),
such is done with probabilty proportional to the density of the network, in
other words, before choosing from the existing list of edge values, the
algorithm decides whether to set a zero value first.
The vector of indices that is passed to statistic
, an integer vector with range
1 to \(n\), corresponds to the drawn sample of nodes, so the user can, for
example, use it to get a subset of a data.frame
that will be used with
the graph
.
Snijders, T. A. B., & Borgatti, S. P. (1999). Non-Parametric Standard Errors and Tests for Network Statistics. Connections, 22(2), 1–10. Retrieved from https://www.stats.ox.ac.uk/~snijders/Snijders_Borgatti.pdf
Other Functions for inference:
moran()
,
struct_test()
#> #> Network Bootstrap (Snijders and Borgatti, 1999) #> # Num. of draws : 100 #> # nodes : 100 #> # of time periods : 1 #> -------------------------------------------------------------------------------- #> original bias std. error p.val #> 100.0000 -2.9400 28.9576 0.0000