Title

semdiagram -- executes sem one-factor measurement model and produces dynamic path diagram for
diagram package

Syntax

semdiagram [:] sem or gsem command

Description

The semdiagram provides an "example" for generating dynamic path diagram, using
Stata sem command. It takes a Stata sem or gsem command and
produces a dynamic path diagram. Currently, it is only supporting a
one-factor measurement model. Similar to sem_ and gsem commands,
the path direction can be from right to left or left to write (see the example).
semdiagram produces a dynamic path diagram named semdiagram.gv that can be rendered
and exported to a graphical file using diagram package.

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
sem models, fork diagram package on GitHub.

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 semdiagram.gv file which can be exported to a graphical image
. diagram using semdiagram.gv, export(semdiagram.png)

Stored results

semdiagram stores the SEM output in a matrix:

Matrix

r(table) results of the SEM command

Author

E. F. Haghish

Center for Medical Biometry and Medical Informatics

University of Freiburg, Germany

and

Department of Mathematics and Computer Science

University of Southern Denmark

haghish@imbi.uni-freiburg.de

http://www.haghish.com/markdoc

Package Updates on Twitter

This help file was dynamically produced by MarkDoc Literate Programming package