forked from TDJorgensen/lavaan.mi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFuturePlans.txt
183 lines (137 loc) · 6 KB
/
FuturePlans.txt
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
TODO list
=========
- lavTestScore.mi() and modindices.mi() "should" use mean-EPC even when test="D1"
- Rubin's rules are applied to user-defined parameters (:=). Should they be
re-defined from pooled estimates? (can delta method be applied to pooled SEs?)
- when h1 fits worse than h0 (on average across imputations)
- set LRT to NA instead of 0?
- or is this just Monte Carlo error when h0 is true?
blavaan
- automate saving posterior samples of NAs to use as multiple imputations
SAM
- Could sam() operate on summary stats? That makes it available for poolSat()
mitml::testEstimates() can pool estimates
===============================================
Notes to simplify methods for lavaan.mi objects
(implemented in March-April 2024)
===============================================
Create a faux-lavaan object to capitalize on lavaan's method
- lavaan.mi::fitMeasures() arguments to pass to lavTestLRT.mi()
- internally pass remaining arguments to lavaan::fitMeasures()
- pool test(s) and store in @test slot
- store default baseline.model as faux lavaan object in @external
- this takes care of all indices based on chi-squared
RMR needs more finesse
======================
LIST of inclusions for (S/C)RMR
- In @SampleStats slot:
- @nobs
- @ntotal
- @missing.flag
- if (TRUE) @missing.h1[[g]]$sigma & @missing.h1[[g]]$mu
- just set FALSE so lavaan finds it where complete-data would be
- @cov & @mean
OR
- @res.cov & @res.int
- In @implied slot:
- $cov & $mean
OR
- $res.cov & $res.int (probably not $res.th, but just in case)
- also $res.slopes, $cov.x, & $mean.x per level (only for MLSEM)
- $group.w for EffectLiteR package?
- In @h1 slot:
- $implied$cov & $implied$mean
OR
(only for MLSEM, per level)
- $res.cov, $res.int, $res.slopes, $cov.x, & $mean.x
Details about where/when these are necessary:
- FILE: lav_fit_srmr.R
FUNCTIONS:
(1) lav_fit_srmr_mplus() needs:
- @SampleStats@cov & @SampleStats@mean OR @[email protected] & @[email protected]
- @[email protected] (probably always == FALSE for lavaan.mi)
- if (missing.flag == TRUE) @[email protected][[g]]$sigma & @[email protected][[g]]$mu
- @implied$cov & @implied$mean OR @implied$res.cov & @implied$res.int
(2) lav_fit_srmr_twolevel()
- @h1$implied$cov & @h1$implied$mean (per level)
- @implied$cov & @implied$mean
- @SampleStats@nobs & @SampleStats@ntotal
- Might call lav_model_implied_cond2uncond() in FILE: lav_model_implied.R,
which would need @implied[c("res.cov","res.int","res.slopes","cov.x","mean.x")]
- also @implied$res.th, which is unavailable for 2-level SEMs in lavaan
- also @implied$group.w: Can effectLite interact with lavaan.mi?
(3) lav_fit_srmr_lavobject() can call (1) and (2), and needs:
- @SampleStats@nobs
- @SampleStats@ntotal
- calls lav_residuals_summary(se=FALSE) in FILE: lav_residuals.R (see below),
but that has no consequence for fitMeasures.mi(), only for lavResiduals()
lavResiduals.mi()
=================
LIST of inclusions BEYOND already required for (S/C)RMR:
- In @SampleStats slot:
- @NACOV
- @x.idx
- @icov (inverse of cov!)
- @WLS.V (only when using GLS, WLS, DLS)
- @WLS.VD (vector = diag(WLS.V) or identity)
- In @Data slot:
- @weights (average group weights across imputations? or assume constant?)
- @eXo and @X (only for PML)
- these could vary, making average not categorical
- just don't allow lavResiduals.mi() for PML
Details about where/when these are necessary:
- FILE: lav_residuals.R
FUNCTIONS:
(1) lav_residuals_summary(se=TRUE) calls lav_residuals_acov() in the same file
(2) lav_residuals_acov() needs:
- @SampleStats@NACOV
- @SampleStats@nobs
- @SampleStats@ntotal
- calls lav_model_h1_information() in FILE lav_model_h1_information.R (see below)
- calls lavTech("sampstat"), which uses @SampleStats or @h1$implied (covered for RMR)
- FILE: lav_model_h1_information.R
FUNCTIONS:
lav_model_h1_information() calls one of the following:
- lav_model_h1_information_expected/observed() needs:
- @SampleStats@ngroups
if (conditional.x)
- @implied$res.int, @implied$cov, & @implied$res.slopes OR
- @[email protected], @[email protected], & @SampleStats@nobs
else (!conditional.x)
- @implied$cov & @implied$mean OR @SampleStats@mean & @SampleStats@icov (inverse of cov!)
- @Data@weights (average group weights across imputations?)
- @implied$group.w
- @[email protected] (only when using GLS, WLS, DLS)
- Only for DLS:
- @SampleStats@NACOV
- Only for DWLS or ULS:
- @[email protected] (vector = diag(WLS.V) or identity)
- lav_model_h1_information_firstorder() ADDITIONALLY needs:
- @Data@X (copy of modeled variables when using PML)
- @Data@eXo (copy of exogenous variables when using PML with conditional.x).
These should be fixed across all imputations! But might not be,
so average them? Issue a warning?
standardizedSolution.mi()
=========================
LIST of inclusions:
- @Model@GLIST
- @ParTable$est
- @implied$cov.x
- @vcov$vcov
Details about where/when these are necessary:
- FILE: lav_standardize.R
FUNCTIONS:
(1) lav_standardize_<lv,all,nox>_x() calls (2) with unstd coefs as the first
argument. This is used to calculate delta-method ACOV / SEs in the
function lav_object_inspect_vcov() from FILE lav_object_inspect.R (see below)
(2) lav_standardize_<lv,all,nox>() does the work, needs:
- @Model@GLIST
- @ParTable$est
- @implied$cov.x
- FILE: lav_object_inspect.R
FUNCTION: lav_object_inspect_vcov() needs:
- @vcov$vcov
- calls lav_model_get_parameters(), which needs @Model@GLIST