1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.R
\name{plot.lvm}
\alias{plot.lvm}
\alias{plot.lvmfit}
\title{Plot path diagram}
\usage{
\method{plot}{lvm}(
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,
...
)
}
\arguments{
\item{x}{Model object}
\item{diag}{Logical argument indicating whether to visualize
variance parameters (i.e. diagonal of variance matrix)}
\item{cor}{Logical argument indicating whether to visualize
correlation parameters}
\item{labels}{Logical argument indiciating whether to add labels
to plot (Unnamed parameters will be labeled p1,p2,...)}
\item{intercept}{Logical argument indiciating whether to add
intercept labels}
\item{addcolor}{Logical argument indiciating whether to add colors
to plot (overrides \code{nodecolor} calls)}
\item{plain}{if TRUE strip plot of colors and boxes}
\item{cex}{Fontsize of node labels}
\item{fontsize1}{Fontsize of edge labels}
\item{noplot}{if TRUE then return \code{graphNEL} object only}
\item{graph}{Graph attributes (Rgraphviz)}
\item{attrs}{Attributes (Rgraphviz)}
\item{unexpr}{if TRUE remove expressions from labels}
\item{addstyle}{Logical argument indicating whether additional
style should automatically be added to the plot (e.g. dashed
lines to double-headed arrows)}
\item{plot.engine}{default 'Rgraphviz' if available, otherwise
visNetwork,igraph}
\item{init}{Reinitialize graph (for internal use)}
\item{layout}{Graph layout (see Rgraphviz or igraph manual)}
\item{edgecolor}{if TRUE plot style with colored edges}
\item{graph.proc}{Function that post-process the graph object
(default: subscripts are automatically added to labels of the
nodes)}
\item{...}{Additional arguments to be passed to the low level
functions}
}
\description{
Plot the path diagram of a SEM
}
\examples{
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))
}
}
\author{
Klaus K. Holst
}
\keyword{hplot}
\keyword{regression}
|