36
semPlot: Unified visualizations of Structural Equation Models Sacha Epskamp University of Amsterdam Department of Psychological Methods M3 2014 20-05-2014

semPlot: Unified visualizations of Structural Equation Models

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: semPlot: Unified visualizations of Structural Equation Models

semPlot: Unified visualizations of StructuralEquation Models

Sacha Epskamp

University of AmsterdamDepartment of Psychological Methods

M3 201420-05-2014

Page 2: semPlot: Unified visualizations of Structural Equation Models

semPlot

I R package dedicated to visualizing structural equationmodels (SEM)

I fills the gap between advanced, but time-consuming,graphical software and the limited graphics producedautomatically by SEM software

I Also unifies different SEM software packages and modelframeworks in R

I General framework for extracting parameters from differentSEM software packages to different SEM modelingframeworks

I Sister package and extension to qgraph (Epskamp,Cramer, Waldorp, Schmittmann, & Borsboom, 2012)

Page 3: semPlot: Unified visualizations of Structural Equation Models

Supported input

I R (R Core Team, 2013) objects:I lmI loadingsI factanalI princompI principal (Revelle, 2010)

I R package output:I lavaan (Rosseel, 2012)

I Output and modelI sem (Fox, Nie, & Byrnes, 2013)I OpenMx (Boker et al., 2011)

I Path specification onlyI String indication output file of:

I MPlus (L. K. Muthén & B. O. Muthén, 1998–2012)I Via MplusAutomation (Hallquist & Wiley, 2013)

I LISREL (Jöreskog & Sörbom, 1996)I Via lisrelToR (Epskamp, 2013)

Page 4: semPlot: Unified visualizations of Structural Equation Models

semPlotModel

SEM package output:

I lavaanI semI OpenMxI MPlusI LISRELI Onyx

Model specification:

I lavaan modelI lisrelModel()I ramModel()

non-SEM objects:

I lmI loadingsI factanalI principalI princomp

semPaths()

semCors()

semSyntax()

modelMatrices()

semMatrixAlgebra()

Page 5: semPlot: Unified visualizations of Structural Equation Models

semPlotModel

SEM package output:

I lavaanI semI OpenMxI MPlusI LISRELI Onyx

Model specification:

I lavaan modelI lisrelModel()I ramModel()

non-SEM objects:

I lmI loadingsI factanalI principalI princomp

semPaths()

semCors()

semSyntax()

modelMatrices()

semMatrixAlgebra()

Page 6: semPlot: Unified visualizations of Structural Equation Models

library("lavaan")## The famous Holzinger and Swineford (1939) exampleHS.model <- ' visual =~ x1 + x2 + x3

textual =~ x4 + x5 + x6speed =~ x7 + x8 + x9 '

fit <- cfa(HS.model, data=HolzingerSwineford1939)

Page 7: semPlot: Unified visualizations of Structural Equation Models

semPathssemPaths() can be used to plot a path diagram:

semPaths(fit)

x1 x2 x3 x4 x5 x6 x7 x8 x9

vsl txt spd

Page 8: semPlot: Unified visualizations of Structural Equation Models

semPathssemPaths() can be used to plot a path diagram:

semPaths(fit, style = "lisrel")

x1 x2 x3 x4 x5 x6 x7 x8 x9

vsl txt spd

Page 9: semPlot: Unified visualizations of Structural Equation Models

semPaths(fit, "Standardized", "Estimates")

0.450.37

0.17

0.360.55

0.55

0.41

0.26

0.49 0.57

1.000.73

0.84

1.08

0.80

1.181.00

1.13

0.931.00 1.11

0.380.81 0.98

x1 x2 x3 x4 x5 x6 x7 x8 x9

vsl txt spd

Page 10: semPlot: Unified visualizations of Structural Equation Models

semPathssemPaths has quite a lot of arguments:

