Dynamic Path Diagrams

E. F. Haghish Center for Medical Biometry and Medical Informatics (IMBI) University of Freiburg, Germany and Department of Mathematics and Computer Science University of Southern Denmark

[email protected]

Abstract. Diagrams are frequently used in data analysis and visualization. Stata provides an SEM builder interface to develop SEM path diagrams, execute the analysis, and export the analysis diagram to an image file. However, this process is manual and cannot be reproduced in an automated analy- sis. This article introduces the diagram package which renders “DOT” (Graph Descriptive Language) diagrams and exports them to a variety of formats including PDF, PNG, JPEG, GIF, and BMP with adjustable resolution within Stata. Rendering diagrams from a markup language provides the possibility to create diagrams for different purposes, which increases their applications beyond building SEM models. The article discusses potential applications of the package in data analysis and vi- sualization and provides several examples for generating dynamic path diagrams, producing path diagrams from data sets, and visualizing func- tion call for Stata ado-programs. Keywords: , graphics, DOT, diagram, reproducible research, vi- sualization, SEM

1 Introduction Evaluating relationship among variables is one of the primary concepts in statis- tics. In order to represent and visualize multivariate analytic models, often path diagrams are used, where arrows point out the relationship between vari- ables. The relationship is visualized using a one-headed arrow indicating one variable’s direct effect on the other, whereas two-headed arrow indicating un- analyzed correlation. The residual variance is shown by arrows not originating from a variable (Mitchell 1992; Li et al. 1975). Despite their popularity for visualizing relationships between variables in Path Analysis and Structural Equation Models (SEM) (Andersson et al. 1999), the applications of path diagrams are not limited to statistical models. Path diagrams are commonly applied to visualize a summary, process, hierarchical structure, or interconnected systems such as networks, profiling statistical pack- ages, and visualizing computer software in general (Haghish 2016a). Nevertheless, the popular commercial statistical packages such as Stata and SPSS Amos provide an SEM builder interface for the users to build a path

1 diagram, execute the analysis, and export the resulting diagram to an image file manually. As a result, this process cannot be reproduced automatically. Moreover, the SEM builder interface limits applications of path diagrams to modeling the relationship between variables, neglecting all other potential uses of path diagrams for data visualization. While there have been a few attempts for developing a diagram in R (Haghish 2016c; Murrell 2015; Sadeghi and Marchetti 2012; Murrell 2015), Stata commu- nity has not made any endeavor to develop a graphical system for creating reproducible diagrams. Yet, both statistical languages lack a comprehensive package that can execute SEM models and generate an automated path dia- gram. In the current article I introduce the diagram package, which renders diagrams written in DOT (Graph Descriptive Language) (Gansner et al. 2006). DOT is a simple, intuitive, and yet highly customizable markup language for drawing reproducible diagrams (Gansner and North 2000). I will also provide several example programs for generating dynamic diagrams to demonstrate the potential applications of the package for data visualization.

2 DOT graph descriptive language The DOT markup is a graph description language that specifies the relation between different elements of a diagram. DOT was invented in 1988 and was included in Graphviz software (Ellson et al. 2002). DOT1 can create two types of diagrams which are directed and undirected diagrams, as shown in figure 1. The syntax of the DOT language is available at http://www.graphviz.org/ content/dot-language.

Example

. diagram `"digraph directed -> "node 1"; directed -> "node 2";"´, /// export(directed.pdf)

. diagram `"graph undirected -- "node 1"; undirected -- "node 2";"´, /// export(undirected.pdf)

2.1 Using DOT language for data visualization DOT is not the only markup language available for generating path diagrams. GraphML (Brandes et al. 2014), Graph eXchange Language (GXL) (Winter et al. 2002; Holt et al. 2006), and Graph Modelling Language (GML) (Himsolt 1997) are only a few of markup languages available for creating diagrams from a script. However, compared to these languages, DOT has several advantages, particularly for statistics and data science applications. In contrast to GraphML and GXL which are based on XML, DOT is easy-to- read and easy-to-write for humans due to its simple syntax. In addition, DOT is

