9

I am looking for a software tool (preferably open source) to draw structural equation/mixture models efficiently and prettily.

After looking into xfig and graphviz I now stick to the general vector graphics package inkscape because it seems most flexible.

I would like to poll the stat.stackexchange community: How do you draw your structural equation/mixture models? What software do you use?

Franck Dernoncourt
  • 42,093
  • 30
  • 155
  • 271
gregor
  • 271
  • 2
  • 4
  • Out of interest, what did you find was the problem with GraphViz? Not flexible enough? In what way(s)? – onestop Oct 20 '10 at 10:50
  • @onestop, with graphviz I was not able to draw an arrow to the center of a line without "cracking" the arrow that is pointed to. See my question at stackoverflow http://stackoverflow.com/questions/3718025/graphviz-dot-how-to-insert-arrows-from-a-node-to-center-of-an-arrow – gregor Oct 21 '10 at 11:33
  • 1
    Folks, this is a question about the **path diagram tools**, not about R packages doing SEM. If the OP has an Mplus license, and is happy with the package, there will be little need for them to learn `OpenMx` or `lavaan`. These may be great packages *per se* if you start from ground zero, but unlearning Mplus and learning R/OpenMx is a huge time commitment that I personally would not be prepared to make, the most realistic setting for which could be getting tenured and going on a sabbatical to UCLA :). – StasK Dec 17 '12 at 14:44

10 Answers10

11

I use OpenMx for SEM modeling where I simply use the omxGraphViz function to return a dotfile. I haven't found it too inflexible -- the default output looks pretty good and though I've rarely needed to modify the dotfile, it's not hard to do.

Update By the way, Graphviz can output SVG files, which can be imported into Inkscape, giving you the best of both worlds. :)

ars
  • 12,160
  • 1
  • 36
  • 54
  • 2
    (+1) Thanks for linking with OpenMx! Really great package that has replaced Mx on my Mac now. – chl Oct 20 '10 at 14:09
5

Onyx is a free program for drawing and estimating Structural Equation Models. It can import/export models from/to OpenMx. With limitations, also to Mplus, and (soon) to lavaan. Export to bitmaps (JPEG) and LaTex vector formats are possible.

Onyx can be downloaded here: http://onyx.brandmaier.de/

A. Brandmaier
  • 51
  • 1
  • 1
4

I use the psych R package for CFA and John Fox's sem package with simple SEM. Note that the graphical backend is graphviz. I don't remember if the lavaan package provides similar or better facilities.

Otherwise, the Mx software for genetic modeling features a graphical interface in its Windows flavour, and you can export the model with path coefficients.

chl
  • 50,972
  • 18
  • 205
  • 364
3

I am currently developing the semPlot package for R which is aimed at visualizing models and parameter estimates for SEM models from various packages, including Mplus. Its first version is on CRAN. It has a few bugs though which have mostly been solved in the devellopmental version on github (https://github.com/SachaEpskamp/semPlot). For some examples, see: http://sachaepskamp.com/semPlot.

Sacha Epskamp
  • 287
  • 1
  • 13
2

I have worked with graphviz, which is also the graphics engine behind R's sem package (my understanding is that John Fox designed the syntax to be as closely compatible with graphviz as possible, so it would be easy to convert one syntax to another). It gets cumbersome quite quickly, and these days I draw my SEM path diagrams in Dia.

StasK
  • 29,235
  • 2
  • 80
  • 165
1

I answered another question on the site, Software for drawing bayesian networks (graphical models) suggesting the Tikz library in $\LaTeX$. One of the nice properties of the Tikz code for drawing these models is that the RAM path notation is functionally similar to how you define nodes and edges in Tikz.

It is not as nice if you want to automatically draw models you have already estimated in MPLUS or whatever (as would be the case for some of the R programs), but with my (admittedly) brief attempt at making some of the graphs in R or graphviz, I had a much easier time creating what I wanted in Tikz.

For another potential solution in R though the qgraph library in R has some nice examples.

Andy W
  • 15,245
  • 8
  • 69
  • 191
1

I used Lisrel, AMOS, Mplus before but only R.

In R, one can do almost every step to fit SEM with the data, from exploring pattern to fitting the model and improving the model.

Recently (2012), there are many new R packages and updated ones, which allow us to fit SEM intuitively. Moreover, R is free and open-source software.

Here is a review on using R to run/fit SEM, and still updating.

http://pairach.com/2011/08/13/r-packages-for-structural-equation-model/

Pairach
  • 11
  • 2
1

I would recommend you to try "yed", http://www.yworks.com/en/products_yed_about.html. It is a very versatile program and I've used it to draw path diagrams, flowcharts, timelines etc. It helps you get figures aligned, equal distances between boxes, and so on. Give it at try!

chl
  • 50,972
  • 18
  • 205
  • 364
Tormod
  • 412
  • 4
  • 12
1

I think Omnigraffle is the best for drawing (only). It is fantastic! Far easier than any other program I have seen, and is beautiful.

Behacad
  • 4,916
  • 8
  • 30
  • 48
0

THANK-YOU!! I tried a few of these but the free software Dia is all I need to draw my structural equation model (4 latent variables). I viewed a few Youtube tutorials and went to the wiki as needed https://wiki.gnome.org/Apps/Dia/Documentation I did this in an evening or in about 3 hours had my full model developed and edited.

  • 1
    This reads suspiciously like an advertisement. However, it is fine to inform this community about this product for SEMs. You may want to peruse our materials (in our [help/on-topic]), & perhaps tweak your answer. If you are affiliated w/ this, just mention that & it will be OK. – gung - Reinstate Monica Feb 15 '15 at 04:03
  • I'd like to add my vote for Dia too. It's not fancy but it does everything I need and provides some really neat diagrams. – Rebecca Linnett Mar 20 '17 at 21:01