Core function for plotting various types of network models. Accessible
through the plot()
S3 generic function.
plotNet(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)# S3 method for ggm
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
# S3 method for SURnet
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
# S3 method for mlGVAR
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
# S3 method for lmerVAR
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
# S3 method for ggmSim
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
# S3 method for mlGVARsim
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
# S3 method for GVARsim
plot(
x,
which.net = "temporal",
threshold = FALSE,
layout = "spring",
predict = FALSE,
mnet = FALSE,
names = TRUE,
nodewise = FALSE,
scale = FALSE,
lag = NULL,
con = "R2",
cat = "nCC",
covNet = FALSE,
plot = TRUE,
elabs = FALSE,
elsize = 1,
rule = "OR",
binarize = FALSE,
mlty = TRUE,
mselect = NULL,
...
)
Output from any of the modnets
model fitting or simulation
functions.
When multiple networks exist for a single object, this
allows the user to indicate which network to plot. For a GGM, all values of
this argument return the same adjacency matrix. For a SUR network,
"beta"
and "temporal"
plot the temporal network, while
"pdc"
plots the Partial Directed Correlations, or the standardized
temporal network. "contemporaneous"
and "pcc"
plot the
standardized contemporaneous network (Partial Contemporaneous
Correlations). All of these terms apply for multilevel networks, but
"between"
can also plot the between-subjects network. Additionally,
the value "coef"
will plot the model coefficients and confidence
intervals, defaulting to the plotCoefs
function. Moreover,
with GGMs or outputs from mlGVAR
with a moderated
between-subjects network, the value "ints"
will call the
intsPlot
function. If a numeric or logical value is supplied,
however, this argument will function as the threshold
argument. A
numeric value will set a threshold at the supplied value, while TRUE
will set a threshold of .05.
A numeric or logical value to set a p-value threshold.
TRUE
will automatically set the threshold at .05.
Character. Corresponds to the layout
argument in the
qgraph::qgraph
function.
If TRUE
, then prediction error associated with each
node will be plotted as a pie graph around the nodes. For continuous
variables, the type of prediction error is determined by the con
argument. For categorical variables, the type of error is determined by the
cat
argument. The desired value of con
or can
can be
supplied directly into the present argument as well. Alternatively, another
network model constituted by the same nodes can be supplied in order to
plot the difference in prediction error, such as R-squared change.
Logical. If TRUE
, the moderator will be plotted as a
square "node" in the network, along with main effects represented as
directed edges.
If TRUE
, then the variable names associated with the
model will be plotted as labels on the nodes. If FALSE
, then nodes
will be labeled with numbers rather than names. Alternatively, a character
vector can be provided to serve as custom labels for the nodes.
Only applies to GGMs. If TRUE
, then nodewise edges
will be plotted rather than the undirected averages of corresponding edges.
Logical. Only applies when predict
does not equal
FALSE
. The value of this argument is sent to the
predictNet
function. This argument will be removed.
This argument will be removed. The function will automatically detect whether the network is based on time-lagged data.
Character string indicating which type of prediction error to plot
for continuous variables, if predict
does not equal FALSE
.
Options are: "R2", "adjR2", "MSE", "RMSE"
Character string indicating which type of prediction error to plot
for categorical variables, if predict
does not equal FALSE
.
Options are: "nCC", "CC", "CCmarg"
Logical. Only applies when a covariate is modeled. Allows the covariate to be plotted as a separate square "node".
Logical. If FALSE
, then a qgraph
object will be
returned rather than plotted.
Logical. If TRUE
, the values of the edges will be plotted
as labels on the edges.
numeric
Only applies to GGMs (including between-subjects networks) when a
threshold is supplied. The "AND"
rule will only preserve edges when
both corresponding coefficients have p-values below the threshold, while
the "OR"
rule will preserve an edge so long as one of the two
coefficients have a p-value below the supplied threshold.
Logical. If TRUE
, the network will be plotted as an
unweighted network. Only applies to GGMs.
Logical. If FALSE
, then moderated edges are displayed as
solid lines. If TRUE
, then moderated edges are shown as dashed
lines.
If the model contains more than one moderator, input the
character string naming which moderator you would like the plot to reflect.
Only affects which lines are dashed or solid. Not compatible with the
mnet
argument.
Additional arguments.
Displays a network plot, or returns a qgraph
object if
plot = FALSE
.
fitNetwork, predictNet, mlGVAR,
lmerVAR, simNet, mlGVARsim, plotCoefs,
intsPlot, resample
# NOT RUN {
fit1 <- fitNetwork(ggmDat)
plot(fit1)
plotNet(fit1) # This and the command above produce the same result
fit2 <- fitNetwork(gvarDat, moderators = 'M', lags = 1)
plot(fit2, 'pdc') # Partial Directed Correlations
plot(fit2, 'pcc') # Partial Contemporaneous Correlations
# }
Run the code above in your browser using DataLab