Plot the path diagram of a SEM
# S3 method for lvm
plot(
x,
diag = FALSE,
cor = TRUE,
labels = FALSE,
intercept = FALSE,
addcolor = TRUE,
plain = FALSE,
cex,
fontsize1 = 10,
noplot = FALSE,
graph = list(rankdir = "BT"),
attrs = list(graph = graph),
unexpr = FALSE,
addstyle = TRUE,
plot.engine = lava.options()$plot.engine,
init = TRUE,
layout = lava.options()$layout,
edgecolor = lava.options()$edgecolor,
graph.proc = lava.options()$graph.proc,
...
)
Model object
Logical argument indicating whether to visualize variance parameters (i.e. diagonal of variance matrix)
Logical argument indicating whether to visualize correlation parameters
Logical argument indiciating whether to add labels to plot (Unnamed parameters will be labeled p1,p2,...)
Logical argument indiciating whether to add intercept labels
Logical argument indiciating whether to add colors
to plot (overrides nodecolor
calls)
if TRUE strip plot of colors and boxes
Fontsize of node labels
Fontsize of edge labels
if TRUE then return graphNEL
object only
Graph attributes (Rgraphviz)
Attributes (Rgraphviz)
if TRUE remove expressions from labels
Logical argument indicating whether additional style should automatically be added to the plot (e.g. dashed lines to double-headed arrows)
default 'Rgraphviz' if available, otherwise visNetwork,igraph
Reinitialize graph (for internal use)
Graph layout (see Rgraphviz or igraph manual)
if TRUE plot style with colored edges
Function that post-process the graph object (default: subscripts are automatically added to labels of the nodes)
Additional arguments to be passed to the low level functions
if (interactive()) {
m <- lvm(c(y1,y2) ~ eta)
regression(m) <- eta ~ z+x2
regression(m) <- c(eta,z) ~ x1
latent(m) <- ~eta
labels(m) <- c(y1=expression(y[scriptscriptstyle(1)]),
y2=expression(y[scriptscriptstyle(2)]),
x1=expression(x[scriptscriptstyle(1)]),
x2=expression(x[scriptscriptstyle(2)]),
eta=expression(eta))
edgelabels(m, eta ~ z+x1+x2, cex=2, lwd=3,
col=c("orange","lightblue","lightblue")) <- expression(rho,phi,psi)
nodecolor(m, vars(m), border="white", labcol="darkblue") <- NA
nodecolor(m, ~y1+y2+z, labcol=c("white","white","black")) <- NA
plot(m,cex=1.5)
d <- sim(m,100)
e <- estimate(m,d)
plot(e)
m <- lvm(c(y1,y2) ~ eta)
regression(m) <- eta ~ z+x2
regression(m) <- c(eta,z) ~ x1
latent(m) <- ~eta
plot(lava:::beautify(m,edgecol=FALSE))
}