style, layout, intercepts, residuals, thresholds, rotation,curve, curvature, nCharNodes, nCharEdges, sizeMan,sizeLat, sizeInt, sizeMan2, sizeLat2, sizeInt2,shapeMan, shapeLat, shapeInt, ask, mar, title,title.color, title.adj, title.line, title.cex, include,combineGroups, manifests, latents, groups, color,residScale, gui, allVars, edge.color, reorder, structural,ThreshAtSide, thresholdColor, thresholdSize,fixedStyle, freeStyle, as.expression, optimizeLatRes,inheritColor, levels, nodeLabels, edgeLabels, pastel,rainbowStart, intAtSide, springLevels, nDigits, exoVar,exoCov, centerLevels, panelGroups, layoutSplit,measurementLayout, subScale, subScale2, subRes,subLinks, modelOpts, curveAdjacent, edge.label.cex,cardinal, equalizeManifests, covAtResiduals, bifactor,optimPoints

Page 11: semPlot: Unified visualizations of Structural Equation Models

semPaths

And even more via the qgraph backend:edge.width, node.width, node.height, esize, asize,minimum, maximum, cut, details, mar, filetype,filename, width, height, normalize, DoNotPlot, plot,rescale, label.cex, label.color, borders, border.color,border.width, polygonList, vTrans, label.prop,label.norm, label.scale, label.font, posCol, negCol,unCol, colFactor, trans, fade, loop,curvePivot,curvePivotShape, edge.label.bg,edge.label.position, edge.label.font, layout.par, bg,bgcontrol, bgres, pty, font, arrows, arrowAngle, asize,open, weighted, XKCD, . . .

Page 12: semPlot: Unified visualizations of Structural Equation Models

1.14 1.14 1.39 1.41 2.48 2.91 1.25 0.88 0.66 1.86 1.71 1.99 1.17 0.83 1.27 1.53

0.600.48

0.49

0.480.55

0.72

ANSWER1 ANSWER2 ANSWER3 ANSWER8 ANSWER4 ANSWER5 ANSWER6 ANSWER9 ANSWER16 ANSWER10 ANSWER11 ANSWER12 ANSWER7 ANSWER13 ANSWER14 ANSWER15

WITHDRAW SELFCARE COMPLIAN ANTISOCI

Within

0.59 0.56 0.82 0.76 1.34 1.57 0.92 0.59 0.40 0.94 0.87 1.09 0.67 0.51 0.90 1.05

0.830.71

0.78

0.730.77

0.85

0.14 0.17 0.30 0.46 0.80 0.11 0.200.23 0.19 0.13 0.23 0.21 0.13 0.20 0.180.34

ANSWER1 ANSWER2 ANSWER3 ANSWER8 ANSWER4 ANSWER5 ANSWER6 ANSWER9 ANSWER16 ANSWER10 ANSWER11 ANSWER12 ANSWER7 ANSWER13 ANSWER14 ANSWER15

BWITHDRA BSELFCAR BCOMPLIA BANTISOC

Between

Page 13: semPlot: Unified visualizations of Structural Equation Models

Constraints

1.00 0.58 0.80 1.00 1.12 0.93 1.00 1.13 1.01

0.56 1.30 0.94 0.45 0.50 0.26 0.89 0.54 0.65

0.80 0.88 0.32

0.41

0.180.18

5.00 6.15 2.27 2.78 4.03 1.93 4.24 5.63 5.47

0.00 0.00 0.00

x1 x2 x3 x4 x5 x6 x7 x8 x9

vsl txt spd

1 1 1 1 1 1 1 1 1

1 1 1

1.00 0.58 0.80 1.00 1.12 0.93 1.00 1.13 1.01

0.65 0.96 0.64 0.34 0.38 0.44 0.63 0.43 0.52

0.71 0.87 0.51

0.43

0.330.24

5.00 6.15 2.27 2.78 4.03 1.93 4.24 5.63 5.47

−0.15 0.58 −0.18

x1 x2 x3 x4 x5 x6 x7 x8 x9

vsl txt spd

1 1 1 1 1 1 1 1 1

1 1 1

Page 14: semPlot: Unified visualizations of Structural Equation Models

Structural Models# lavaan sem example:example(sem)semPaths(fit, "model", "est", style = "lisrel")

1.00 2.18 1.82