1Initially, DOT markup – which is rendered with dot program – could only create directed diagrams and the undirected layouts were added later on with neato program (North 2004). Therefore, the DOT markup should not be conflicted with dot program.

2 directed undirected

node 1 node 2 node 1 node 2

Figure 1: Example of directed and undirected graphs highly customizable, allowing detailed manipulation of different elements of the graph. Despite its syntactic simplicity, DOT is also a compact language where many arguments for customizing the nodes, edges, and the overall graph can be written one after another. Moreover, there is plenty of free software available for rendering DOT diagrams such as Graphviz ? and DotEditor. Another benefit of DOT markup is that not only it can be rendered automatically by several engines and customizable options, but also, the user can strictly draw the diagram by specifying the coordinates of the center of each node (see section 5.1). Finally, the DOT markup has been available for many years, which means there is a large and supportive online community to ask help from. Using the same script file but a different rendering program, the DOT dia- grams can be rendered differently. The diagram package supports dot, neato, fdp, twopi, circo, and osage (Gansner 2004; Gansner et al. 2006; North 2004). Any of these programs can be specified to render the DOT diagram using the engine(name) option (see section 4). The examples provided in the current article only feature the dot and neato programs. The reader is referred to http://graphviz.org/Documentation.php for documentation, manual, and journal articles related to algorithms used in these programs.

2.2 Elements of DOT diagram The biggest advantage of the DOT language compared to XML languages such as GraphML and GXL is that it is human readable and it is based on a simple structure. Often, DOT diagrams are created by defining three types of objects, which are graph, node, and edge (Tsoukalos 2004). The graph object defines the graph type (directed or undirected) and can take arguments for general customizations of the diagram, whereas nodes define and customize the nodes of the diagram and edges define the connections between the nodes. DOT can also define a subgraph object, which puts the nodes in a cluster and can nest other subgraphs as well.

2.3 DOT customization The DOT markup language can highly customize any of the four objects (graph, subgraph, node, and edge), whether individually or globally, changing attributes of all objects in a graph. The customization allows changing shapes, thick-

