-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsemdiagram.sthlp
77 lines (52 loc) · 2.43 KB
/
semdiagram.sthlp
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
{smcl}
{title:Title}
{phang}
{cmd:semdiagram} {hline 2} executes {help sem} one-factor measurement model and produces dynamic path diagram for
{browse "www.haghish.com/diagram/diagram.php":diagram} package
{title:Syntax}
{p 8 16 2}
{cmd: semdiagram} [:] {it:{help sem} or {help gsem} command}
{p_end}
{title:Description}
{p 4 4 2}
The {bf:semdiagram} provides an "example" for generating dynamic path diagram, using
Stata {bf:sem} command. It takes a Stata {bf:sem} or {bf:gsem} command and
produces a dynamic path diagram. Currently, it is only supporting a
{it:one-factor measurement model}. Similar to {bf:sem_} and {bf:gsem} commands,
the path direction can be from right to left or left to write (see the example).
{bf:semdiagram} produces a dynamic path diagram named {it:semdiagram.gv} that can be rendered
and exported to a graphical file using {help diagram} package.
{p 4 4 2}
This program was meant to be used as an example for automating path diagrams
from Stata. If you wish to improve the program to support more sophisticated
{bf:sem} models, {browse "https://github.com/haghish/diagram":fork diagram package on GitHub}.
{title:Example(s)}
Setup
. webuse sem_1fmm
A one-factor measurement model
. semdiagram sem (X->x1) (X->x2) (X->x3) (X->x4)
Or alternatively
. semdiagram sem (x1<-X) (x2<-X) (x3<-X) (x4<-X)
semdiagram creates {it:semdiagram.gv} file which can be exported to a graphical image
. diagram using semdiagram.gv, export(semdiagram.png)
{title:Stored results}
{p 4 4 2}
{bf:semdiagram} stores the SEM output in a matrix:
{synoptset 20 tabbed}{...}
{p2col 5 20 24 2: Matrix}{p_end}
{synopt:{cmd:r(table)}}results of the SEM command{p_end}
{title:Author}
{p 4 4 2}
{bf:E. F. Haghish} {break}
Center for Medical Biometry and Medical Informatics {break}
University of Freiburg, Germany {break}
{it:and} {break}
Department of Mathematics and Computer Science {break}
University of Southern Denmark {break}
haghish@imbi.uni-freiburg.de {break}
{p 4 4 2}
{browse "http://www.haghish.com/statistics/stata-blog/reproducible-research/markdoc.php":http://www.haghish.com/markdoc} {break}
Package Updates on {browse "http://www.twitter.com/Haghish":Twitter} {break}
{hline}
{p 4 4 2}
{it:This help file was dynamically produced by {browse "http://www.haghish.com/markdoc/":MarkDoc Literate Programming package}}