1.00 1.19 1.17 1.25 1.00 1.19 1.17 1.25

1.47 0.60

0.87

0.581.44

2.18 0.71 0.361.37

0.08 0.12 0.47

1.85 7.58 4.96 3.22 2.31 4.97 3.56 3.31

3.88 0.16

x1 x2 x3

y1 y2 y3 y4 y5 y6 y7 y8

i60

d60 d65

Page 15: semPlot: Unified visualizations of Structural Equation Models

LISREL style layout

1.00

1.18

0.94

1.00

0.87

0.89

1.00

0.87

0.88

1.00

0.83

0.68

0.47

0.56

0.79−0.03

0.01

0.05

0.01

0.10

0.08

0.07

0.05

0.06

0.08

−0.01

0.04

0.03

0.88

0.89

1.03

0.80

1.14

1.15

0.95

1.06

0.95

0.94

0.90

1.20

0.92

1.07

0.55

0.56

Y1

Y2

Y3

Y4

Y5

Y6

Y7

Y8

Y9

Y10

Y11

Y12

F1

F2

F3

F4

1

1

1

1

1

1

1

1

1

1

1

1

Page 16: semPlot: Unified visualizations of Structural Equation Models

Reingold-Tilford based layout

1.00

1.18

0.94

1.00

0.87

0.89

1.00

0.87

0.88

1.00

0.83

0.68

0.47

0.56

0.79−0.03

0.01

0.05

0.01

0.10

0.08

0.07

0.05

0.06

0.08

−0.01

0.04

0.03

0.88

0.89

1.03

0.80

1.14

1.15

0.95

1.06

0.95

0.94

0.90

1.20

0.92

1.07

0.55

0.56

Y1

Y2

Y3

Y4

Y5

Y6

Y7

Y8

Y9

Y10

Y11

Y12

F1

F2

F3

F4

1

1

1

1

1

1

1

1

1

1

1

1

Page 17: semPlot: Unified visualizations of Structural Equation Models

Boker-McArdle-Neale based layout

1.00

1.18

0.94

1.00

0.87

0.89

1.00

0.87

0.88

1.00

0.83

0.68

0.47

0.56

0.79

−0.03

0.01

0.05

0.01

0.10

0.08

0.07

0.05

0.06

0.08

−0.01

0.04

0.03

0.88

0.89

1.03

0.80

1.14

1.15

0.95

1.06

0.95

0.94

0.90

1.20

0.92

1.07

0.55

0.56

Y1

Y2

Y3

Y4

Y5

Y6

Y7

Y8

Y9

Y10

Y11

Y12

F1

F2

F3 F4

1

1

1

1

1

1

1

1

1

1

1

1

Page 18: semPlot: Unified visualizations of Structural Equation Models

Split measurement and structural models

1.00

1.18

0.94

1.00

0.87

0.89

1.000.870.88

1.00

0.83

0.68

0.47

0.56

0.79

−0.03

0.01

0.05

0.01

0.10

0.08

0.07 0.050.060.08

−0.01

0.04

0.03

0.88

0.89

1.03

0.80

1.14

1.15

0.95

1.06 0.950.940.90

1.20

0.92

1.07

0.55

0.56

Y1

Y2

Y3

Y4

Y5

Y6

Y7Y8Y9

Y10

Y11

Y12

F1

F2

F3 F4

1

1

1

1

1

1

111

1

1

1

Page 19: semPlot: Unified visualizations of Structural Equation Models

Circular layout

N1 N6 N11 N16 E17 N26 C30 N31 N36 N41 E42N56

N61N71

N76E77

N86E87

O88N91

N101N106

E107E112

N116N121

C130N131

N136

E137

O138

N146

E147

N151

C155

N161

N166

E167

N176

N181

N186

N191

N196

C205

N206

N211

N216

N221

N226

N231

N236

E2

E7

A19

N21

E27

E32

A34

C35

E37

O43

E57

A59

E62

A64

E67

O68

A74

N81

A89

C90

E92

A94

E97

A99

A104

N111

E117

E122

A124

N126

A129

O133

A134

