-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRICLPM_isolation_adhd.html
3860 lines (3744 loc) · 468 KB
/
RICLPM_isolation_adhd.html
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" />
<title>Separate mother and teacher RI-CLPM for social isolation and ADHD symptoms in childhood</title>
<script src="site_libs/header-attrs-2.11/header-attrs.js"></script>
<script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="site_libs/bootstrap-3.3.5/css/flatly.min.css" rel="stylesheet" />
<script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script>
<script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script>
<style>h1 {font-size: 34px;}
h1.title {font-size: 38px;}
h2 {font-size: 30px;}
h3 {font-size: 24px;}
h4 {font-size: 18px;}
h5 {font-size: 16px;}
h6 {font-size: 12px;}
code {color: inherit; background-color: rgba(0, 0, 0, 0.04);}
pre:not([class]) { background-color: white }</style>
<script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script>
<link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" />
<script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script>
<script src="site_libs/navigation-1.1/tabsets.js"></script>
<script src="site_libs/navigation-1.1/codefolding.js"></script>
<link href="site_libs/pagedtable-1.1/css/pagedtable.css" rel="stylesheet" />
<script src="site_libs/pagedtable-1.1/js/pagedtable.js"></script>
<link href="site_libs/font-awesome-5.1.0/css/all.css" rel="stylesheet" />
<link href="site_libs/font-awesome-5.1.0/css/v4-shims.css" rel="stylesheet" />
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
</style>
<style type="text/css">
code {
white-space: pre;
}
.sourceCode {
overflow: visible;
}
</style>
<style type="text/css" data-origin="pandoc">
pre > code.sourceCode { white-space: pre; position: relative; }
pre > code.sourceCode > span { display: inline-block; line-height: 1.25; }
pre > code.sourceCode > span:empty { height: 1.2em; }
.sourceCode { overflow: visible; }
code.sourceCode > span { color: inherit; text-decoration: inherit; }
div.sourceCode { margin: 1em 0; }
pre.sourceCode { margin: 0; }
@media screen {
div.sourceCode { overflow: auto; }
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
pre.numberSource code > span
{ position: relative; left: -4em; counter-increment: source-line; }
pre.numberSource code > span > a:first-child::before
{ content: counter(source-line);
position: relative; left: -1em; text-align: right; vertical-align: baseline;
border: none; display: inline-block;
-webkit-touch-callout: none; -webkit-user-select: none;
-khtml-user-select: none; -moz-user-select: none;
-ms-user-select: none; user-select: none;
padding: 0 4px; width: 4em;
}
pre.numberSource { margin-left: 3em; padding-left: 4px; }
div.sourceCode
{ }
@media screen {
pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; }
}
code span.al { font-weight: bold; } /* Alert */
code span.an { font-style: italic; } /* Annotation */
code span.cf { font-weight: bold; } /* ControlFlow */
code span.co { font-style: italic; } /* Comment */
code span.cv { font-style: italic; } /* CommentVar */
code span.do { font-style: italic; } /* Documentation */
code span.dt { text-decoration: underline; } /* DataType */
code span.er { font-weight: bold; } /* Error */
code span.in { font-style: italic; } /* Information */
code span.kw { font-weight: bold; } /* Keyword */
code span.pp { font-weight: bold; } /* Preprocessor */
code span.wa { font-style: italic; } /* Warning */
.sourceCode .row {
width: 100%;
}
.sourceCode {
overflow-x: auto;
}
.code-folding-btn {
margin-right: -30px;
}
</style>
<script>
// apply pandoc div.sourceCode style to pre.sourceCode instead
(function() {
var sheets = document.styleSheets;
for (var i = 0; i < sheets.length; i++) {
if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue;
try { var rules = sheets[i].cssRules; } catch (e) { continue; }
for (var j = 0; j < rules.length; j++) {
var rule = rules[j];
// check if there is a div.sourceCode rule
if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue;
var style = rule.style.cssText;
// check if color or background-color is set
if (rule.style.color === '' && rule.style.backgroundColor === '') continue;
// replace div.sourceCode by a pre.sourceCode rule
sheets[i].deleteRule(j);
sheets[i].insertRule('pre.sourceCode{' + style + '}', j);
}
}
})();
</script>
<style type = "text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
img {
max-width:100%;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
summary {
display: list-item;
}
pre code {
padding: 0;
}
</style>
<style type="text/css">
.dropdown-submenu {
position: relative;
}
.dropdown-submenu>.dropdown-menu {
top: 0;
left: 100%;
margin-top: -6px;
margin-left: -1px;
border-radius: 0 6px 6px 6px;
}
.dropdown-submenu:hover>.dropdown-menu {
display: block;
}
.dropdown-submenu>a:after {
display: block;
content: " ";
float: right;
width: 0;
height: 0;
border-color: transparent;
border-style: solid;
border-width: 5px 0 5px 5px;
border-left-color: #cccccc;
margin-top: 5px;
margin-right: -10px;
}
.dropdown-submenu:hover>a:after {
border-left-color: #adb5bd;
}
.dropdown-submenu.pull-left {
float: none;
}
.dropdown-submenu.pull-left>.dropdown-menu {
left: -100%;
margin-left: 10px;
border-radius: 6px 0 6px 6px;
}
</style>
<script type="text/javascript">
// manage active state of menu based on current page
$(document).ready(function () {
// active menu anchor
href = window.location.pathname
href = href.substr(href.lastIndexOf('/') + 1)
if (href === "")
href = "index.html";
var menuAnchor = $('a[href="' + href + '"]');
// mark it active
menuAnchor.tab('show');
// if it's got a parent navbar menu mark it active as well
menuAnchor.closest('li.dropdown').addClass('active');
// Navbar adjustments
var navHeight = $(".navbar").first().height() + 15;
var style = document.createElement('style');
var pt = "padding-top: " + navHeight + "px; ";
var mt = "margin-top: -" + navHeight + "px; ";
var css = "";
// offset scroll position for anchor links (for fixed navbar)
for (var i = 1; i <= 6; i++) {
css += ".section h" + i + "{ " + pt + mt + "}\n";
}
style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css;
document.head.appendChild(style);
});
</script>
<!-- tabsets -->
<style type="text/css">
.tabset-dropdown > .nav-tabs {
display: inline-table;
max-height: 500px;
min-height: 44px;
overflow-y: auto;
border: 1px solid #ddd;
border-radius: 4px;
}
.tabset-dropdown > .nav-tabs > li.active:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before {
content: "";
border: none;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open:before {
content: "";
font-family: 'Glyphicons Halflings';
display: inline-block;
padding: 10px;
border-right: 1px solid #ddd;
}
.tabset-dropdown > .nav-tabs > li.active {
display: block;
}
.tabset-dropdown > .nav-tabs > li > a,
.tabset-dropdown > .nav-tabs > li > a:focus,
.tabset-dropdown > .nav-tabs > li > a:hover {
border: none;
display: inline-block;
border-radius: 4px;
background-color: transparent;
}
.tabset-dropdown > .nav-tabs.nav-tabs-open > li {
display: block;
float: none;
}
.tabset-dropdown > .nav-tabs > li {
display: none;
}
</style>
<!-- code folding -->
<style type="text/css">
.code-folding-btn { margin-bottom: 4px; }
</style>
<style type="text/css">
#TOC {
margin: 25px 0px 20px 0px;
}
@media (max-width: 768px) {
#TOC {
position: relative;
width: 100%;
}
}
@media print {
.toc-content {
/* see https://github.com/w3c/csswg-drafts/issues/4434 */
float: right;
}
}
.toc-content {
padding-left: 30px;
padding-right: 40px;
}
div.main-container {
max-width: 1200px;
}
div.tocify {
width: 20%;
max-width: 260px;
max-height: 85%;
}
@media (min-width: 768px) and (max-width: 991px) {
div.tocify {
width: 25%;
}
}
@media (max-width: 767px) {
div.tocify {
width: 100%;
max-width: none;
}
}
.tocify ul, .tocify li {
line-height: 20px;
}
.tocify-subheader .tocify-item {
font-size: 0.90em;
}
.tocify .list-group-item {
border-radius: 0px;
}
.tocify-subheader {
display: inline;
}
.tocify-subheader .tocify-item {
font-size: 0.95em;
}
</style>
</head>
<body>
<div class="container-fluid main-container">
<!-- setup 3col/9col grid for toc_float and main content -->
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-3">
<div id="TOC" class="tocify">
</div>
</div>
<div class="toc-content col-xs-12 col-sm-8 col-md-9">
<div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html"></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home"></span>
Home
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="https://github.com/knthompson26/social-isolation-ADHD-bidirectional-effects">
<span class="fa fa-github fa-lg"></span>
</a>
</li>
</ul>
</div><!--/.nav-collapse -->
</div><!--/.container -->
</div><!--/.navbar -->
<div id="header">
<div class="btn-group pull-right float-right">
<button type="button" class="btn btn-default btn-xs btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button>
<ul class="dropdown-menu dropdown-menu-right" style="min-width: 50px;">
<li><a id="rmd-show-all-code" href="#">Show All Code</a></li>
<li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li>
</ul>
</div>
<h1 class="title toc-ignore">Separate mother and teacher RI-CLPM for social isolation and ADHD symptoms in childhood</h1>
</div>
<div class="sourceCode" id="cb1"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a>dat.raw <span class="ot"><-</span> <span class="fu">read_dta</span>(<span class="fu">paste0</span>(data.raw_path, <span class="st">"Katie_19Jan22.dta"</span>))</span>
<span id="cb1-2"><a href="#cb1-2" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-3"><a href="#cb1-3" aria-hidden="true" tabindex="-1"></a>dat <span class="ot"><-</span> dat.raw <span class="sc">%>%</span></span>
<span id="cb1-4"><a href="#cb1-4" aria-hidden="true" tabindex="-1"></a> dplyr<span class="sc">::</span><span class="fu">select</span>(<span class="at">id =</span> atwinid,</span>
<span id="cb1-5"><a href="#cb1-5" aria-hidden="true" tabindex="-1"></a> sampsex,</span>
<span id="cb1-6"><a href="#cb1-6" aria-hidden="true" tabindex="-1"></a> seswq35,</span>
<span id="cb1-7"><a href="#cb1-7" aria-hidden="true" tabindex="-1"></a> sisoem5, <span class="co"># social isolation mother report</span></span>
<span id="cb1-8"><a href="#cb1-8" aria-hidden="true" tabindex="-1"></a> sisoem7,</span>
<span id="cb1-9"><a href="#cb1-9" aria-hidden="true" tabindex="-1"></a> sisoem10,</span>
<span id="cb1-10"><a href="#cb1-10" aria-hidden="true" tabindex="-1"></a> sisoem12,</span>
<span id="cb1-11"><a href="#cb1-11" aria-hidden="true" tabindex="-1"></a> sisoet5, <span class="co"># social isolation teacher report</span></span>
<span id="cb1-12"><a href="#cb1-12" aria-hidden="true" tabindex="-1"></a> sisoet7, </span>
<span id="cb1-13"><a href="#cb1-13" aria-hidden="true" tabindex="-1"></a> sisoet10,</span>
<span id="cb1-14"><a href="#cb1-14" aria-hidden="true" tabindex="-1"></a> sisoet12,</span>
<span id="cb1-15"><a href="#cb1-15" aria-hidden="true" tabindex="-1"></a> tadhdem5, <span class="co"># total ADHD mother report</span></span>
<span id="cb1-16"><a href="#cb1-16" aria-hidden="true" tabindex="-1"></a> tadhdem7,</span>
<span id="cb1-17"><a href="#cb1-17" aria-hidden="true" tabindex="-1"></a> tadhdem10,</span>
<span id="cb1-18"><a href="#cb1-18" aria-hidden="true" tabindex="-1"></a> tadhdem12,</span>
<span id="cb1-19"><a href="#cb1-19" aria-hidden="true" tabindex="-1"></a> tadhdet5, <span class="co"># total ADHD teacher report</span></span>
<span id="cb1-20"><a href="#cb1-20" aria-hidden="true" tabindex="-1"></a> tadhdet7,</span>
<span id="cb1-21"><a href="#cb1-21" aria-hidden="true" tabindex="-1"></a> tadhdet10,</span>
<span id="cb1-22"><a href="#cb1-22" aria-hidden="true" tabindex="-1"></a> tadhdet12,</span>
<span id="cb1-23"><a href="#cb1-23" aria-hidden="true" tabindex="-1"></a> hyem5, <span class="co"># hyperactivity ADHD mother report</span></span>
<span id="cb1-24"><a href="#cb1-24" aria-hidden="true" tabindex="-1"></a> hyem7,</span>
<span id="cb1-25"><a href="#cb1-25" aria-hidden="true" tabindex="-1"></a> hyem10,</span>
<span id="cb1-26"><a href="#cb1-26" aria-hidden="true" tabindex="-1"></a> hyem12, </span>
<span id="cb1-27"><a href="#cb1-27" aria-hidden="true" tabindex="-1"></a> hyet5, <span class="co"># hyperactivity ADHD teacher report</span></span>
<span id="cb1-28"><a href="#cb1-28" aria-hidden="true" tabindex="-1"></a> hyet7,</span>
<span id="cb1-29"><a href="#cb1-29" aria-hidden="true" tabindex="-1"></a> hyet10,</span>
<span id="cb1-30"><a href="#cb1-30" aria-hidden="true" tabindex="-1"></a> hyet12,</span>
<span id="cb1-31"><a href="#cb1-31" aria-hidden="true" tabindex="-1"></a> inem5, <span class="co"># inattention ADHD mother report</span></span>
<span id="cb1-32"><a href="#cb1-32" aria-hidden="true" tabindex="-1"></a> inem7,</span>
<span id="cb1-33"><a href="#cb1-33" aria-hidden="true" tabindex="-1"></a> inem10,</span>
<span id="cb1-34"><a href="#cb1-34" aria-hidden="true" tabindex="-1"></a> inem12,</span>
<span id="cb1-35"><a href="#cb1-35" aria-hidden="true" tabindex="-1"></a> inet5, <span class="co"># inattention ADHD teacher report</span></span>
<span id="cb1-36"><a href="#cb1-36" aria-hidden="true" tabindex="-1"></a> inet7,</span>
<span id="cb1-37"><a href="#cb1-37" aria-hidden="true" tabindex="-1"></a> inet10,</span>
<span id="cb1-38"><a href="#cb1-38" aria-hidden="true" tabindex="-1"></a> inet12,</span>
<span id="cb1-39"><a href="#cb1-39" aria-hidden="true" tabindex="-1"></a> sisoe5,</span>
<span id="cb1-40"><a href="#cb1-40" aria-hidden="true" tabindex="-1"></a> sisoe7,</span>
<span id="cb1-41"><a href="#cb1-41" aria-hidden="true" tabindex="-1"></a> sisoe10,</span>
<span id="cb1-42"><a href="#cb1-42" aria-hidden="true" tabindex="-1"></a> sisoe12</span>
<span id="cb1-43"><a href="#cb1-43" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb1-44"><a href="#cb1-44" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-45"><a href="#cb1-45" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(dat)</span></code></pre></div>
<p>[1] “id” “sampsex” “seswq35” “sisoem5” “sisoem7” “sisoem10” [7] “sisoem12” “sisoet5” “sisoet7” “sisoet10” “sisoet12” “tadhdem5” [13] “tadhdem7” “tadhdem10” “tadhdem12” “tadhdet5” “tadhdet7” “tadhdet10” [19] “tadhdet12” “hyem5” “hyem7” “hyem10” “hyem12” “hyet5”<br />
[25] “hyet7” “hyet10” “hyet12” “inem5” “inem7” “inem10”<br />
[31] “inem12” “inet5” “inet7” “inet10” “inet12” “sisoe5”<br />
[37] “sisoe7” “sisoe10” “sisoe12”</p>
<hr />
<p>Functions</p>
<div class="sourceCode" id="cb2"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="co"># Table of model fit </span></span>
<span id="cb2-2"><a href="#cb2-2" aria-hidden="true" tabindex="-1"></a>table.model.fit <span class="ot"><-</span> <span class="cf">function</span>(model){</span>
<span id="cb2-3"><a href="#cb2-3" aria-hidden="true" tabindex="-1"></a> model.fit <span class="ot"><-</span> <span class="fu">as.data.frame</span>(<span class="fu">t</span>(<span class="fu">as.data.frame</span>(model<span class="sc">$</span>FIT))) <span class="sc">%>%</span></span>
<span id="cb2-4"><a href="#cb2-4" aria-hidden="true" tabindex="-1"></a> dplyr<span class="sc">::</span><span class="fu">select</span>(chisq, df, chisq.scaled, cfi.robust, tli.robust, aic, bic, bic2, rmsea.robust, rmsea.ci.lower.robust, rmsea.ci.upper.robust, srmr) <span class="co">#can only be used with "MLR" estimator</span></span>
<span id="cb2-5"><a href="#cb2-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(model.fit)</span>
<span id="cb2-6"><a href="#cb2-6" aria-hidden="true" tabindex="-1"></a>}</span>
<span id="cb2-7"><a href="#cb2-7" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb2-8"><a href="#cb2-8" aria-hidden="true" tabindex="-1"></a><span class="co"># Table of regression and correlation (standardised covariance) coefficients</span></span>
<span id="cb2-9"><a href="#cb2-9" aria-hidden="true" tabindex="-1"></a>table.model.coef <span class="ot"><-</span> <span class="cf">function</span>(model, type, constraints){</span>
<span id="cb2-10"><a href="#cb2-10" aria-hidden="true" tabindex="-1"></a> <span class="cf">if</span> (type <span class="sc">==</span> <span class="st">"RICLPM"</span> <span class="sc">&</span> constraints <span class="sc">==</span> <span class="st">"No"</span>){</span>
<span id="cb2-11"><a href="#cb2-11" aria-hidden="true" tabindex="-1"></a> model.coef <span class="ot"><-</span> <span class="fu">as.tibble</span>(model<span class="sc">$</span>PE[<span class="fu">c</span>(<span class="dv">17</span><span class="sc">:</span><span class="dv">32</span>),]) <span class="sc">%>%</span> dplyr<span class="sc">::</span><span class="fu">select</span>(<span class="sc">-</span>exo, <span class="sc">-</span>std.lv, <span class="sc">-</span>std.nox)</span>
<span id="cb2-12"><a href="#cb2-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(model.coef)</span>
<span id="cb2-13"><a href="#cb2-13" aria-hidden="true" tabindex="-1"></a> } <span class="cf">else</span> <span class="cf">if</span>(type <span class="sc">==</span> <span class="st">"RICLPM"</span> <span class="sc">&</span> constraints <span class="sc">==</span> <span class="st">"Yes"</span>){</span>
<span id="cb2-14"><a href="#cb2-14" aria-hidden="true" tabindex="-1"></a> model.coef <span class="ot"><-</span> <span class="fu">as.tibble</span>(model<span class="sc">$</span>PE[<span class="fu">c</span>(<span class="dv">17</span><span class="sc">:</span><span class="dv">32</span>),]) <span class="sc">%>%</span> dplyr<span class="sc">::</span><span class="fu">select</span>(<span class="sc">-</span>exo, <span class="sc">-</span>label, <span class="sc">-</span>std.lv, <span class="sc">-</span>std.nox)</span>
<span id="cb2-15"><a href="#cb2-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(model.coef)</span>
<span id="cb2-16"><a href="#cb2-16" aria-hidden="true" tabindex="-1"></a> } <span class="cf">else</span> <span class="cf">if</span>(type <span class="sc">==</span> <span class="st">"CLPM"</span> <span class="sc">&</span> constraints <span class="sc">==</span> <span class="st">"No"</span>){</span>
<span id="cb2-17"><a href="#cb2-17" aria-hidden="true" tabindex="-1"></a> model.coef <span class="ot"><-</span> <span class="fu">as.tibble</span>(model<span class="sc">$</span>PE[<span class="fu">c</span>(<span class="dv">1</span><span class="sc">:</span><span class="dv">16</span>),]) <span class="sc">%>%</span> dplyr<span class="sc">::</span><span class="fu">select</span>(<span class="sc">-</span>exo, <span class="sc">-</span>std.lv, <span class="sc">-</span>std.nox)</span>
<span id="cb2-18"><a href="#cb2-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(model.coef)</span>
<span id="cb2-19"><a href="#cb2-19" aria-hidden="true" tabindex="-1"></a> } <span class="cf">else</span> <span class="cf">if</span>(type <span class="sc">==</span> <span class="st">"CLPM"</span> <span class="sc">&</span> constraints <span class="sc">==</span> <span class="st">"Yes"</span>){</span>
<span id="cb2-20"><a href="#cb2-20" aria-hidden="true" tabindex="-1"></a> model.coef <span class="ot"><-</span> <span class="fu">as.tibble</span>(model<span class="sc">$</span>PE[<span class="fu">c</span>(<span class="dv">1</span><span class="sc">:</span><span class="dv">16</span>),]) <span class="sc">%>%</span> dplyr<span class="sc">::</span><span class="fu">select</span>(<span class="sc">-</span>exo, <span class="sc">-</span>std.lv, <span class="sc">-</span>std.nox)</span>
<span id="cb2-21"><a href="#cb2-21" aria-hidden="true" tabindex="-1"></a> <span class="fu">return</span>(model.coef)</span>
<span id="cb2-22"><a href="#cb2-22" aria-hidden="true" tabindex="-1"></a> } <span class="cf">else</span> {model.coef <span class="ot"><-</span> <span class="cn">NULL</span>}</span>
<span id="cb2-23"><a href="#cb2-23" aria-hidden="true" tabindex="-1"></a>}</span></code></pre></div>
<hr />
<div id="normality-checks" class="section level1">
<h1>Normality checks</h1>
<p>If the data is non-normal - we should use robust test statistics for all models going forward. Robust standard errors will also be calculated to account for the use of twins in our sample.</p>
<div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="co"># mother</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoem5)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-1.png" width="672" /></p>
<div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoem7)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-2.png" width="672" /></p>
<div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoem10)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-3.png" width="672" /></p>
<div class="sourceCode" id="cb6"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb6-1"><a href="#cb6-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoem12)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-4.png" width="672" /></p>
<div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a><span class="co"># teacher</span></span>
<span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoet5)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-5.png" width="672" /></p>
<div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoet7)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-6.png" width="672" /></p>
<div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoet10)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-7.png" width="672" /></p>
<div class="sourceCode" id="cb10"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb10-1"><a href="#cb10-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>sisoet12)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20social%20isolation-8.png" width="672" /></p>
<div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a><span class="co"># mother</span></span>
<span id="cb11-2"><a href="#cb11-2" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyem5)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-1.png" width="672" /></p>
<div class="sourceCode" id="cb12"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb12-1"><a href="#cb12-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyem7)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-2.png" width="672" /></p>
<div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyem10)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-3.png" width="672" /></p>
<div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyem12)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-4.png" width="672" /></p>
<div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a><span class="co"># mother</span></span>
<span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyet5)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-5.png" width="672" /></p>
<div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyet7)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-6.png" width="672" /></p>
<div class="sourceCode" id="cb17"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb17-1"><a href="#cb17-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyet10)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-7.png" width="672" /></p>
<div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>hyet12)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20hyperactivity-8.png" width="672" /></p>
<div class="sourceCode" id="cb19"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb19-1"><a href="#cb19-1" aria-hidden="true" tabindex="-1"></a><span class="co"># mother</span></span>
<span id="cb19-2"><a href="#cb19-2" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inem5)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-1.png" width="672" /></p>
<div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inem7)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-2.png" width="672" /></p>
<div class="sourceCode" id="cb21"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb21-1"><a href="#cb21-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inem10)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-3.png" width="672" /></p>
<div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inem12)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-4.png" width="672" /></p>
<div class="sourceCode" id="cb23"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb23-1"><a href="#cb23-1" aria-hidden="true" tabindex="-1"></a><span class="co"># mother</span></span>
<span id="cb23-2"><a href="#cb23-2" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inet5)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-5.png" width="672" /></p>
<div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inet7)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-6.png" width="672" /></p>
<div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inet10)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-7.png" width="672" /></p>
<div class="sourceCode" id="cb26"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb26-1"><a href="#cb26-1" aria-hidden="true" tabindex="-1"></a><span class="fu">hist</span>(dat<span class="sc">$</span>inet12)</span></code></pre></div>
<p><img src="RICLPM_isolation_adhd_files/figure-html/histogram%20inattention-8.png" width="672" /></p>
<hr />
<p>The below introductory notes have been adapted from <a href="https://www.researchgate.net/profile/Ellen-Hamaker/publication/274262847_A_Critique_of_the_Cross-Lagged_Panel_Model/links/5b80154c92851c1e122f351f/A-Critique-of-the-Cross-Lagged-Panel-Model.pdf">Hamaker, Kuiper, and Grasman, 2015</a></p>
<p>The CLPM only accounts for temporal stability through the inclusion of autoregressive parameters. Thus, it is implicitly assumed that every person varies over time around the same means μt and πt, and that there are no trait-like individual differences that endure. this is a rather problematic assumption, as it is difficult to imagine a psychological construct – whether behavioral, cognitive, emotional or psychophysiological – that is not to some extent characterized by stable individual differences (if not for the entire lifespan, then at least for the duration of the study; Hamaker, ). Longitudinal data can actually be thought of as multilevel data, in which occasions are nested within individuals (or other systems, like dyads). When considering this perspective, it becomes clear that we need to separate the <em>within-person</em> level from the <em>between-person</em> level.</p>
<p>The random intercepts cross lagged panel model (RI-CLPM) accounts not only for temporal stability, but also for time-invariant, trait-like stability through the inclusion of a random intercept. The cross-lagged parameters indicate the extent to which the two variables influence each other. The cross-lagged relationships pertain to a process that takes place at the within-person level and they are therefore of key interest when the interest is in <em>reciprocal influences over time within individuals or dyads</em>. The cross-lagged parameter indicates the extent to which the change in y can be predicted from the individual’s prior deviation from their expected score on the other variable, while controlling for the structural change in y and the prior deviation from one’s expected score on y.</p>
<p>The CLPM requires only two waves of data, but the RI-CLPM requires at least <em>three waves</em> of data, in which case there is 1 degree of freedom (df). If the intervals are of the same size, and if we assume that the effects the variables have on each other remain stable over time, we could decide to constrain the lagged parameters over time, giving us an additional 4 df (i.e., 5 df in total). If we are not willing to make these assumptions, and we are not sure whether the effect of the time-invariant stability components κi and ωi are equal over time, we may wish to remove the constraint on the factor loadings. This relaxation may especially be of interest when the observations are made further apart in time, and we expect that we are also measuring some structural changes. However, this would imply that κi and ωi no longer represents random intercepts (as in multilevel modeling), but rather represent latent variables or traits (as common in SEM). Even more so, it would imply we need more waves of data to estimate this model. <strong>The gaps in our time waves may be a problem here.</strong></p>
</div>
<div id="all-ri-clpm-models" class="section level1">
<h1>All RI-CLPM models</h1>
<p>We conducted RI-CLPM to assess bidirectional associations between social isolation and ADHD symptoms. All models in this script have used sum scores for total ADHD symptoms, hyperactivity symptoms, inattention symptoms, and social isolation. Separate models have been conducted for mother and teacher scores. See the table below for a list of all models and how they are labeled throughout the code.</p>
<table>
<colgroup>
<col width="12%" />
<col width="87%" />
</colgroup>
<thead>
<tr class="header">
<th>Model</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>CLPM</td>
<td>Cross-lagged panel model without random intercepts using <strong>mother report</strong> and <strong>total ADHD</strong> scores</td>
</tr>
<tr class="even">
<td>RICLPM</td>
<td>Basic RI-CLPM model using <strong>mother report</strong> ratings for AD and SI, and <strong>total ADHD</strong> scores</td>
</tr>
<tr class="odd">
<td>RICLPM2</td>
<td>RICLPM but with fixed autoregressive and cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPM2a</td>
<td>RICLPM but with fixed ADHD autoregressive over time</td>
</tr>
<tr class="odd">
<td>RICLPM2b</td>
<td>RICLPM but with fixed social isolation autoregressive over time</td>
</tr>
<tr class="even">
<td>RICLPM2c</td>
<td>RICLPM but with fixed ADHD to social isolation cross-lagged relations over time</td>
</tr>
<tr class="odd">
<td>RICLPM2d</td>
<td>RICLPM but with fixed all cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPM3</td>
<td>RICLPM but with constrained grand means for AD and SI</td>
</tr>
<tr class="odd">
<td>RICLPM_hyp</td>
<td>Basic RI-CLPM model using <strong>mother report</strong> ratings for AD and SI, and <strong>hyperactivity</strong> scores</td>
</tr>
<tr class="even">
<td>RICLPM_hyp2</td>
<td>RICLPM_hyp but with fixed autoregressive and cross-lagged relations over time</td>
</tr>
<tr class="odd">
<td>RICLPM_hyp2a</td>
<td>RICLPM_hyp but with fixed ADHD autoregressive over time</td>
</tr>
<tr class="even">
<td>RICLPM_hyp2b</td>
<td>RICLPM_hyp but with fixed social isolation autoregressive over time</td>
</tr>
<tr class="odd">
<td>RICLPM_hyp2c</td>
<td>RICLPM_hyp but with fixed ADHD to social isolation cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPM_hyp2d</td>
<td>RICLPM_hyp but with fixed all cross-lagged relations over time</td>
</tr>
<tr class="odd">
<td>RICLPM_hyp3</td>
<td>RICLPM_hyp but with constrained grand means for AD and SI</td>
</tr>
<tr class="even">
<td>RICLPM_inat</td>
<td>Basic RI-CLPM model using <strong>mother report</strong> ratings for AD and SI, and <strong>inattention</strong> scores</td>
</tr>
<tr class="odd">
<td>RICLPM_inat2</td>
<td>RICLPM_inat but with fixed autoregressive and cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPM_inat2a</td>
<td>RICLPM_inat but with fixed ADHD autoregressive over time</td>
</tr>
<tr class="odd">
<td>RICLPM_inat2b</td>
<td>RICLPM_inat but with fixed social isolation autoregressive over time</td>
</tr>
<tr class="even">
<td>RICLPM_inat2c</td>
<td>RICLPM_inat but with fixed ADHD to social isolation cross-lagged relations over time</td>
</tr>
<tr class="odd">
<td>RICLPM_inat2d</td>
<td>RICLPM_inat but with fixed all cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPM_inat3</td>
<td>RICLPM_inat but with constrained grand means for AD and SI</td>
</tr>
<tr class="odd">
<td>CLPMt</td>
<td>Cross-lagged panel model without random intercepts using <strong>teacher report</strong> and <strong>total ADHD</strong> scores</td>
</tr>
<tr class="even">
<td>RICLPMt</td>
<td>Basic RI-CLPM model using <strong>teacher report</strong> ratings for AD and SI, and <strong>total ADHD</strong> scores</td>
</tr>
<tr class="odd">
<td>RICLPMt2</td>
<td>RICLPMt but with fixed autoregressive and cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPMt3</td>
<td>RICLPMt but with constrained grand means for AD and SI</td>
</tr>
<tr class="odd">
<td>RICLPMt_hyp</td>
<td>Basic RI-CLPM model using <strong>teacher report</strong> ratings for AD and SI, and <strong>hyperactivity</strong> scores</td>
</tr>
<tr class="even">
<td>RICLPMt_hyp2</td>
<td>RICLPMt_hyp but with fixed autoregressive and cross-lagged relations over time</td>
</tr>
<tr class="odd">
<td>RICLPMt_hyp3</td>
<td>RICLPMt_hyp but with constrained grand means for AD and SI</td>
</tr>
<tr class="even">
<td>RICLPMt_inat</td>
<td>Basic RI-CLPM model using <strong>teacher report</strong> ratings for AD and SI, and <strong>inattention</strong> scores</td>
</tr>
<tr class="odd">
<td>RICLPMt_inat2</td>
<td>RICLPMt_inat but with fixed autoregressive and cross-lagged relations over time</td>
</tr>
<tr class="even">
<td>RICLPMt_inat3</td>
<td>RICLPMt_inat but with constrained grand means for AD and SI</td>
</tr>
</tbody>
</table>
<hr />
</div>
<div id="ri-clpm-mother-report-only-total-adhd-symptoms" class="section level1">
<h1>RI-CLPM: Mother report only, total ADHD symptoms</h1>
<p>For SEM in <a href="https://lavaan.ugent.be/index.html">lavaan</a>, we use three different formula types: latent variabele definitions (using the <code>=~</code> operator, which can be read as is “measured by”), regression formulas (using the <code>~</code> operator), and (co)variance formulas (using the <code>~~</code> operator). The regression formulas are similar to ordinary formulas in R. The expression <code>y1 ~~ y2</code> allows the residual variances of the two observed variables to be correlated. This is sometimes done if it is believed that the two variables have something in common that is not captured by the latent variables. Note that the two expressions <code>y2 ~~ y4</code> and <code>y2 ~~ y6</code>, can be combined into the expression <code>y2 ~~ y4 + y6</code>, because the variable on the left of the <code>~~</code> operator (y2) is the same. This is just a shorthand notation. In general, to fix a parameter in a lavaan formula, you need to pre-multiply the corresponding variable in the formula by a numerical value. This is called the pre-multiplication mechanism and will be used for many purposes e.g. <code>1*x2</code>. If you wish to fix the correlation (or covariance) between a pair of latent variables to zero, you need to explicity add a covariance-formula for this pair, and fix the parameter to zero.</p>
<p>To specify the RI-CLPM we need four parts: notes from <a href="https://jeroendmulder.github.io/RI-CLPM/lavaan.html">Mulder’s webpage</a>.</p>
<ul>
<li><p>A between part, consisting of the random intercepts. It is specified using the =~ command, <code>RIx =~ 1*x1 1*x2 ...</code>, where 1* fixes the factor loading to one.</p></li>
<li><p>A within part, consisting of within-unit fluctuations. It is also specified using the =~ command, <code>wx1 =~ 1*x1; wx2 =~ 1*x2;</code></p></li>
<li><p>The lagged regressions between the within-unit components, using <code>wx2 ~ wx1 wy1; wx3 ~ wx2 wy2; ...</code>. Here, this is written with two variables on the left hand side of the <code>~</code>, this is doing the same thing as calculating just regression paths - but combining DVs that have the same paths leading to them, e.g. <code>wx2 ~ wx1 + wy1</code> and <code>wy2 ~ wx1 + wy1</code> becomes <code>wx2+ wy2 ~ wx1 + wy1</code>.</p></li>
<li><p>Relevant covariances in both the between and within part. In the within part the components at wave 1, and their residuals at waves 2 and further are correlated within each wave, using <code>wx1 ~~ wy1; wx2 ~~ wy2;...</code>. We also need to specify their (residual) variances here using <code>wx1 ~~ wx1; wx2 ~~ wx2; ...</code>. For the between part we have to specify the variances and covariance of the random intercepts using <code>RIx ~~ RIy;</code>.</p></li>
</ul>
<p>Tips for interpreting the output: - Model Test User Model: which provides a test statistic, degrees of freedom, and a p-value for the model that was specified by the user. - Model Test Baseline Model: The baseline is a null model, typically in which all of your observed variables are constrained to covary with no other variables (put another way, the covariances are fixed to 0)–just individual variances are estimated.</p>
<div id="cross-lagged-panel-model-clpm" class="section level2">
<h2>Cross-lagged panel model (CLPM)</h2>
<div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a>CLPM <span class="ot"><-</span> <span class="st">'</span></span>
<span id="cb27-2"><a href="#cb27-2" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the lagged effects between the observed variables.</span></span>
<span id="cb27-3"><a href="#cb27-3" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem7 + sisoem7 ~ tadhdem5 + sisoem5</span></span>
<span id="cb27-4"><a href="#cb27-4" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem10 + sisoem10 ~ tadhdem7 + sisoem7</span></span>
<span id="cb27-5"><a href="#cb27-5" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem12 + sisoem12 ~ tadhdem10 + sisoem10</span></span>
<span id="cb27-6"><a href="#cb27-6" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb27-7"><a href="#cb27-7" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the covariance between the observed variables at the first wave. </span></span>
<span id="cb27-8"><a href="#cb27-8" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem5 ~~ sisoem5 # Covariance</span></span>
<span id="cb27-9"><a href="#cb27-9" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb27-10"><a href="#cb27-10" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the covariances between the residuals of the observed variables.</span></span>
<span id="cb27-11"><a href="#cb27-11" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem7 ~~ sisoem7</span></span>
<span id="cb27-12"><a href="#cb27-12" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem10 ~~ sisoem10</span></span>
<span id="cb27-13"><a href="#cb27-13" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem12 ~~ sisoem12</span></span>
<span id="cb27-14"><a href="#cb27-14" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb27-15"><a href="#cb27-15" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the (residual) variance of the observed variables.</span></span>
<span id="cb27-16"><a href="#cb27-16" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem5 ~~ tadhdem5 # Variances</span></span>
<span id="cb27-17"><a href="#cb27-17" aria-hidden="true" tabindex="-1"></a><span class="st"> sisoem5 ~~ sisoem5 </span></span>
<span id="cb27-18"><a href="#cb27-18" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem7 ~~ tadhdem7 # Residual variances</span></span>
<span id="cb27-19"><a href="#cb27-19" aria-hidden="true" tabindex="-1"></a><span class="st"> sisoem7 ~~ sisoem7 </span></span>
<span id="cb27-20"><a href="#cb27-20" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem10 ~~ tadhdem10 </span></span>
<span id="cb27-21"><a href="#cb27-21" aria-hidden="true" tabindex="-1"></a><span class="st"> sisoem10 ~~ sisoem10 </span></span>
<span id="cb27-22"><a href="#cb27-22" aria-hidden="true" tabindex="-1"></a><span class="st"> tadhdem12 ~~ tadhdem12 </span></span>
<span id="cb27-23"><a href="#cb27-23" aria-hidden="true" tabindex="-1"></a><span class="st"> sisoem12 ~~ sisoem12 </span></span>
<span id="cb27-24"><a href="#cb27-24" aria-hidden="true" tabindex="-1"></a><span class="st">'</span></span></code></pre></div>
<div class="sourceCode" id="cb28"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb28-1"><a href="#cb28-1" aria-hidden="true" tabindex="-1"></a>CLPM.fit <span class="ot"><-</span> <span class="fu">lavaan</span>(CLPM, </span>
<span id="cb28-2"><a href="#cb28-2" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> dat, </span>
<span id="cb28-3"><a href="#cb28-3" aria-hidden="true" tabindex="-1"></a> <span class="at">missing =</span> <span class="st">'ML'</span>,</span>
<span id="cb28-4"><a href="#cb28-4" aria-hidden="true" tabindex="-1"></a> <span class="at">meanstructure =</span> <span class="cn">TRUE</span>, </span>
<span id="cb28-5"><a href="#cb28-5" aria-hidden="true" tabindex="-1"></a> <span class="at">int.ov.free =</span> <span class="cn">TRUE</span>,</span>
<span id="cb28-6"><a href="#cb28-6" aria-hidden="true" tabindex="-1"></a> <span class="at">se =</span> <span class="st">"robust"</span>,</span>
<span id="cb28-7"><a href="#cb28-7" aria-hidden="true" tabindex="-1"></a> <span class="at">estimator =</span> <span class="st">"MLR"</span> <span class="co">#maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic </span></span>
<span id="cb28-8"><a href="#cb28-8" aria-hidden="true" tabindex="-1"></a> ) </span>
<span id="cb28-9"><a href="#cb28-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb28-10"><a href="#cb28-10" aria-hidden="true" tabindex="-1"></a>CLPM.fit.summary <span class="ot"><-</span> <span class="fu">summary</span>(CLPM.fit, </span>
<span id="cb28-11"><a href="#cb28-11" aria-hidden="true" tabindex="-1"></a> <span class="at">fit.measures =</span> <span class="cn">TRUE</span>,</span>
<span id="cb28-12"><a href="#cb28-12" aria-hidden="true" tabindex="-1"></a> <span class="at">standardized =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<p>lavaan 0.6-10 ended normally after 48 iterations</p>
<p>Estimator ML Optimization method NLMINB Number of model parameters 32</p>
<p>Number of observations 2232 Number of missing patterns 11</p>
<p>Model Test User Model: Standard Robust Test Statistic 459.048 265.187 Degrees of freedom 12 12 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.731 Yuan-Bentler correction (Mplus variant)</p>
<p>Model Test Baseline Model:</p>
<p>Test statistic 6741.919 3685.347 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.829</p>
<p>User Model versus Baseline Model:</p>
<p>Comparative Fit Index (CFI) 0.933 0.931 Tucker-Lewis Index (TLI) 0.845 0.838</p>
<p>Robust Comparative Fit Index (CFI) 0.934 Robust Tucker-Lewis Index (TLI) 0.847</p>
<p>Loglikelihood and Information Criteria:</p>
<p>Loglikelihood user model (H0) -36566.211 -36566.211 Scaling correction factor 2.065 for the MLR correction<br />
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.974 for the MLR correction</p>
<p>Akaike (AIC) 73196.422 73196.422 Bayesian (BIC) 73379.163 73379.163 Sample-size adjusted Bayesian (BIC) 73277.494 73277.494</p>
<p>Root Mean Square Error of Approximation:</p>
<p>RMSEA 0.129 0.097 90 Percent confidence interval - lower 0.119 0.090 90 Percent confidence interval - upper 0.139 0.105 P-value RMSEA <= 0.05 0.000 0.000</p>
<p>Robust RMSEA 0.128 90 Percent confidence interval - lower 0.115 90 Percent confidence interval - upper 0.142</p>
<p>Standardized Root Mean Square Residual:</p>
<p>SRMR 0.061 0.061</p>
<p>Parameter Estimates:</p>
<p>Standard errors Sandwich Information bread Observed Observed information based on Hessian</p>
<p>Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdem7 ~<br />
tadhdem5 0.544 0.023 23.341 0.000 0.544 0.585 sisoem5 0.197 0.058 3.394 0.001 0.197 0.077 sisoem7 ~<br />
tadhdem5 0.042 0.009 4.454 0.000 0.042 0.108 sisoem5 0.526 0.036 14.625 0.000 0.526 0.493 tadhdem10 ~<br />
tadhdem7 0.495 0.027 18.345 0.000 0.495 0.534 sisoem7 0.187 0.061 3.050 0.002 0.187 0.084 sisoem10 ~<br />
tadhdem7 0.053 0.011 4.850 0.000 0.053 0.119 sisoem7 0.503 0.036 14.100 0.000 0.503 0.474 tadhdem12 ~<br />
tadhdem10 0.703 0.026 26.762 0.000 0.703 0.701 sisoem10 0.027 0.045 0.600 0.548 0.027 0.013 sisoem12 ~<br />
tadhdem10 0.060 0.011 5.711 0.000 0.060 0.124 sisoem10 0.581 0.027 21.377 0.000 0.581 0.570</p>
<p>Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdem5 ~~<br />
sisoem5 1.700 0.177 9.606 0.000 1.700 0.298 .tadhdem7 ~~<br />
.sisoem7 0.692 0.109 6.356 0.000 0.692 0.183 .tadhdem10 ~~<br />
.sisoem10 0.875 0.125 7.026 0.000 0.875 0.224 .tadhdem12 ~~<br />
.sisoem12 0.781 0.127 6.143 0.000 0.781 0.248</p>
<p>Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem7 0.602 0.076 7.926 0.000 0.602 0.163 .sisoem7 0.335 0.037 9.079 0.000 0.335 0.218 .tadhdem10 0.706 0.070 10.098 0.000 0.706 0.206 .sisoem10 0.462 0.036 12.663 0.000 0.462 0.284 .tadhdem12 0.463 0.060 7.682 0.000 0.463 0.135 .sisoem12 0.278 0.033 8.367 0.000 0.278 0.168 tadhdem5 3.369 0.084 40.091 0.000 3.369 0.849 sisoem5 0.974 0.030 31.967 0.000 0.974 0.677</p>
<p>Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all tadhdem5 15.743 0.603 26.122 0.000 15.743 1.000 sisoem5 2.070 0.127 16.358 0.000 2.070 1.000 .tadhdem7 8.510 0.415 20.511 0.000 8.510 0.625 .sisoem7 1.677 0.093 18.038 0.000 1.677 0.713 .tadhdem10 7.971 0.398 20.019 0.000 7.971 0.680 .sisoem10 1.922 0.106 18.100 0.000 1.922 0.726 .tadhdem12 5.907 0.356 16.578 0.000 5.907 0.502 .sisoem12 1.684 0.105 16.006 0.000 1.684 0.612</p>
<div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Table of model fit </span></span>
<span id="cb29-2"><a href="#cb29-2" aria-hidden="true" tabindex="-1"></a>CLPM.fit.summary.fit <span class="ot"><-</span> <span class="fu">table.model.fit</span>(CLPM.fit.summary)</span>
<span id="cb29-3"><a href="#cb29-3" aria-hidden="true" tabindex="-1"></a>CLPM.fit.summary.fit</span></code></pre></div>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":[""],"name":["_rn_"],"type":[""],"align":["left"]},{"label":["chisq"],"name":[1],"type":["dbl"],"align":["right"]},{"label":["df"],"name":[2],"type":["dbl"],"align":["right"]},{"label":["chisq.scaled"],"name":[3],"type":["dbl"],"align":["right"]},{"label":["cfi.robust"],"name":[4],"type":["dbl"],"align":["right"]},{"label":["tli.robust"],"name":[5],"type":["dbl"],"align":["right"]},{"label":["aic"],"name":[6],"type":["dbl"],"align":["right"]},{"label":["bic"],"name":[7],"type":["dbl"],"align":["right"]},{"label":["bic2"],"name":[8],"type":["dbl"],"align":["right"]},{"label":["rmsea.robust"],"name":[9],"type":["dbl"],"align":["right"]},{"label":["rmsea.ci.lower.robust"],"name":[10],"type":["dbl"],"align":["right"]},{"label":["rmsea.ci.upper.robust"],"name":[11],"type":["dbl"],"align":["right"]},{"label":["srmr"],"name":[12],"type":["dbl"],"align":["right"]}],"data":[{"1":"459.048","2":"12","3":"265.1867","4":"0.9344948","5":"0.8471545","6":"73196.42","7":"73379.16","8":"73277.49","9":"0.1279192","10":"0.114793","11":"0.1415265","12":"0.0613037","_rn_":"model$FIT"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
<div class="sourceCode" id="cb30"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb30-1"><a href="#cb30-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Table of regression coefficients and covariances (concurrent associations)</span></span>
<span id="cb30-2"><a href="#cb30-2" aria-hidden="true" tabindex="-1"></a>CLPM.fit.summary.reg <span class="ot"><-</span> <span class="fu">table.model.coef</span>(<span class="at">model =</span> CLPM.fit.summary, <span class="at">type =</span> <span class="st">"CLPM"</span>, <span class="at">constraints =</span> <span class="st">"No"</span>)</span>
<span id="cb30-3"><a href="#cb30-3" aria-hidden="true" tabindex="-1"></a>CLPM.fit.summary.reg</span></code></pre></div>
<div data-pagedtable="false">
<script data-pagedtable-source type="application/json">
{"columns":[{"label":["lhs"],"name":[1],"type":["chr"],"align":["left"]},{"label":["op"],"name":[2],"type":["chr"],"align":["left"]},{"label":["rhs"],"name":[3],"type":["chr"],"align":["left"]},{"label":["est"],"name":[4],"type":["dbl"],"align":["right"]},{"label":["se"],"name":[5],"type":["dbl"],"align":["right"]},{"label":["z"],"name":[6],"type":["dbl"],"align":["right"]},{"label":["pvalue"],"name":[7],"type":["dbl"],"align":["right"]},{"label":["std.all"],"name":[8],"type":["dbl"],"align":["right"]}],"data":[{"1":"tadhdem7","2":"~","3":"tadhdem5","4":"0.54398423","5":"0.023305591","6":"23.3413615","7":"0.000000e+00","8":"0.58498031"},{"1":"tadhdem7","2":"~","3":"sisoem5","4":"0.19704353","5":"0.058057903","6":"3.3939140","7":"6.890132e-04","8":"0.07683153"},{"1":"sisoem7","2":"~","3":"tadhdem5","4":"0.04177811","5":"0.009379348","6":"4.4542662","7":"8.418061e-06","8":"0.10810471"},{"1":"sisoem7","2":"~","3":"sisoem5","4":"0.52576225","5":"0.035948744","6":"14.6253303","7":"0.000000e+00","8":"0.49329596"},{"1":"tadhdem10","2":"~","3":"tadhdem7","4":"0.49523972","5":"0.026995180","6":"18.3454870","7":"0.000000e+00","8":"0.53379881"},{"1":"tadhdem10","2":"~","3":"sisoem7","4":"0.18664488","5":"0.061189945","6":"3.0502540","7":"2.286479e-03","8":"0.08360598"},{"1":"sisoem10","2":"~","3":"tadhdem7","4":"0.05259345","5":"0.010844354","6":"4.8498460","7":"1.235574e-06","8":"0.11927273"},{"1":"sisoem10","2":"~","3":"sisoem7","4":"0.50270947","5":"0.035654303","6":"14.0995457","7":"0.000000e+00","8":"0.47378985"},{"1":"tadhdem12","2":"~","3":"tadhdem10","4":"0.70285759","5":"0.026263396","6":"26.7618703","7":"0.000000e+00","8":"0.70132652"},{"1":"tadhdem12","2":"~","3":"sisoem10","4":"0.02685631","5":"0.044735738","6":"0.6003324","7":"5.482847e-01","8":"0.01273655"},{"1":"sisoem12","2":"~","3":"tadhdem10","4":"0.06011649","5":"0.010525735","6":"5.7113820","7":"1.120624e-08","8":"0.12400854"},{"1":"sisoem12","2":"~","3":"sisoem10","4":"0.58114915","5":"0.027185787","6":"21.3769479","7":"0.000000e+00","8":"0.56976810"},{"1":"tadhdem5","2":"~~","3":"sisoem5","4":"1.69960293","5":"0.176932537","6":"9.6059377","7":"0.000000e+00","8":"0.29773661"},{"1":"tadhdem7","2":"~~","3":"sisoem7","4":"0.69249223","5":"0.108946708","6":"6.3562473","7":"2.067420e-10","8":"0.18330578"},{"1":"tadhdem10","2":"~~","3":"sisoem10","4":"0.87499855","5":"0.124541086","6":"7.0257822","7":"2.128742e-12","8":"0.22355682"},{"1":"tadhdem12","2":"~~","3":"sisoem12","4":"0.78099893","5":"0.127143572","6":"6.1426536","7":"8.115413e-10","8":"0.24761422"}],"options":{"columns":{"min":{},"max":[10]},"rows":{"min":[10],"max":[10]},"pages":{}}}
</script>
</div>
</div>
<div id="the-basic-ri-clpm-model-riclpm" class="section level2">
<h2>The basic RI-CLPM model (RICLPM)</h2>
<p>The code for specifying the basic RI-CLPM is given below.</p>
<div class="sourceCode" id="cb31"><pre class="sourceCode r fold-show"><code class="sourceCode r"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a>RICLPM <span class="ot"><-</span> <span class="st">'</span></span>
<span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a><span class="st"> # Create between components (random intercepts treated as factors here)</span></span>
<span id="cb31-3"><a href="#cb31-3" aria-hidden="true" tabindex="-1"></a><span class="st"> RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x</span></span>
<span id="cb31-4"><a href="#cb31-4" aria-hidden="true" tabindex="-1"></a><span class="st"> RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y</span></span>
<span id="cb31-5"><a href="#cb31-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb31-6"><a href="#cb31-6" aria-hidden="true" tabindex="-1"></a><span class="st"> # Create within-person centered variables</span></span>
<span id="cb31-7"><a href="#cb31-7" aria-hidden="true" tabindex="-1"></a><span class="st"> wad5 =~ 1*tadhdem5</span></span>
<span id="cb31-8"><a href="#cb31-8" aria-hidden="true" tabindex="-1"></a><span class="st"> wad7 =~ 1*tadhdem7</span></span>
<span id="cb31-9"><a href="#cb31-9" aria-hidden="true" tabindex="-1"></a><span class="st"> wad10 =~ 1*tadhdem10 </span></span>
<span id="cb31-10"><a href="#cb31-10" aria-hidden="true" tabindex="-1"></a><span class="st"> wad12 =~ 1*tadhdem12</span></span>
<span id="cb31-11"><a href="#cb31-11" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi5 =~ 1*sisoem5</span></span>
<span id="cb31-12"><a href="#cb31-12" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi7 =~ 1*sisoem7</span></span>
<span id="cb31-13"><a href="#cb31-13" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi10 =~ 1*sisoem10</span></span>
<span id="cb31-14"><a href="#cb31-14" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi12 =~ 1*sisoem12</span></span>
<span id="cb31-15"><a href="#cb31-15" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb31-16"><a href="#cb31-16" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the lagged effects between the within-person centered variables</span></span>
<span id="cb31-17"><a href="#cb31-17" aria-hidden="true" tabindex="-1"></a><span class="st"> wad7 + wsi7 ~ wad5 + wsi5</span></span>
<span id="cb31-18"><a href="#cb31-18" aria-hidden="true" tabindex="-1"></a><span class="st"> wad10 + wsi10 ~ wad7 + wsi7</span></span>
<span id="cb31-19"><a href="#cb31-19" aria-hidden="true" tabindex="-1"></a><span class="st"> wad12 + wsi12 ~ wad10 + wsi10</span></span>
<span id="cb31-20"><a href="#cb31-20" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb31-21"><a href="#cb31-21" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the covariance between the within-person centered variables at the first wave</span></span>
<span id="cb31-22"><a href="#cb31-22" aria-hidden="true" tabindex="-1"></a><span class="st"> wad5 ~~ wsi5 # Covariance</span></span>
<span id="cb31-23"><a href="#cb31-23" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb31-24"><a href="#cb31-24" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the covariances between the residuals of the within-person centered variables (the innovations)</span></span>
<span id="cb31-25"><a href="#cb31-25" aria-hidden="true" tabindex="-1"></a><span class="st"> wad7 ~~ wsi7</span></span>
<span id="cb31-26"><a href="#cb31-26" aria-hidden="true" tabindex="-1"></a><span class="st"> wad10 ~~ wsi10</span></span>
<span id="cb31-27"><a href="#cb31-27" aria-hidden="true" tabindex="-1"></a><span class="st"> wad12 ~~ wsi12</span></span>
<span id="cb31-28"><a href="#cb31-28" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb31-29"><a href="#cb31-29" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the variance and covariance of the random intercepts</span></span>
<span id="cb31-30"><a href="#cb31-30" aria-hidden="true" tabindex="-1"></a><span class="st"> RIad ~~ RIad</span></span>
<span id="cb31-31"><a href="#cb31-31" aria-hidden="true" tabindex="-1"></a><span class="st"> RIsi ~~ RIsi</span></span>
<span id="cb31-32"><a href="#cb31-32" aria-hidden="true" tabindex="-1"></a><span class="st"> RIad ~~ RIsi</span></span>
<span id="cb31-33"><a href="#cb31-33" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb31-34"><a href="#cb31-34" aria-hidden="true" tabindex="-1"></a><span class="st"> # Estimate the (residual) variance of the within-person centered variables.</span></span>
<span id="cb31-35"><a href="#cb31-35" aria-hidden="true" tabindex="-1"></a><span class="st"> wad5 ~~ wad5 # Variances</span></span>
<span id="cb31-36"><a href="#cb31-36" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi5 ~~ wsi5 </span></span>
<span id="cb31-37"><a href="#cb31-37" aria-hidden="true" tabindex="-1"></a><span class="st"> wad7 ~~ wad7 # Residual variances</span></span>
<span id="cb31-38"><a href="#cb31-38" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi7 ~~ wsi7 </span></span>
<span id="cb31-39"><a href="#cb31-39" aria-hidden="true" tabindex="-1"></a><span class="st"> wad10 ~~ wad10 </span></span>
<span id="cb31-40"><a href="#cb31-40" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi10 ~~ wsi10 </span></span>
<span id="cb31-41"><a href="#cb31-41" aria-hidden="true" tabindex="-1"></a><span class="st"> wad12 ~~ wad12 </span></span>
<span id="cb31-42"><a href="#cb31-42" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi12 ~~ wsi12</span></span>
<span id="cb31-43"><a href="#cb31-43" aria-hidden="true" tabindex="-1"></a><span class="st">'</span></span></code></pre></div>
<div class="sourceCode" id="cb32"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb32-1"><a href="#cb32-1" aria-hidden="true" tabindex="-1"></a>RICLPM.fit <span class="ot"><-</span> <span class="fu">lavaan</span>(RICLPM, <span class="co"># model</span></span>
<span id="cb32-2"><a href="#cb32-2" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> dat, <span class="co"># data</span></span>
<span id="cb32-3"><a href="#cb32-3" aria-hidden="true" tabindex="-1"></a> <span class="at">missing =</span> <span class="st">'ML'</span>, <span class="co"># how to handle missing data </span></span>
<span id="cb32-4"><a href="#cb32-4" aria-hidden="true" tabindex="-1"></a> <span class="at">meanstructure =</span> <span class="cn">TRUE</span>, <span class="co"># adds intercepts/means to the model for both observed and latent variables</span></span>
<span id="cb32-5"><a href="#cb32-5" aria-hidden="true" tabindex="-1"></a> <span class="at">se =</span> <span class="st">"robust"</span>, <span class="co"># robust standard errors</span></span>
<span id="cb32-6"><a href="#cb32-6" aria-hidden="true" tabindex="-1"></a> <span class="at">int.ov.free =</span> <span class="cn">TRUE</span>, <span class="co"># if FALSE, the intercepts of the observed variables are fixed to zero</span></span>
<span id="cb32-7"><a href="#cb32-7" aria-hidden="true" tabindex="-1"></a> <span class="at">estimator =</span> <span class="st">"MLR"</span> <span class="co">#maximum likelihood with robust (Huber-White) standard errors and a scaled (Yuan-Bentler) and robust test statistic</span></span>
<span id="cb32-8"><a href="#cb32-8" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb32-9"><a href="#cb32-9" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb32-10"><a href="#cb32-10" aria-hidden="true" tabindex="-1"></a>RICLPM.fit.summary <span class="ot"><-</span> <span class="fu">summary</span>(RICLPM.fit, </span>
<span id="cb32-11"><a href="#cb32-11" aria-hidden="true" tabindex="-1"></a> <span class="at">fit.measures =</span> <span class="cn">TRUE</span>,</span>
<span id="cb32-12"><a href="#cb32-12" aria-hidden="true" tabindex="-1"></a> <span class="at">standardized =</span> <span class="cn">TRUE</span>)</span></code></pre></div>
<p>lavaan 0.6-10 ended normally after 108 iterations</p>
<p>Estimator ML Optimization method NLMINB Number of model parameters 35</p>
<p>Number of observations 2232 Number of missing patterns 11</p>
<p>Model Test User Model: Standard Robust Test Statistic 95.493 61.768 Degrees of freedom 9 9 P-value (Chi-square) 0.000 0.000 Scaling correction factor 1.546 Yuan-Bentler correction (Mplus variant)</p>
<p>Model Test Baseline Model:</p>
<p>Test statistic 6741.919 3685.347 Degrees of freedom 28 28 P-value 0.000 0.000 Scaling correction factor 1.829</p>
<p>User Model versus Baseline Model:</p>
<p>Comparative Fit Index (CFI) 0.987 0.986 Tucker-Lewis Index (TLI) 0.960 0.955</p>
<p>Robust Comparative Fit Index (CFI) 0.988 Robust Tucker-Lewis Index (TLI) 0.962</p>
<p>Loglikelihood and Information Criteria:</p>
<p>Loglikelihood user model (H0) -36384.434 -36384.434 Scaling correction factor 2.084 for the MLR correction<br />
Loglikelihood unrestricted model (H1) NA NA Scaling correction factor 1.974 for the MLR correction</p>
<p>Akaike (AIC) 72838.867 72838.867 Bayesian (BIC) 73038.740 73038.740 Sample-size adjusted Bayesian (BIC) 72927.540 72927.540</p>
<p>Root Mean Square Error of Approximation:</p>
<p>RMSEA 0.066 0.051 90 Percent confidence interval - lower 0.054 0.042 90 Percent confidence interval - upper 0.078 0.061 P-value RMSEA <= 0.05 0.014 0.396</p>
<p>Robust RMSEA 0.064 90 Percent confidence interval - lower 0.049 90 Percent confidence interval - upper 0.079</p>
<p>Standardized Root Mean Square Residual:</p>
<p>SRMR 0.031 0.031</p>
<p>Parameter Estimates:</p>
<p>Standard errors Sandwich Information bread Observed Observed information based on Hessian</p>
<p>Latent Variables: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad =~<br />
tadhdem5 1.000 2.568 0.638 tadhdem7 1.000 2.568 0.707 tadhdem10 1.000 2.568 0.750 tadhdem12 1.000 2.568 0.751 RIsi =~<br />
sisoem5 1.000 0.911 0.622 sisoem7 1.000 0.911 0.603 sisoem10 1.000 0.911 0.560 sisoem12 1.000 0.911 0.555 wad5 =~<br />
tadhdem5 1.000 3.098 0.770 wad7 =~<br />
tadhdem7 1.000 2.568 0.707 wad10 =~<br />
tadhdem10 1.000 2.263 0.661 wad12 =~<br />
tadhdem12 1.000 2.258 0.660 wsi5 =~<br />
sisoem5 1.000 1.147 0.783 wsi7 =~<br />
sisoem7 1.000 1.205 0.798 wsi10 =~<br />
sisoem10 1.000 1.347 0.828 wsi12 =~<br />
sisoem12 1.000 1.366 0.832</p>
<p>Regressions: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad7 ~<br />
wad5 0.233 0.038 6.168 0.000 0.281 0.281 wsi5 0.092 0.087 1.060 0.289 0.041 0.041 wsi7 ~<br />
wad5 0.028 0.015 1.937 0.053 0.073 0.073 wsi5 0.236 0.060 3.917 0.000 0.224 0.224 wad10 ~<br />
wad7 0.022 0.064 0.343 0.731 0.025 0.025 wsi7 0.171 0.115 1.487 0.137 0.091 0.091 wsi10 ~<br />
wad7 0.035 0.023 1.486 0.137 0.066 0.066 wsi7 0.266 0.061 4.333 0.000 0.238 0.238 wad12 ~<br />
wad10 0.314 0.066 4.773 0.000 0.315 0.315 wsi10 0.041 0.074 0.557 0.577 0.025 0.025 wsi12 ~<br />
wad10 0.026 0.029 0.897 0.370 0.044 0.044 wsi10 0.424 0.043 9.977 0.000 0.418 0.418</p>
<p>Covariances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all wad5 ~~<br />
wsi5 0.748 0.156 4.782 0.000 0.210 0.210 .wad7 ~~<br />
.wsi7 0.441 0.129 3.424 0.001 0.154 0.154 .wad10 ~~<br />
.wsi10 0.752 0.158 4.764 0.000 0.257 0.257 .wad12 ~~<br />
.wsi12 0.592 0.111 5.308 0.000 0.225 0.225 RIad ~~<br />
RIsi 1.095 0.142 7.697 0.000 0.468 0.468</p>
<p>Intercepts: Estimate Std.Err z-value P(>|z|) Std.lv Std.all .tadhdem5 3.369 0.084 40.093 0.000 3.369 0.837 .tadhdem7 2.627 0.079 33.386 0.000 2.627 0.723 .tadhdem10 2.192 0.073 29.924 0.000 2.192 0.640 .tadhdem12 2.033 0.073 27.728 0.000 2.033 0.595 .sisoem5 0.974 0.030 31.967 0.000 0.974 0.665 .sisoem7 0.987 0.033 30.133 0.000 0.987 0.654 .sisoem10 1.097 0.035 31.447 0.000 1.097 0.675 .sisoem12 1.048 0.036 29.455 0.000 1.048 0.638 RIad 0.000 0.000 0.000 RIsi 0.000 0.000 0.000 wad5 0.000 0.000 0.000 .wad7 0.000 0.000 0.000 .wad10 0.000 0.000 0.000 .wad12 0.000 0.000 0.000 wsi5 0.000 0.000 0.000 .wsi7 0.000 0.000 0.000 .wsi10 0.000 0.000 0.000 .wsi12 0.000 0.000 0.000</p>
<p>Variances: Estimate Std.Err z-value P(>|z|) Std.lv Std.all RIad 6.596 0.487 13.536 0.000 1.000 1.000 RIsi 0.829 0.101 8.174 0.000 1.000 1.000 wad5 9.596 0.509 18.871 0.000 1.000 1.000 wsi5 1.316 0.126 10.462 0.000 1.000 1.000 .wad7 6.027 0.421 14.299 0.000 0.914 0.914 .wsi7 1.361 0.102 13.392 0.000 0.937 0.937 .wad10 5.070 0.526 9.639 0.000 0.990 0.990 .wsi10 1.692 0.113 14.914 0.000 0.933 0.933 .wad12 4.568 0.305 14.958 0.000 0.896 0.896 .wsi12 1.518 0.097 15.628 0.000 0.813 0.813 .tadhdem5 0.000 0.000 0.000 .tadhdem7 0.000 0.000 0.000 .tadhdem10 0.000 0.000 0.000 .tadhdem12 0.000 0.000 0.000 .sisoem5 0.000 0.000 0.000 .sisoem7 0.000 0.000 0.000 .sisoem10 0.000 0.000 0.000 .sisoem12 0.000 0.000 0.000</p>
<div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="co">#Table of model fit </span></span>
<span id="cb33-2"><a href="#cb33-2" aria-hidden="true" tabindex="-1"></a>RICLPM.fit.summary.fit <span class="ot"><-</span> <span class="fu">table.model.fit</span>(RICLPM.fit.summary)</span>
<span id="cb33-3"><a href="#cb33-3" aria-hidden="true" tabindex="-1"></a><span class="co">#Table of regression coefficients and covariances (concurrent associations)</span></span>
<span id="cb33-4"><a href="#cb33-4" aria-hidden="true" tabindex="-1"></a>RICLPM.fit.summary.reg <span class="ot"><-</span> <span class="fu">table.model.coef</span>(<span class="at">model =</span> RICLPM.fit.summary, <span class="at">type =</span> <span class="st">"RICLPM"</span>, <span class="at">constraints =</span> <span class="st">"No"</span>)</span></code></pre></div>
</div>
<div id="comparison-between-clpm-and-ri-clpm" class="section level2">
<h2>Comparison between CLPM and RI-CLPM</h2>
<p>The use of the chi-square difference test is wide-spread in the SEM community to test constraints on parameters. However, when constraints are placed on the bound of the parameter space, we should use the chi-bar-square test (χ¯2-test) (Stoel et al. 2006). For example, if we constrain the variances of all random intercepts (and their covariance) in the RI-CLPM to zero, we obtain a model that is nested under the RI-CLPM, and that is statistically equivalent to the traditional cross-lagged panel model (CLPM). Below you can find R code for performing the chi-bar-square test (code by Rebecca M. Kuiper) for comparing these two models. It involves</p>
<ol style="list-style-type: decimal">
<li>fitting both the RI-CLPM (RICLPM.fit) and CLPM (CLPM.fit); (already done - this is the non-constrained RI-CLPM - RICLPM.fit)</li>
<li>extracting the covariance matrix of the random intercepts;</li>
<li>extracting the χ2 and degrees of freedom of both models; and</li>
<li>performing the χ¯2-test using the ChiBarSq.DiffTest package (Kuiper 2020).</li>
</ol>
<div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="co"># # Step 2: check which indices you need to get the covariance matrix of the random intercepts. </span></span>
<span id="cb34-2"><a href="#cb34-2" aria-hidden="true" tabindex="-1"></a><span class="co"># vcov(RICLPM.fit) # Full covariance matrix</span></span>
<span id="cb34-3"><a href="#cb34-3" aria-hidden="true" tabindex="-1"></a><span class="co"># indices <- c(17, 18) # From the matrix above, you need the variance of each intercept. Here, the 17th and the 18th indices regard the random intercepts. </span></span>
<span id="cb34-4"><a href="#cb34-4" aria-hidden="true" tabindex="-1"></a><span class="co"># number <- length(indices) # Number of random intercepts</span></span>
<span id="cb34-5"><a href="#cb34-5" aria-hidden="true" tabindex="-1"></a><span class="co"># cov.matrix <- vcov(RICLPM.fit)[indices, indices] # Extract full covariance matrix of the random intercepts</span></span>
<span id="cb34-6"><a href="#cb34-6" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb34-7"><a href="#cb34-7" aria-hidden="true" tabindex="-1"></a><span class="co"># # Step 3: call Chi square and degrees of freedom from each model</span></span>
<span id="cb34-8"><a href="#cb34-8" aria-hidden="true" tabindex="-1"></a><span class="co"># Chi2_CLPM <- summary(CLPM.fit, fit.measures = TRUE)[1]$FIT[c("chisq")] # Extract chi-square value of CLPM</span></span>
<span id="cb34-9"><a href="#cb34-9" aria-hidden="true" tabindex="-1"></a><span class="co"># Chi2_RICLPM <- summary(RICLPM.fit, fit.measures = TRUE)[1]$FIT[c("chisq")] # Extract chi-square value of RI-CLPM</span></span>
<span id="cb34-10"><a href="#cb34-10" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb34-11"><a href="#cb34-11" aria-hidden="true" tabindex="-1"></a><span class="co"># df_CLPM <- summary(CLPM.fit, fit.measures = TRUE)[1]$FIT[c("df")] # Extract df of CLPM</span></span>
<span id="cb34-12"><a href="#cb34-12" aria-hidden="true" tabindex="-1"></a><span class="co"># df_RICLPM <- summary(RICLPM.fit, fit.measures = TRUE)[1]$FIT[c("df")] # Extract df of RI-CLPM</span></span>
<span id="cb34-13"><a href="#cb34-13" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span>
<span id="cb34-14"><a href="#cb34-14" aria-hidden="true" tabindex="-1"></a><span class="co"># # Step 4: run function to do chi-bar-square test (and also obtain Chi-bar-square weigths)</span></span>
<span id="cb34-15"><a href="#cb34-15" aria-hidden="true" tabindex="-1"></a><span class="co"># ChiBar2DiffTest <- ChiBarSq.DiffTest(number, cov.matrix, Chi2_CLPM, Chi2_RICLPM, df_CLPM, df_RICLPM)</span></span>
<span id="cb34-16"><a href="#cb34-16" aria-hidden="true" tabindex="-1"></a><span class="co"># ChiBar2DiffTest</span></span>
<span id="cb34-17"><a href="#cb34-17" aria-hidden="true" tabindex="-1"></a><span class="co"># ChiBar2DiffTest$p_value</span></span></code></pre></div>
</div>
<div id="ri-clpm-constraints-over-time" class="section level2 tabset tabset-fade">
<h2 class="tabset tabset-fade">RI-CLPM Constraints over time</h2>
<p>Imposing constraints to the model can be achieved through <strong>pre-multiplication</strong>. It means that we have to prepend the number that we want to fix the parameter to, and an asterisk, to the parameter in the model specification. For example, <code>F =~ 0*x1</code> fixes the factor loading of item <code>x1</code> to factor <code>F</code> to 0. Using pre-multiplication we can also constrain parameters to be the same by giving them the same label. Below we specify an RI-CLPM with the following constraints:</p>
<ol style="list-style-type: decimal">
<li>fixed auto-regressive and cross-lagged relations over time, <code>wx2 ~ a*wx1 + b*wy1; ...</code></li>
<li>time-invariant (residual) (co-)variances in the within-person part <code>wx2 ~~ cov*wy2; ...</code>, <code>wx2 ~~ vx*wx2; ...</code>, and <code>wy2 ~~ vy*wy2; ...</code></li>
<li>constrained grand means over time, <code>x1 + ... ~ mx*1</code> and <code>y1 + ... ~ my*1</code></li>
</ol>
<div id="fixed-autoregressive-and-cross-lagged-relations-over-time-riclpm2" class="section level3">
<h3>Fixed autoregressive and cross-lagged relations over time (RICLPM2)</h3>
<p>a = lag in ad b = lag in si c = cross lag ad->si d = cross lag si->ad</p>
<p>From <a href="https://www.tandfonline.com/doi/full/10.1080/10705511.2020.1784738">Mulder and Hamaker (2021)</a>: We may consider testing if the lagged regression coefficients are time-invariant. This can be done by comparing the fit of a model with constrained regression coefficients (over time), with the fit of a model where these parameters are freely estimated (i.e., the unconstrained model). If this chi-square difference test is non-significant, this implies the constraints are tenable and the dynamics of the process are time-invariant. If the constraints are not tenable, this could be indicative of some kind of developmental process taking place during the time span covered by the study. In this context, it is important to realize that the lagged regression coefficients depend critically on the time interval between the repeated measures. Hence, constraining the lagged parameters to be invariant across consecutive waves only makes sense when the time interval between the occasions is <em>(approximately) equal</em>.</p>
<div id="constraining-all-lag-and-crosslag-parameters-at-once-riclpm2" class="section level4">
<h4>Constraining all lag and crosslag parameters at once (RICLPM2)</h4>
<div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a>RICLPM2 <span class="ot"><-</span> <span class="st">'</span></span>
<span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a><span class="st"> # Create between components (random intercepts treated as factors here)</span></span>
<span id="cb35-3"><a href="#cb35-3" aria-hidden="true" tabindex="-1"></a><span class="st"> RIad =~ 1*tadhdem5 + 1*tadhdem7 + 1*tadhdem10 + 1*tadhdem12 #x</span></span>
<span id="cb35-4"><a href="#cb35-4" aria-hidden="true" tabindex="-1"></a><span class="st"> RIsi =~ 1*sisoem5 + 1*sisoem7 + 1*sisoem10 + 1*sisoem12 #y</span></span>
<span id="cb35-5"><a href="#cb35-5" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb35-6"><a href="#cb35-6" aria-hidden="true" tabindex="-1"></a><span class="st"> # Create within-person centered variables</span></span>
<span id="cb35-7"><a href="#cb35-7" aria-hidden="true" tabindex="-1"></a><span class="st"> wad5 =~ 1*tadhdem5</span></span>
<span id="cb35-8"><a href="#cb35-8" aria-hidden="true" tabindex="-1"></a><span class="st"> wad7 =~ 1*tadhdem7</span></span>
<span id="cb35-9"><a href="#cb35-9" aria-hidden="true" tabindex="-1"></a><span class="st"> wad10 =~ 1*tadhdem10 </span></span>
<span id="cb35-10"><a href="#cb35-10" aria-hidden="true" tabindex="-1"></a><span class="st"> wad12 =~ 1*tadhdem12</span></span>
<span id="cb35-11"><a href="#cb35-11" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi5 =~ 1*sisoem5</span></span>
<span id="cb35-12"><a href="#cb35-12" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi7 =~ 1*sisoem7</span></span>
<span id="cb35-13"><a href="#cb35-13" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi10 =~ 1*sisoem10</span></span>
<span id="cb35-14"><a href="#cb35-14" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi12 =~ 1*sisoem12</span></span>
<span id="cb35-15"><a href="#cb35-15" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb35-16"><a href="#cb35-16" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb35-17"><a href="#cb35-17" aria-hidden="true" tabindex="-1"></a><span class="st"> # Constrained lagged effects between the within-person centered variables. </span></span>
<span id="cb35-18"><a href="#cb35-18" aria-hidden="true" tabindex="-1"></a><span class="st"> wad7 ~ a*wad5 + d*wsi5 </span></span>
<span id="cb35-19"><a href="#cb35-19" aria-hidden="true" tabindex="-1"></a><span class="st"> wsi7 ~ c*wad5 + b*wsi5</span></span>
<span id="cb35-20"><a href="#cb35-20" aria-hidden="true" tabindex="-1"></a><span class="st"> </span></span>
<span id="cb35-21"><a href="#cb35-21" aria-hidden="true" tabindex="-1"></a><span class="st"> wad10 ~ a*wad7 + d*wsi7</span></span>