-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode
More file actions
306 lines (245 loc) · 6.57 KB
/
Copy pathcode
File metadata and controls
306 lines (245 loc) · 6.57 KB
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
This is code for bi-variate RI-CLPM
RICLPM <- '
a1~mua1*1 #fix the intercept of a1 to mean of a1, which is a freely estimated parameter
m1~mum1*1 #this step already defines the latent variables
a2~mua2*1
m2~mum2*1
a3~mua3*1
m3~mum3*1
a4~mua4*1
m4~mum4*1
a5~mua5*1
m5~mum5*1
a6~mua6*1
m6~mum6*1
a7~mua7*1
m7~mum7*1
a1~~0*a1 #variance of a1 is 0
m1~~0*m1
a2~~0*a2
m2~~0*m2
a3~~0*a3
m3~~0*m3
a4~~0*a4
m4~~0*m4
a5~~0*a5
m5~~0*m5
a6~~0*a6
m6~~0*m6
a7~~0*a7
m7~~0*m7
Ia~~0*FFa1 # covariance of Ia and FFa1 is fixed to 0 -> Ia, Im, FFa1, and FFm1 are orthogonal factors
Ia~~0*FFm1
Im~~0*FFa1
Im~~0*FFm1
Ia=~1*a1+1*a2+1*a3+1*a4+1*a5+1*a6+1*a7 #define Ia
Im=~1*m1+1*m2+1*m3+1*m4+1*m5+1*m6+1*m7 #define Im
Ia~0*1 #the intercept of Ia is 0??
Im~0*1 #the intercept of Im is 0??
Ia~~taua*Ia #variance of Ia is taux
Im~~taum*Im #variance of Im is tauy
Ia~~tauam*Im #covariance of Ia and Im is tauam
FFa1~0*1 #the intercept of FFa1 is 0
FFm1~0*1 #the intercept of FFm1 is 0
FFa1~~phia*FFa1 #variance of FFa1 is phia
FFm1~~phim*FFm1 #variance of FFm1 is phim
FFa1~~phiam*FFm1 #covariance of FFa1 and FFm1 is phiam (yellow curved arrow)
#FFa1~ gammaa*FFm1 # 24-03-25: found this line, it doesnt exist for all models, but it doesnt matter, the results stay the same with or without it
FFm2~ betam*FFm1+gammam*FFa1
FFa2~ betaa*FFa1+gammaa*FFm2
FFm3~ betam*FFm2+gammam*FFa2
FFa3~ betaa*FFa2+gammaa*FFm3
FFm4~ betam*FFm3+gammam*FFa3
FFa4~ betaa*FFa3+gammaa*FFm4
FFm5~ betam*FFm4+gammam*FFa4
FFa5~ betaa*FFa4+gammaa*FFm5
FFm6~ betam*FFm5+gammam*FFa5
FFa6~ betaa*FFa5+gammaa*FFm6
FFm7~ betam*FFm6+gammam*FFa6
FFa7~ betaa*FFa6+gammaa*FFm7
FFa2~~Omegaa*FFa2 #variance of FFa2 is Omegaa
FFa3~~Omegaa*FFa3
FFa4~~Omegaa*FFa4
FFa5~~Omegaa*FFa5
FFa6~~Omegaa*FFa6
FFa7~~Omegaa*FFa7
FFm2~~Omegam*FFm2 #variance of FFm2 is Omegam
FFm3~~Omegam*FFm3
FFm4~~Omegam*FFm4
FFm5~~Omegam*FFm5
FFm6~~Omegam*FFm6
FFm7~~Omegam*FFm7
FFa2~~Omegaam*FFm2 #covariance of FFa2 and FFm2 is Omegaam
FFa3~~Omegaam*FFm3 # 24-03-15: Abe and I found out somehow we skipped these & added them again
FFa4~~Omegaam*FFm4
FFa5~~Omegaam*FFm5
FFa6~~Omegaam*FFm6
FFa7~~Omegaam*FFm7
FFm1 =~ 1*m1 #define the latent variable f*m1 (from fm) #here Abe suggests to also freely estimate insteading of fixing the parameters to 1
FFm2 =~ 1*m2
FFm3 =~ 1*m3
FFm4 =~ 1*m4
FFm5 =~ 1*m5
FFm6 =~ 1*m6
FFm7 =~ 1*m7
FFa1 =~ 1*a1 #define the latent variable a*1 (from fa)
FFa2 =~ 1*a2
FFa3 =~ 1*a3
FFa4 =~ 1*a4
FFa5 =~ 1*a5
FFa6 =~ 1*a6
FFa7 =~ 1*a7
'
#this is for the tri-variate model
RICLPM_tri <- '
a1~mua1*1 #fix the intercept of a1 to mean of a1, which is a freely estimated parameter
m1~mum1*1 #this step already defines the latent variableS
t1~mut1*1
a2~mua2*1
m2~mum2*1
t2~mut2*1
a3~mua3*1
m3~mum3*1
t3~mut3*1
a4~mua4*1
m4~mum4*1
t4~mut4*1
a5~mua5*1
m5~mum5*1
t5~mut5*1
a6~mua6*1
m6~mum6*1
t6~mut6*1
a7~mua7*1
m7~mum7*1
t7~mut7*1
a1~~0*a1 #variance of a1 is 0
m1~~0*m1
t1~~0*t1
a2~~0*a2
m2~~0*m2
t2~~0*t2
a3~~0*a3
m3~~0*m3
t3~~0*t3
a4~~0*a4
m4~~0*m4
t4~~0*t4
a5~~0*a5
m5~~0*m5
t5~~0*t5
a6~~0*a6
m6~~0*m6
t6~~0*t6
a7~~0*a7
m7~~0*m7
t7~~0*t7
Ia~~0*FFa1 # covariance of Ia and FFa1 is fixed to 0 -> Ia, Im, FFa1, and FFm1 are orthogonal factors
Ia~~0*FFm1
Ia~~0*FFt1
Im~~0*FFa1
Im~~0*FFm1
Im~~0*FFt1
It~~0*FFm1
It~~0*FFa1
It~~0*FFt1
Ia=~1*a1+1*a2+1*a3+1*a4+1*a5+1*a6+1*a7 #define Ia
Im=~1*m1+1*m2+1*m3+1*m4+1*m5+1*m6+1*m7 #define Im
It=~1*t1+1*t2+1*t3+1*t4+1*t5+1*t6+1*t7 #define It
Ia~0*1 #the intercept of Ia is 0??
Im~0*1 #the intercept of Im is 0??
It~0*1
Ia~~taua*Ia #variance of Ia is taux
Im~~taum*Im #variance of Im is tauy
It~~taut*It #variance of It is taut
Ia~~tauat*It #covariance of Ia and It is tauat
Im~~taumt*It #covariance of Im and It is taumt
Ia~~tauam*Im #covariance of Im and Ia is tauam
FFa1~0*1 #the intercept of FFa1 is 0
FFm1~0*1 #the intercept of FFm1 is 0
FFt1~0*1 #the intercept of FFt1 is 0
FFa1~~phia*FFa1 #variance of FFa1 is phia
FFm1~~phim*FFm1 #variance of FFm1 is phim
FFt1~~phit*FFt1 #variance of FFt1 is phit
FFa1~~phiat*FFt1 #covariance of FFa1 and FFt1 is phiat (yellow curved arrow)
FFa1~~phiam*FFm1 #covariance of FFa1 and FFm1 is phiam (yellow curved arrow)
#FFt1~~phita*FFa1 #covariance of FFt1 and FFa1 is phita (yellow curved arrow) #error: duplicate model element
FFt1~~phitm*FFm1 #covariance of FFt1 and FFm1 is phitm (yellow curved arrow)
#FFm1~~phima*FFa1 #covariance of FFm1 and FFa1 is phima (yellow curved arrow) #error: duplicate model element
#FFm1~~phimt*FFt1 #covariance of FFm1 and FFt1 is phimt (yellow curved arrow) #error: duplicate model element
FFm2~ betam*FFm1+gammam*FFa1
FFt2~ betat*FFt1+epsilont*FFm2
FFa2~ betaa*FFa1+zetaa*FFt2 #what about a1? and t1? answer: cannot predict the 1st time
FFm3~ betam*FFm2+gammam*FFa2
FFt3~ betat*FFt2+epsilont*FFm3
FFa3~ betaa*FFa2+zetaa*FFt3
FFm4~ betam*FFm3+gammam*FFa3
FFt4~ betat*FFt3+epsilont*FFm4
FFa4~ betaa*FFa3+zetaa*FFt4
FFm5~ betam*FFm4+gammam*FFa4
FFt5~ betat*FFt4+epsilont*FFm5
FFa5~ betaa*FFa4+zetaa*FFt5
FFm6~ betam*FFm5+gammam*FFa5
FFt6~ betat*FFt5+epsilont*FFm6
FFa6~ betaa*FFa5+zetaa*FFt6
FFm7~ betam*FFm6+gammam*FFa6
FFt7~ betat*FFt6+epsilont*FFm7
FFa7~ betaa*FFa6+zetaa*FFt7
FFa2~~Omegaa*FFa2 #variance of FFa2 is Omegaa
FFa3~~Omegaa*FFa3
FFa4~~Omegaa*FFa4
FFa5~~Omegaa*FFa5
FFa6~~Omegaa*FFa6
FFa7~~Omegaa*FFa7
FFm2~~Omegam*FFm2 #variance of FFm2 is Omegam
FFm3~~Omegam*FFm3
FFm4~~Omegam*FFm4
FFm5~~Omegam*FFm5
FFm6~~Omegam*FFm6
FFm7~~Omegam*FFm7
FFt2~~Omegat*FFt2 #variance of FFt2 is Omegat
FFt3~~Omegat*FFt3
FFt4~~Omegat*FFt4
FFt5~~Omegat*FFt5
FFt6~~Omegat*FFt6
FFt7~~Omegat*FFt7
FFa2~~Omegaam*FFm2 #covariance of FFa2 and FFm2 is Omegaam
FFa3~~Omegaam*FFm3 # 24-03-15: Abe and I found out somehow we skipped this
FFa4~~Omegaam*FFm4 # 24-03-15: added these covariances
FFa5~~Omegaam*FFm5
FFa6~~Omegaam*FFm6
FFa7~~Omegaam*FFm7
FFa2~~Omegaat*FFt2
FFa3~~Omegaat*FFt3
FFa4~~Omegaat*FFt4
FFa5~~Omegaat*FFt5
FFa6~~Omegaat*FFt6
FFa7~~Omegaat*FFt7
FFt2~~Omegatm*FFm2
FFt3~~Omegatm*FFm3
FFt4~~Omegatm*FFm4
FFt5~~Omegatm*FFm5
FFt6~~Omegatm*FFm6
FFt7~~Omegatm*FFm7
FFm1 =~ 1*m1 #define the latent variable f*m1 (from fm) #here Abe suggests to also freely estimate insteading of fixing the parameters to 1
FFm2 =~ 1*m2
FFm3 =~ 1*m3
FFm4 =~ 1*m4
FFm5 =~ 1*m5
FFm6 =~ 1*m6
FFm7 =~ 1*m7
FFa1 =~ 1*a1 #define the latent variable a*1 (from fa)
FFa2 =~ 1*a2
FFa3 =~ 1*a3
FFa4 =~ 1*a4
FFa5 =~ 1*a5
FFa6 =~ 1*a6
FFa7 =~ 1*a7
FFt1 =~ 1*t1 #define the latent variable t*1 (from ft) currently not in the graph
FFt2 =~ 1*t2
FFt3 =~ 1*t3
FFt4 =~ 1*t4
FFt5 =~ 1*t5
FFt6 =~ 1*t6
FFt7 =~ 1*t7
'