N141

E142

A149

E152

A154

O163

A164

O168N171

E177A179

E182A184

E187O193

A194O198

E207E212

A214E217

A224E227

E237O238

C5C10C15O18C20C25C40N46E47C50C55C60C65C70C75O78C80C85C95C100C110C115C120

C125E127

C135C140

C145O153

C160C165

C170C175

C180C185

C195C200

O203C210

C215

C220

C225

O228

C230

C235

A239

C24

A4

A9

E12

A14

E22

A24

A29

A39

A44

C45

A49

N51

A54

N66

A69

E72

A79

E82

A84

N96

E102

C105

A109

A114

E132

A139

A144

C150

N156

A159

E162

A169

E172

A174

A189

E192

E197

A199

N201

E202

A204

O208

A219

E222

A229

E232

A234

O3

O8

O13

O23

O28

O33

O38

O48

E52O53

O58O63

O73O83

O93O98

O103O108

O113O118

A119O123

O128O143

O148E157

O158 O173 O178 O183 O188 C190 A209 O213 O218 O223 O233

Fc1

Fc2

Fc3

Fc4

Fc5

Page 20: semPlot: Unified visualizations of Structural Equation Models

Manual Specification

a

b

c

a

b

c

x1 x2 x3y1

y2

y3

y4

y5

y6

y7

y8

ind60dem60

dem65

Page 21: semPlot: Unified visualizations of Structural Equation Models

Model by Janneke de Kort

θ11(ε) θ22

(ε) θ33(ε) θ44

(ε)

θ55(ε) θ66

(ε) θ77(ε) θ88

(ε)

ψ55

ψ175

ψ66

ψ186

ψ77

ψ197

ψ88

ψ208

ψ99

ψ219

ψ1010

ψ2210

ψ1111

ψ2311

ψ1212

ψ2412

ψ1717 ψ1818 ψ1919 ψ2020

ψ2121 ψ2222 ψ2323 ψ2424

β101

β141

β112

β152

β123

β163

β15

β65

β26

β76

β37

β87

β48

β19

β109

β210

β1110

β311

β1211

β412

β213

β2213

β314

β2314

β415

β2415

β1317

β1817

β1418

β1918

β1519

β2019

β1620

β1321

β2221

β1422

β2322

β1523

β2423

β1624

IQ11 IQ12 IQ14IQ13

IQ21 IQ22 IQ24IQ23

A11 A12 A13 A14

E11 E12 E13 E14

A21 A22 A23 A24

E21 E22 E23 E24

Page 22: semPlot: Unified visualizations of Structural Equation Models

Visual correlation analysissemCors() can be used to plot implied and observedcovariances using the qgraph framework (Epskamp et al.,2012).

semCors(fit, layout = "spring", titles = TRUE)

a1

a2

a3b1

b2

b3

Observed

a1

a2

a3b1

b2

b3

Implied

Page 23: semPlot: Unified visualizations of Structural Equation Models

N1 N6 N11 N16 N21 N26 N31 N36 N41 N46N51

N56N61

N66N71

N76N81

N86N91

N96N101

N106N111

N116

N121

N126

N131

N136

N141

N146

N151

N156

N161

N166

N171

N176

N181

N186

N191

N196

N201

N206

N211

N216

N221

N226

N231

N236

E2

E7

E12

E17

E22

E27

E32

E37

E42

E47

E52

E57

E62

E67

E72

E77

E82

E87

E92

E97

E102

E107

E112

E117

E122

E127

E132

E137

E142

E147

E152

E157

E162

E167

E172

E177

E182

E187

E192

E197

E202

E207

E212

E217

E222

E227

E232

E237

O3O8

O13O18

O23O28

O33O38

O43O48

O53O58

O63O68

O73O78O83O88O93O98O103O108O113O118O123O128O133O138O143O148O153O158O163

O168O173

O178O183

O188O193

O198O203

O208O213

O218O223

O228O233

O238

A4

A9

A14

A19

A24

A29

A34

A39

A44

A49

A54

A59

A64

A69

A74

A79

A84

A89

A94

