bootNet
outputsCreates various types of plot to visualize bootNet
objects.
plotBoot(
x,
type = "edges",
net = "temporal",
plot = "all",
cor = 0.7,
order = "mean",
ci = 0.95,
pairwise = TRUE,
interactions = TRUE,
labels = NULL,
title = NULL,
cis = "quantile",
true = NULL,
errbars = FALSE,
vline = FALSE,
threshold = FALSE,
difference = FALSE,
color = FALSE,
text = FALSE,
textPos = "value",
multi = NULL,
directedDiag = FALSE,
...
)# S3 method for bootNet
plot(
x,
type = "edges",
net = "temporal",
plot = "all",
cor = 0.7,
order = "mean",
ci = 0.95,
pairwise = TRUE,
interactions = TRUE,
labels = NULL,
title = NULL,
cis = "quantile",
true = NULL,
errbars = FALSE,
vline = FALSE,
threshold = FALSE,
difference = FALSE,
color = FALSE,
text = FALSE,
textPos = "value",
multi = NULL,
directedDiag = FALSE,
...
)
Output from bootNet
. Also some compatiblity with
resample
objects (when sampMethod != 'stability').
The outcome measure to plot. Options include: "edges",
"strength", "ei", "outstrength", "instrength", "outei", "inei"
. The "out-"
and "in-" options are only available for temporal networks. Moreover, both
related options can be used together in temporal networks, by setting
either type = c("outstrength", "instrength")
or type =
c("outei", "inei")
.
Determines which network to plot coefficients for. Options
include: "ggm", "temporal", "contemporaneous", "between"
. Only
relevant to SUR networks or mlGVAR
objects.
Primary use is to set as "none"
or FALSE
in order
to return a table containing the constituents of the plot rather than
create the plot itself. The options "all"
and "both"
each
essentially indicate that both pairwise and interaction terms are plotted.
Can also specify "pairwise"
to only plot the pairwise terms, or
"interactions"
to only plot the interaction terms.
Numeric value to indicate the correlation stability value to be plotted. Only applies to the case-drop bootstrapping output.
Determines how to arrange the predictors displayed in the plot.
If TRUE
, then defaults to "mean"
. If FALSE
then
defaults to "id"
. The "mean"
option will arrange the values
by the bootstrapped sample means. The "sample"
option will arrange
the values according to the statistics from the model fitted to the full
sample. The "id"
option will keep the variables in the same order
that they appear in the dataframe. Not relevant to the case-drop bootstrap.
Numeric value between 0 and 1 to specify the confidence level.
Logical. Whether to plot pairwise relationships. Defaults to
TRUE
. If FALSE
, this will override the "all"
option of
the plot
argument.
Logical. Whether to plot interactions. Defaults to
TRUE
. If FALSE
, this will override the "all"
option of
the plot
argument. Only relevant to moderated networks.
Logical. Determines whether to plot names of the predictors.
Character vector the title label.
Either "quantile"
or "se"
. If "quantile"
,
then confidence bands will be computed based on quantiles (specified by the
ci
argument) of the bootstrapped resamples. If "se"
, then the
confidence bands will be computed based on the standard errors associated
with the sample statistics. Thus, the "se"
argument will always
produce a symmetric confidence band, whereas for "quantile"
argument
this is not necessary. Not relevant to outputs for the case-drop bootstrap.
Defaults to NULL
, not relevant for the case-drop
bootstrap. Can supply another output from fitNetwork
, or an
adjacency matrix, to serve as the true network in the plot. If there are
interactions in the model, then a fitNetwork
object is
recommended. Alternatively, this argument can be extremely useful for
simulated data -- especially anything created with simNet
.
For whatever outcome (e.g., edges, strength, EI
) is plotted,
supplying another object to true
will plot the values related to the
true network, i.e., the data-generating model.
Logical. Not relevant to the case-drop bootstrap. If
TRUE
, then error bars are used rather than confidence bands. Can be
useful to home in on specific variables and see their confidence interval.
Logical or numeric. Not relevant to the case-drop bootstrap. If
TRUE
, then a dashed vertical line will be plotted at 0. If numeric,
then the line will be plotted at the supplied intercept on the x-axis.
Numeric or logical. Not relevant to the case-drop bootstrap.
Has a significant effect on the bootstrapped coefficient distributions. If
TRUE
, then the default p-value threshold is set to .05. A numeric
value can specify a different threshold. Causes the bootNet
function to run the object again, only to re-compute the bootstrapped
distributions after applying a p-value threshold to the results of each
model iteration. If NULL
, all coefficient estimates are used in
estimating the posterior distribution of each parameter.
Logical. Not relevant to the case-drop bootstrap. If
TRUE
, then a difference plot is provided rather than a coefficient
plot. In the difference plot, the diagonal squares reflect the fitted
network coefficients for the the original sample. Black boxes indicate that
the difference between the two edges, coefficients, or centrality values
being compared is significantly different from 0. The significance level
will have already been determined by the parameters used to fit the
bootNet
object. Gray boxes indicate the difference is not
significantly different from 0.
Logical. Only applies when difference = TRUE
. Determines
whether to add colors that reflect the sign of the sample values. Reflected
in the diagonal of the difference plot.
Logical. For difference plots, if TRUE
then the statistics
based on the full sample will be labeled in the diagonal boxes. For
coefficient plots, setting this to TRUE
will plot a label for each
variable to reflect the proportion of times that it was selected across all
bootstrapped iterations. Only relevant if a threshold was set for the
fitted bootstrap models, either specified in the current function or was
specified in creating the bootNet
object. If a numeric value
is provided, this will determine the size of the text label. Defaults to
1.2 when text = TRUE
.
Supports the text
argument for coefficient plots.
Indicates the x-axis position of where to plot the coefficient labels.
Generally will be numeric, but defaults to "value"
, which means that
the text will be labeled on top each point on the plot.
Useful when there are interactions in a model. If TRUE
,
the single plot with a facet for both pairwise and interaction terms is
split into two separate plots. Allows for a more elegant side-by-side plot,
and allows arguments that are restricted for plots of either pairwise or
interactions (such as text
) are plotted. This argument will
eventually be expanded to allow one to plot combinations of edge and
centrality plots.
See corresponding argument in the bootNet
.
function.
Additional arguments.
A coefficient plot, difference plot, or correlation-stability plot.
When plot %in% c('none', FALSE)
, the table used to construct the
relevant plot will be returned as output instead.
# NOT RUN {
boot1 <- bootNet(ggmDat, caseDrop = TRUE)
plot(boot1)
plotBoot(boot1) # This functions the same as the command above
boot2 <- bootNet(ggmDat)
plot(boot2)
plot(boot2, difference = TRUE)
# }
Run the code above in your browser using DataLab