3 ness, color, background color, labels, and many more attributes of nodes, edges, subgraphs, and graphs. While memorizing the arguments for a DOT new- bie imposes a learning curve, an IDE for developing interactive graphs could be of a great help for both learning the markup as well as building and cus- tomizing DOT graphs. A list of IDEs for DOT is provided on the Graphviz website at list of DOT editors and resources and I recommend DotEditor (visit http://vincenthee.github.io/DotEditor/) which allows building and customizing the graph using GUI interface and is available for Windows, Mac- intosh, and Linux operating systems free of charge. Explaining the attributes of each of these objects is beyond the purpose of the current manuscript. The reader is referred to http://graphviz.org/ content/attrs for a complete list of graph, node, and edge attributes.

3 diagram package 3.1 Installation The diagram package relies on webimage package (Haghish 2016b) package to adjust the resolution of the diagram and export it to PNG, GIF, JPEG, BMP, or PDF format. Both packages can be installed from SSC server:

. ssc install diagram . ssc install webimage

In addition, phantomJS (?Friesel 2014) software is required, which is a head- less WebKit scriptable with a JavaScript API. phantomJS is an open-source soft- ware, available for Windows, Mac, and Linux free of charge. Using phantomJS, the webimage package can render any webpage or web-based application to an image. The path to phantomJS software should be given to diagram package using the phantomjs(str) (see section 4). Alternatively, the path to phantomJS software can be permanently defined as shown below:

. diagram setpath "/path/to/phantomJS"

In the example below I first define the path to the executable phantomJS software on my Mac permanently and then test the installation of the diagram package by rendering a directed diagram that includes two nodes named Hello and World. To preserve the highest image quality without enlarging the diagram (using the magnify option), I export it to PDF format.

Example

. diagram setpath "/Applications/phantomjs/bin/phantomjs" . diagram "digraph {Hello -> World}", export(helloworld.pdf)

4 Hello

World

Figure 2: Example of directed and undirected graphs

4 Syntax The main command of the package is diagram that renders DOT diagrams and export them to graphical files.

4.1 diagram command The diagram command can be used in two different ways, by rendering DOT script directly or reading a file that includes the DOT script. diagram  using filename | ”DOT-script”  ,e xport(name)  replace magnify(real) phantomjs(str) engine(name)  The diagram options are explained below: export(name) specifies the filename and the file extension of the exported image. The supported image formats are pdf, png, jpeg, gif, and bmp. This option is required in order to export the diagram to an image file. replace rewrites the exported diagram if it already exists. engine(name) specifies the Graphviz engine for rendering the diagram. The supported engines dot, osage, circo, neato, twopi, and fdps. The default engine is dot. magnify(real) increases or reduces the size of the exported image by multiplying its height and width by the specified number. The value of the real number should be positive and by default is equal to 1.0. The initial size of the diagram varies based on the engine that is used for rendering the diagram and also the number of nodes and the relation between them. phantomjs(str) specifies the path to the executable phantomJS software on the machine, which is required by webimage package. If the path to phantomJS

5 is defined permanently using the “diagram setpath path/to/phantomjs” command, this option can be ignored (see section 4).

4.2 Example commands To provide example programs that generate DOT script files for various pur- poses, a few additional programs were written which are all included in the diagram package. These programs are makediagram, calldiagram, and semdiagram. Since these commands are not central to the diagram package, their syntax are briefly mentioned in the example section and for further details, the reader is referred to the documentation of each program which are included in diagram package. The makediagram program generates a DOT script file from data sets. Users can write the information they wish to visualize in a data set (see section 5.3) and use this command to generate a DOT script file automatically. The calldiagram generates a DOT script file, visualizing the function call of ado programs. Finally, the semdiagram program provides an example for running sem and gsem commands in Stata and producing a dynamic path diagram au- tomatically. These programs are further explained in the following section.

5 Examples There are numerous examples written for Graphviz software that can be ren- dered with diagram package. Many examples can be found on the Graphviz gallery website, which are available at http://www.graphviz.org/Gallery. php as well as diagram homepage. These examples can be rendered directly from Stata and serve as real-life applications of DOT path diagrams. For in- stance, the Graphviz program profile example can be rendered simply by passing the url of the DOT script file as follows:

. diagram using /// "http://www.graphviz.org/Gallery/directed/profile.gv.txt", /// export(profile.pdf) Due to popularity of DOT markup language and availability of its examples, instead of demonstrating different features of the DOT markup language, the examples provided in this section are meant to directly touch on a few appli- cations of the package in data analysis and visualization. For more examples regarding creating and customizing DOT diagrams, visit the homepage of dia- gram package, available at http://www.haghish.com/diagram. In the first example of this section, a dynamic diagram is developed for a path analysis by writing DOT script. In the next examples, the makediagram and semdiagram programs are demonstrated, which are used for generating a diagram from a data set and sem or gsem command respectively. Finally, the calldiagram example demonstrates visualizing function call in Stata packages by tracing the executed ado files and visualizing the called functions.

6 start moncontrol

on_exit profil

main malloc

sort merge brk term copyproto initree safeoutfil getpid creat sprintf oldfile morecore demote

setbuf rline msort fclose mul newfile unlink exit signal free doprnt getpagesize putfreehdr umul

filbuf wline qsort cmpsave insert close fopen setfil sigvec strlen localeconv urem udiv

read flsbuf fflush cmpa endopen findiop div getfreehdr rem sigsetmask sigblock

xflsbuf open sbrk

write

Figure 3: Example of Graphviz program profile

5.1 Path analysis diagram Figure 4 presents an example of a path analysis diagram, that shows the relation between four variables. The diagram begins with defining four nodes named 1, 2, 3, and 4. To make the diagram strict, the position of each node is defined using pos="x,y!" option and also, the labels of the nodes are defined using the label="name" option.

Example

forval i = 1/8 { . local n`i´ = `i´ }

. diagram "digraph name {" /// `"penwidth="0.1";"´ /// `"node [shape=rectangle];"´ /// `"edge [arrowsize="0.5",fontname="sans-serif",fontsize=10,"´ /// `" colorscheme="blues3",color=2,fontcolor=3];"´ /// `"node [fontname="serif",fontsize=13,fillcolor="1",colorscheme"´ /// `" ="blues4",color="2",fontcolor="4",style="filled"];"´ /// "graph [layout=neato, outputorder=edgesfirst, overlap=true];" /// `"1 [pos="-3,1!", label="Var 1"];"´ /// `"2 [pos="-3,-1!", label="Var 2"];"´ /// `"3 [pos="-1,0!", label="Var 3"];"´ /// `"4 [pos="1,0!", label="Var 4"];"´ /// `"e1 [shape=circle, pos="-1,-1!", label=".`n7´"];"´ /// `"e2 [shape=circle, pos="1,-1!", label=".`n8´"];"´ /// `"1 -> 2 [label=".`n1´", weight="0", dir=both, minlen="0"];"´ ///

7 `"1 -> 3 [label=".`n2´"];"´ /// `"2 -> 3 [label=".`n3´"];"´ /// `"3 -> 4 [label=".`n4´", headport="w"];"´ /// `"1 -> 4 [label=".`n5´", tailport="c", headport="c"];"´ /// `"2 -> 4 [label=".`n6´"];"´ /// "e1 -> 3;" /// "e2 -> 4;" /// "}", /// , export(pathdiagram.png) magnify(2.0) replace

Figure 4: Example of path analysis diagram

The biggest value of using DOT markup language for generating diagrams is the possibility of reproducing the diagram as well as making the diagram dynamic, i.e. the diagram should be reproduced with different values when changes are made to the data. As noted in the example above, the label of the edges can be used to define the coefficients in the model (i.e. the n values in the model). Local or global macros can be used to make the diagram gets dynamically updated anytime a change is made in the data. Moreover, since diagram package can export PNG image formats, the exported diagram can be included in a dynamic document (?Haghish 2014b). An example of a path anal- ysis that produces a dynamic diagram and includes it in a dynamic document using markdoc (Haghish 2014a) is provided on diagram homepage and can be executed as follows:

. do "http://www.haghish.com/diagram/dynamicdocument.do"

5.2 Automating path diagrams Instead of writing a large paragraph of DOT markup for generating a dynamic diagram, advanced users can use the DOT markup and diagram package to

8 write programs that execute an analysis and also produce a dynamic diagram as a byproduct. In order to provide an example and encourage the users to program for DOT language, the semdiagram program was written to execute a one-factor measurement model using the sem and gsem Stata commands and produce an automated analysis diagram. The syntax of the semdiagram is as follows: semdiagram [:] sem-command As shown above, the syntax simply executes an SEM model, which in the cur- rent version, can only be a one-factor measurement model. The SEM command of Stata allows different notations for building the model. The semdiagram pro- gram, however, expects the paths to be written in a way that each parenthesis only includes one variable and one latent variable, as shown in the example below. After running the SEM model, semdiagram uses the returned matrix to build a dynamic path diagram.

Example

. use webuse sem_1fmm, clear . semdiagram : sem (X->x1) (X->x2) (X->x3) (X->x4) . diagram using semdiagram.gv, export(semdiagram.pdf)

X 90

1 1 1.1 7.3

x1 x1 x1 x1 1.0e+02 1.0e+02 99 94

e1 e2 e3 e4 116 105 101 144

Figure 5: Example of dynamic diagram produced by semdiagram

The semdiagram can be further developed to fully support Stata SEM mod- els. However, that would be a manuscript on its own. The interested reader can collaborate on developing the command on https://github.com/haghish/ diagram.

9 5.3 Generating diagrams from data set As noted in the syntax section, the package includes a few ado programs that automatically produce DOT script diagrams, which consequently can be ren- dered with the diagram command. The makediagram program produces a DOT diagram text file from variables of a loaded or stored data set. The syntax of the program can be summarized as follows. makediagram using filename ,e xport(name)  replace graphtype(name) style(filename)  The export option defines the name and extension of the DOT file and the replace option replaces the existing image file. The graphtype can be digraph or graph representing directed and undirected graphs respectively. Finally, the style(filename) option allows importing external text file for that includes DOT markup for customizing the diagram and nodes. The makediagram can be executed on any data set. However, it requires at least 2 variables named from and to which define the edges of the diagram because each edge begins from a node and extends to another node. The data set can have three more optional variables which are cluster, label, and properties. The cluster variable can be used to put nodes in a cluster i.e. nodes that are in the same cluster should have the same cluster value. To present the weight of an edge (e.i. arrow) the label variable can be used. The weights can also be defined in the properties variable, along with all other properties that can be defined to customize the edges of the diagram. However, a separate label variable makes adding the weight values for each connection arrow easier. It is noteworthy that the cluster, from, to, and label variables can be numeric, string, or numeric with labels. If the variables include labels, makediagram uses the actual variable values for drawing the connections, but rename them by adding the labels for the nodes and edges. In order to demonstrate these capabilities, two data sets were prepared that draw an algorithm made of two clusters. The data sets are included in the package as auxiliary.

Example

. use cluster.dta, clear . makediagram using cluster.dta, export(cluster.gv) . diagram cluster.gv, export(cluster.pdf)

5.4 Generating package profile diagram The calldiagram program was written to trace the ado-programs that are called by a Stata command. The command executes the given Stata-command and generate a DOT script file named calldiagram.gv which can be rendered to an image using the diagram command. The syntax calldiagram can be summarized as follows: calldiagram suppress(namelist) Stata-command

10 start

process #1 process #2

A0 B0

A1 B1

A2 B2

A3 B3

end

Figure 6: Example of clustered diagram rendered from data set

Many Stata commands are open-source ado-programs. Therefore, calldiagram also trace Stata ado-programs that are called in a user-written program and in- clude them in the diagram. In order to suppress Stata commands (or any other executed program), a name list can be given to suppress(namelist) subcom- mand. The example below traces the markdoc (Haghish 2014a) command – which is a general purpose literate programming package for Stata – to profile the ado- programs that are called during the execution of the program. The example produces a LATEX document that renders the profile diagram in order to demon- strate how to include diagrams in automated analysis documents. Note that the diagram is produced and exported after execution of markdoc command. However, this does not influence typesetting the exported dynamic document. Moreover, the document is written in Markdown (?) language and is converted to LATEX which greatly improves the readability of the document.

Example

. qui log using example, replace

/*** Profiling ado programs ======

The diagram below shows the ado-programs that are executed by `markdoc` package.

11 ![ado-Programs that are called by `markdoc` package](markdoc.pdf) ***/

. qui log c

. calldiagram markdoc example, export(tex) texmaster . diagram using calldiagram.gv, export(markdoc.pdf) magnify(0.5)

1 Profiling ado programs

The diagram below shows the ado-programs that are executed by markdoc package.

markdoc

weaversetup markdoccheck markdocversion

findfile

Figure 1: ado-Programs that are called by markdoc package

Figure 7: Preview of dynamic document that includes a diagram

In the example above, the findfile is a Stata ado-program which can be ignored in the diagram using the suppress subcommand.

. calldiagram suppress(findfile) markdoc example, export(tex) texmaster (output omitted )

6 Discussion In the current article, I introduced the diagram package that renders diagrams written in the DOT markup language within Stata, which allows the Stata community to develop dynamic path diagrams. The package renders several dot neato circo fdp twopi of Graphviz layout algorithms such as 1 , , , , and within Stata. Using webimage package (Haghish 2016b), diagram can also adjust the resolution of the rendered diagram and export it to a vector graphic format such as PDF or raster formats such as PNG, GIF, JPEG, and BMP. Compared to creating diagrams manually in a third-party software, creating diagrams within diagram package provides four main advantages which are 1) saving time for creating and maintaining diagrams, 2) making the diagrams reproducible, 3) reducing chance of error in publishing the wrong diagram, and 4) allowing users to write programs for auto-generating DOT diagrams. In