A99

A104

A109

A114

A119

A124

A129

A134

A139

A144

A149

A154

A159

A164

A169

A174

A179

A184

A189

A194

A199

A204

A209

A214

A219

A224

A229

A234

A239

C5

C10

C15

C20

C25

C30

C35

C40

C45

C50

C55

C60

C65

C70

C75

C80

C85

C90

C95

C100

C105

C110

C115

C120

C125C130

C135C140

C145C150

C155C160

C165C170

C175C180

C185C190

C195C200C205C210C215C220C225C230C235 C24

Nrt

Ext

Opn

Agr

Cns

Page 24: semPlot: Unified visualizations of Structural Equation Models

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

N1 N6N11

N16N21

N26

N31

N36

N41

N46

N51

N56

N61

N66

N71

N76

N81

N86

N91

N96

N101N106

N111N116N121N126N131N136

N141

N146

N151

N156

N161

N166

N171

N176

N181

N186

N191

N196

N201

N206

N211

N216

N221N226

N231 N236

E2 E7 E12E17

E22

E27

E32

E37

E42

E47

E52

E57

E62

E67

E72

E77

E82

E87

E92

E97

E102E107

E112E117E122E127E132

E137E142

E147

E152

E157

E162

E167

E172

E177

E182

E187

E192

E197

E202

E207

E212

E217

E222E227

E232 E237

O3 O8 O13O18

O23

O28

O33

O38

O43

O48

O53

O58

O63

O68

O73

O78

O83

O88

O93

O98

O103O108

O113O118O123O128O133O138

O143

O148

O153

O158

O163

O168

O173

O178

O183

O188

O193

O198

O203

O208

O213

O218

O223O228

O233 O238A4 A9A14

A19A24

A29

A34

A39

A44

A49

A54

A59

A64

A69

A74

A79

A84

A89

A94

A99

A104A109

A114A119A124A129A134

A139A144

A149

A154

A159

A164

A169

A174

A179

A184

A189

A194

A199

A204

A209

A214

A219

A224A229

A234 A239

C5 C10 C15C20

C25

C30

C35

C40

C45

C50

C55

C60

C65

C70

C75

C80

C85

C90

C95

C100

C105C110

C115C120C125C130C135C140

C145

C150

C155

C160

C165

C170

C175

C180

C185

C190

C195

C200

C205

C210

C215

C220

C225C230

C235 C24

Observed

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●●●●●●●

●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

●●●●●●●●●●●●●●●●

●●

●●●●●●●●●●●●

●●

●●●●●●●●●●●●●●●●

N1 N6N11

N16N21

N26

N31

N36

N41

N46

N51

N56

N61

N66

N71

N76

N81

N86

N91

N96

N101N106

N111N116N121N126N131N136

N141

N146

N151

N156

N161

N166

N171

N176

N181

N186

N191

N196

N201

N206

N211

N216

N221N226

N231 N236

E2 E7 E12E17

E22

E27

E32

E37

E42

E47

E52

E57

E62

E67

E72

E77

E82

E87

E92

E97

E102E107

E112E117E122E127E132

E137E142

E147

E152

E157

E162

E167

E172

E177

E182

E187

E192

E197

E202

E207

E212

E217

E222E227

E232 E237

O3 O8 O13O18

O23

O28

O33

O38

O43

O48

O53

O58

O63

O68

O73

O78

O83

O88

O93

O98

O103O108

O113O118O123O128O133O138

O143

O148

O153

O158

O163

O168

O173

O178

O183

O188

O193

O198

O203

O208

O213

O218

O223O228

O233 O238A4 A9A14

A19A24

A29

A34

A39

A44

A49

A54

A59

A64

A69

A74

A79

A84

A89

A94

A99

A104A109

A114A119A124A129A134

A139A144

A149

A154

A159

A164

A169

A174

A179

A184

A189

A194

A199

A204

A209

A214

A219

A224A229

A234 A239

C5 C10 C15C20

C25

C30

C35

C40

C45

C50

C55

C60

C65

C70

C75

C80

C85

C90

C95

C100

C105C110

