plot()
produces SEM diagrams in graphviz format, and relies on DiagrammeR()
(or a
graphviz application) to create the image.
Note: DiagrammeR is supported out of the box. By default, plots open in your browser.
# S3 method for MxModel
plot(
x = NA,
std = FALSE,
fixed = TRUE,
means = TRUE,
digits = 2,
file = "name",
labels = c("none", "labels", "both"),
resid = c("circle", "line", "none"),
strip_zero = FALSE,
splines = c("TRUE", "FALSE", "compound", "ortho", "polyline"),
min = NULL,
same = NULL,
max = NULL,
...
)
An mxModel()
from which to make a path diagram
Whether to standardize the model (default = FALSE).
Whether to show fixed paths (defaults to TRUE)
Whether to show means or not (default = TRUE)
The number of decimal places to add to the path coefficients
The name of the dot file to write: NA = none; "name" = use the name of the model
Whether to show labels on the paths. "none", "labels", or "both" (parameter + label).
How to show residuals and variances default is "circle". Options are "line" & "none"
Whether to strip the leading "0" and decimal point from parameter estimates (default = FALSE)
Whether to allow lines to curve: defaults to "TRUE" (nb: some models look better with "FALSE")
optional list of objects to group at the top of the plot. Default (NULL) chooses automatically.
optional list of objects to group at the same rank in the plot. Default (NULL) chooses automatically.
optional list of objects to group at the bottom of the plot. Default (NULL) chooses automatically.
Optional parameters
If you use umx_set_plot_format("graphviz"), they will open in a graphviz helper app (if installed).
The commercial application “OmniGraffle” is great for editing these images.
On unix and windows, plot()
will create a pdf and open it in your default pdf reader.
If you use graphviz, we try and use that app, but YOU HAVE TO INSTALL IT!
MacOS note: On Mac, we will try and open an app: you may need to associate the ‘.gv’ extension with the graphviz app. Find the .gv file made by plot, get info (cmd-I), then choose “open with”, select graphviz.app (or OmniGraffle professional), then set “change all”.
Other umx S3 functions:
plot.MxLISRELModel()
Other Plotting functions:
plot.MxLISRELModel()
,
plot.MxModelTwinMaker()
,
umxPlotACEcov()
,
umxPlotACEv()
,
umxPlotACE()
,
umxPlotCP()
,
umxPlotDoC()
,
umxPlotFun()
,
umxPlotGxEbiv()
,
umxPlotGxE()
,
umxPlotIP()
,
umxPlotSexLim()
,
umxPlotSimplex()
,
umx
# NOT RUN {
require(umx)
data(demoOneFactor)
manifests = names(demoOneFactor)
m1 = umxRAM("One Factor", data = demoOneFactor, type = "cov",
umxPath("G", to = manifests),
umxPath(var = manifests),
umxPath(var = "G", fixedAt = 1)
)
plot(m1)
plot(m1, std = TRUE, resid = "line", digits = 3, strip_zero = FALSE)
# ============================================================
# = With a growth model, demonstrate splines= false to force =
# = straight lines, and move "rank" of intercept object =
# ============================================================
m1 = umxRAM("grow", data = myGrowthMixtureData,
umxPath(var = manifests, free = TRUE),
umxPath(means = manifests, fixedAt = 0),
umxPath(v.m. = c("int","slope")),
umxPath("int", with = "slope"),
umxPath("int", to = manifests, fixedAt = 1),
umxPath("slope", to = manifests, arrows = 1, fixedAt = c(0,1,2,3,4))
)
plot(m1, means=FALSE, strip=TRUE, splines="FALSE", max="int")
# }
# NOT RUN {
# end dontrun
# }
Run the code above in your browser using DataLab