12 contrast, creating a diagram manually and outside Stata would mean increasing the chance of untraceable human error, irreproducible diagrams, as well as lack of support for dynamic and auto-generated diagrams. In order to demonstrate the potential of the package for developing auto- mated path diagrams, three example programs were included in the package. The makediagram program generates DOT script file from a data set. This pro- gram can also serve as a useful tutor for beginners to type their data and export a DOT diagram. The program can also have another implication for network analysis. For example, makediagram can be used to visualize a complex network data set where individuals are nested in different social domain (i.e. subgraph) and relate to one another. Therefore, statisticians who deal with network data can get benefit from makediagram and programs that can be written based on this program to visualize networks. As noted in the introduction of the article, software visualization is another application of path diagrams, which require building the diagram automatically using a graph markup language. The calldiagram program produces a DOT script file by tracing all ado programs that are called by an ado program in Stata. The resulting diagram reveals the structure between nested programs and can be used as a quick shortcut to conceptualize a complex program. For example, a statistical package might include a number of functions (referring to ado programs) but not all of them are necessarily called one after another. A function call diagram can provide a quick indication that which functions were called by the executed command and how they relate to one another. Interested readers are referred to CodeMap (Haghish 2016a) software for visualizing the dependency trees of Stata and R packages, which is beyond the function call diagram. Nevertheless, the function call diagram is a good example of using a diagram language to further improve the transparency of a package and quickly discover the function call nest of the package. The semdiagram was the third example program written in Stata to produce dynamic SEM path diagrams. This program – that currently only supports one- factor measurement model – can demonstrate one of the biggest advantages of a graph markup language for developing dynamic diagrams. Using DOT language and Stata sem or gsem command, the semdiagram program executes the Stata SEM, obtains the analysis values returned by Stata, and construct a DOT script file that can be exported to a graphical file and included in a dynamic analysis report automatically. Such a workflow eliminates the chance of untraceable human error in including a wrong path diagram in an analysis document or journal article, if a dynamic documentation tool such as markdoc or weaver is used (Haghish 2014a,b). Therefore, providing a reproducible graphical system for building diagrams not only makes graphical models reproducible, but also opens new possibilities for auto-generating diagrams and applying them for modeling systems, relations between variables, visualizing networks, profiling packages, etc. Despite all of the benefits of the DOT language compared to the other avail- able languages, the engines developed for rendering DOT diagrams not particu- larly developed for statistical use such as producing path analysis diagrams and