C115C120C125C130C135C140

C145

C150

C155

C160

C165

C170

C175

C180

C185

C190

C195

C200

C205

C210

C215

C220

C225C230

C235 C24

Implied

See also See also (Epskamp et al., 2012)

Page 25: semPlot: Unified visualizations of Structural Equation Models

modelMatrices() can be used to obtain a list of all matricesin one of three modeling frameworks:

names(modelMatrices(fit, "ram"))

## [1] "A" "S" "F"

names(modelMatrices(fit, "lisrel"))

## [1] "LY" "TE" "PS" "BE" "LX" "TD"## [7] "PH" "GA" "TY" "TX" "AL" "KA"

names(modelMatrices(fit, "mplus"))

## [1] "Nu" "Lambda" "Theta"## [4] "Kappa" "Alpha" "Beta"## [7] "Gamma" "Psi"

Page 26: semPlot: Unified visualizations of Structural Equation Models

The semMatrixAlgebra() function makes extractingmatrices easier:

semMatrixAlgebra(fit, A)

## model set to ’ram’

## a1 a2 a3 b1 b2 b3 A B## a1 0 0 0 0 0 0 1.0000 0.000## a2 0 0 0 0 0 0 0.7335 0.000## a3 0 0 0 0 0 0 1.0390 0.000## b1 0 0 0 0 0 0 0.0000 1.000## b2 0 0 0 0 0 0 0.0000 0.765## b3 0 0 0 0 0 0 0.0000 1.012## A 0 0 0 0 0 0 0.0000 0.000## B 0 0 0 0 0 0 0.0000 0.000

Note how using the term A caused the function to automaticallyidentify we were interested in the RAM model.

Page 27: semPlot: Unified visualizations of Structural Equation Models

semMatriAlgebra() can also be used to easily performalgebraic computations:

semMatrixAlgebra(fit, Lambda %*% Psi %*% t(Lambda) + Theta)

## model set to ’mplus’

## a1 a2 a3 b1 b2 b3## a1 2.02879 0.60113 0.85151 -0.12520 -0.09578 -0.12674## a2 0.60113 1.52291 0.62456 -0.09183 -0.07025 -0.09296## a3 0.85151 0.62456 1.63260 -0.13008 -0.09951 -0.13168## b1 -0.12520 -0.09183 -0.13008 1.95964 0.66839 0.88447## b2 -0.09578 -0.07025 -0.09951 0.66839 1.53194 0.67661## b3 -0.12674 -0.09296 -0.13168 0.88447 0.67661 1.78813

Page 28: semPlot: Unified visualizations of Structural Equation Models

semSyntax can be used to translate any input to semPlot intolavaan codes. This has two advantages:

I Easily fit a model based on an output file in lavaanI Simulate data based on an estimated model using

lavaan’s simulateDataTranslating lavaan syntax to MPlus syntax can be attemptedusing lavaan:::lav2mplus. sem is also supported but a bitbugged at the moment. Mail me for a lavaan to OpenMxtranslator.

Page 29: semPlot: Unified visualizations of Structural Equation Models

Translate MPlus to lavaan:

l <- "http://www.statmodel.com/usersguide/chap5/ex5.1.out"download.file(l, modfile <- tempfile(fileext = ".out"))Model <- semPlotModel(modfile)lavMod <- semSyntax(Model)

## Reading model: ex5.1.out#### Model <- '## F1 =~ 1*Y1## F1 =~ Y2## F1 =~ Y3## F2 =~ 1*Y4## F2 =~ Y5## F2 =~ Y6## F2 ~~ F1## Y1 ~ 1## Y2 ~ 1## Y3 ~ 1## Y4 ~ 1## Y5 ~ 1## Y6 ~ 1## F1 ~~ F1## F2 ~~ F2## Y1 ~~ Y1## Y2 ~~ Y2## Y3 ~~ Y3## Y4 ~~ Y4## Y5 ~~ Y5## Y6 ~~ Y6## '

Page 30: semPlot: Unified visualizations of Structural Equation Models

Simulate data:

