Description Usage Arguments Value Author(s) References See Also Examples
pathDiagram
creates a description of the path diagram
for a structural-equation-model object to be processed by the
graph-drawing program dot, which can be called
automatically; see Koutsofios and North (2002)
and http://www.graphviz.org/. To obtain graphics output
directly, the dot program must be on the system search path.
1 2 3 4 5 6 7 8 | ## S3 method for class 'sem'
pathDiagram(model, file, min.rank=NULL, max.rank=NULL,
same.rank=NULL, variables=model$var.names, parameters=rownames(model$ram),
ignore.double=TRUE, edge.labels=c("names", "values", "both"),
size=c(8, 8), node.font=c("Helvetica", 14),
edge.font=c("Helvetica", 10), rank.direction=c("LR", "TB"),
digits=2, standardize=FALSE, output.type=c("graphics", "dot"),
graphics.fmt="pdf", dot.options=NULL, ...)
|
model |
a structural-equation-model object produced by |
... |
ignored. |
file |
a file name, given without an extension, to which to write the dot description of the
path diagram and, by default, to use that to draw a graph of the model;
if not specified, the dot description is written to standard output (normally the R Console).
Note that by default (see the |
min.rank |
a character string listing names of variables to be assigned minimum rank (order) in the graph; the names should be separated by commas. |
max.rank |
a character string listing names of variables to be assigned maximum rank in the graph; the names should be separated by commas. |
same.rank |
a character string or vector of character strings of variables to be assigned equivalent rank in the graph; names in each string should be separated by commas. |
variables |
variable names; defaults to the variable names in |
parameters |
parameter names; defaults to the parameter names in
|
ignore.double |
if |
edge.labels |
|
size |
the size of the graph, in inches. |
node.font |
font name and point-size for printing variable names. |
edge.font |
font name and point-size for printing arrow names or values. |
rank.direction |
draw graph left-to-right, |
digits |
number of digits after the decimal point (default, 2) to which to round parameter estimates. |
standardize |
if |
output.type |
if |
graphics.fmt |
a graphics format recognized by the dot program; the default is |
dot.options |
options to be passed to the dot program, given as a character string. |
NULL
: pathDiagram
is used for its side-effect, producing a
graph description of the model.
John Fox jfox@mcmaster.ca, Adam Kramer, and Michael Friendly
Koutsofios, E., and North, S. C. (2002) Drawing graphs with dot. http://www.graphviz.org/Documentation/dotguide.pdf.
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 | ## Not run:
# The Duncan, Haller, and Portes Peer-Influences Model
R.DHP <- readMoments(diag=FALSE, names=c('ROccAsp', 'REdAsp', 'FOccAsp',
'FEdAsp', 'RParAsp', 'RIQ', 'RSES', 'FSES', 'FIQ', 'FParAsp'))
.6247
.3269 .3669
.4216 .3275 .6404
.2137 .2742 .1124 .0839
.4105 .4043 .2903 .2598 .1839
.3240 .4047 .3054 .2786 .0489 .2220
.2930 .2407 .4105 .3607 .0186 .1861 .2707
.2995 .2863 .5191 .5007 .0782 .3355 .2302 .2950
.0760 .0702 .2784 .1988 .1147 .1021 .0931 -.0438 .2087
model.dhp <- specifyModel()
RParAsp -> RGenAsp, gam11, NA
RIQ -> RGenAsp, gam12, NA
RSES -> RGenAsp, gam13, NA
FSES -> RGenAsp, gam14, NA
RSES -> FGenAsp, gam23, NA
FSES -> FGenAsp, gam24, NA
FIQ -> FGenAsp, gam25, NA
FParAsp -> FGenAsp, gam26, NA
FGenAsp -> RGenAsp, beta12, NA
RGenAsp -> FGenAsp, beta21, NA
RGenAsp -> ROccAsp, NA, 1
RGenAsp -> REdAsp, lam21, NA
FGenAsp -> FOccAsp, NA, 1
FGenAsp -> FEdAsp, lam42, NA
RGenAsp <-> RGenAsp, ps11, NA
FGenAsp <-> FGenAsp, ps22, NA
RGenAsp <-> FGenAsp, ps12, NA
ROccAsp <-> ROccAsp, theta1, NA
REdAsp <-> REdAsp, theta2, NA
FOccAsp <-> FOccAsp, theta3, NA
FEdAsp <-> FEdAsp, theta4, NA
sem.dhp <- sem(model.dhp, R.DHP, 329,
fixed.x=c('RParAsp', 'RIQ', 'RSES', 'FSES', 'FIQ', 'FParAsp'))
pathDiagram(sem.dhp, min.rank='RIQ, RSES, RParAsp, FParAsp, FSES, FIQ',
max.rank='ROccAsp, REdAsp, FEdAsp, FOccAsp')
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.