13 SEM models. However, this problem can be ameliorated by developing layout algorithms that produce diagrams with fixed-node positions, as shown in the example 5.1. The semdiagram program is a basic attempt in this regard which can be further developed to support producing dynamic diagram models from any Stata SEM command. Moreover, similar to any other computer language, DOT markup language comes with a learning curve. However, the language is fairly human readable. Moreover, understanding its principal structure – as explained in the current article – should make it easily comprehensible even for newbies. Fortunately, the DOT markup language is rather commonly used in computer sciences and it has been made available in R recently (Iannone 2016; Haghish 2016c). Therefore, the reader could expect a rather large online community for support. Although there have been user-written packages for rendering the DOT lan- guage in R (Haghish 2016c; Iannone 2016), yet, there has not been any attempt for developing dynamic path diagrams for SEM models. The diagram package in Stata provides the initiative for the Stata community to make path diagrams reproducible and also take full advantage of the DOT language to visualize data. The source code of the package along with the example programs are hosted on https://github.com/haghish/diagram and I hope to see more example programs from the community to produce analysis diagrams.

14 7 References Andersson, S. A., D. Madigan, M. Perlman, and T. Richardson. 1999. Graphical Markov models in multivariate analysis. Statistics Textbooks and Monographs 159: 187 – 230. Brandes, U., M. Eiglsperger, J. Lerner, and C. Pich. 2014. Graph markup lan- guage (GraphML). In Handbook of visualization, ed. R. Tamas- sia, 517–541. CRC Press. Ellson, J., E. Gansner, L. Koutsofios, S. C. North, and G. Woodhull. 2002. Graphviz – Open Source Graph Drawing Tools, chap. Graphviz— Open Source Graph Drawing Tools, 483–484. Springer. Friesel, R. 2014. PhantomJS Cookbook. Packt Publishing Ltd. Gansner, E., E. Koutsofios, and S. North. 2006. Drawing graphs with dot . URL http://www.graphviz.org/Documentation/dotguide.pdf. Gansner, E. R. 2004. Drawing graphs with Graphviz . URL http://www. graphviz.org/pdf/libguide.pdf. Gansner, E. R., and S. C. North. 2000. An open graph visualization system and its applications to software engineering. Software Practice and Experience 30(11): 1203–1233. Haghish, E. F. 2014a. MarkDoc: Literate Programming in Stata . URL http: //www.haghish.com/statistics/stata-blog/reproducible-research/ markdoc.php. . 2014b. Rethinking Literate Programming in Statistics. URL http: //www.haghish.com/statistics/stata-blog/reproducible-research/ weaver.php. . 2016a. CodeMap: Visualising and Comprehending Statistical Packages . . 2016b. converting web files to graphical image in Stata. Statistical Software Components . . 2016c. Render and Export DOT Graphs in R . URL https://cran. r-project.org/web/packages/DOT/DOT.pdf. Himsolt, M. 1997. GML: A portable graph file format . URL http: //www.fim.uni-passau.de/fileadmin/files/lehrstuhl/brandenburg/ projekte/gml/gml-technical-report.pdf. Holt, R., A. Sch¨urr,S. E. Sim, and A. Winter. 2006. Graph Exchange Language . URL http://www.gupro.de/GXL/index.html. Iannone, R. 2016. Create Graph Diagrams and Flowcharts Using R. https://cran.r-project.org/web/packages/DiagrammeR/DiagrammeR.pdf .

15 Li, C. C., et al. 1975. Path Analysis - a primer. The Boxwood Press. Mitchell, R. 1992. Testing Evolutionary and Ecological Hypotheses Using Path Analysis and Structural Equation Modelling 6(2): 123 – 129. Murrell, P. 2015. The gridGraphics Package. The R Journal 7(1): 151–162.

North, S. C. 2004. Drawing graphs with NEATO . URL http://www.graphviz. org/Documentation/neatoguide.pdf.

Sadeghi, K., and G. M. Marchetti. 2012. Graphical Markov models with mixed graphs in R. The R Journal 4(2): 65 – 73.

Tsoukalos, M. 2004. An Introduction to graphviz. Linux J., http://www. lin- uxjournal. com/article/7275 . Winter, A., B. Kullbach, and V. Riediger. 2002. An Overview of the GXL Graph Exchange Language, 324–336. Berlin, Heidelberg: Springer Berlin Heidelberg. URL http://dx.doi.org/10.1007/3-540-45875-1_25.

16