l <- "http://www.statmodel.com/usersguide/chap5/ex5.1.out"download.file(l, modfile <- tempfile(fileext = ".out"))Model <- semPlotModel(modfile)lavMod <- semSyntax(Model, allFixed = TRUE)

Page 31: semPlot: Unified visualizations of Structural Equation Models

Simulate data:

library("lavaan")head(simulateData(lavMod))

## Y1 Y2 Y3 Y4 Y5 Y6## 1 -0.1812 -0.86023 -0.26249 0.8436 1.3738 -0.2065## 2 0.4026 -1.42322 -0.03974 0.6176 0.5889 0.6993## 3 1.2055 0.37841 1.44397 0.7376 0.9466 -0.8903## 4 2.1490 -0.67511 0.07165 0.1718 -0.4993 -2.1682## 5 0.3397 -0.09025 -0.06618 -1.2264 0.0610 -1.2726## 6 -1.5069 -0.81482 -1.58714 1.1065 -0.4947 0.2997

Page 32: semPlot: Unified visualizations of Structural Equation Models

Future directions

I (Better) support for:I OnyxI AmosI EQSI lavaI xxM

I Extension to different models:I LKAI IRTI Bayesian models

I Equivalent model samplerI Partial correlation matrices

Page 33: semPlot: Unified visualizations of Structural Equation Models

Thank you for your attention!

Page 34: semPlot: Unified visualizations of Structural Equation Models

References I

Boker, S. M., Neale, M., Maes, H., Wilde, M., Spiegel, M.,Brick, T., . . . Fox, J. (2011). OpenMx: an open sourceextended structural equation modeling framework.Psychometrika, 76(2), 306–317.

Doosje, B., Loseman, A., & Bos, K. (2013). Determinants ofradicalization of islamic youth in the netherlands: personaluncertainty, perceived injustice, and perceived groupthreat. Journal of Social Issues, 69(3), 586–604.

Epskamp, S. (2013). lisrelToR: import output from LISREL intoR. R package version 0.1.4. Retrieved fromhttp://CRAN.R-project.org/package=lisrelToR

Epskamp, S., Cramer, A. O. J., Waldorp, L. J.,Schmittmann, V. D., & Borsboom, D. (2012). qgraph:network visualizations of relationships in psychometricdata. Journal of Statistical Software, 48(4), 1–18.Retrieved from http://www.jstatsoft.org/v48/i04/

Page 35: semPlot: Unified visualizations of Structural Equation Models

References II

Fox, J., Nie, Z., & Byrnes, J. (2013). sem: structural equationmodels. R package version 3.1-1. Retrieved fromhttp://CRAN.R-project.org/package=sem

Friedman, J., Hastie, T., & Tibshirani, R. (2011). Glasso:graphical lasso- estimation of gaussian graphical models.R package version 1.7. Retrieved fromhttp://CRAN.R-project.org/package=glasso

Hallquist, M. & Wiley, J. (2013). MplusAutomation: automatingmplus model estimation and interpretation. R packageversion 0.5-4. Retrieved fromhttp://CRAN.R-project.org/package=MplusAutomation

Jöreskog, K. G. & Sörbom, D. (1996). LISREL 8: user’sreference guide. Scientific Software.

Muthén, L. K. & Muthén, B. O. (1998–2012). Mplus user’sguide. (Seventh Edition). Los Angeles, CA: Muthén &Muthén.

Page 36: semPlot: Unified visualizations of Structural Equation Models

References III

R Core Team. (2013). R: a language and environment forstatistical computing. ISBN 3-900051-07-0. R Foundationfor Statistical Computing. Vienna, Austria. Retrieved fromhttp://www.R-project.org/

Revelle, W. (2010). PSYCH: procedures for psychological,psychometric, and personality research. R packageversion 1.0-93. Northwestern University. Evanston,Illinois. Retrieved fromhttp://personality-project.org/r/psych.manual.pdf

Rosseel, Y. (2012). lavaan: an R package for structuralequation modeling. Journal of Statistical Software, 48(2),1–36. Retrieved from http://www.jstatsoft.org/v48/i02/