I am currently working on a project where I am fitting several CFA models to imputed data. I am running into an issue where I get warnings when attempting to fit the models even though, according to the output, they seem to be converging normally.
# Model B- Two factor (noncompliance & negative affect)
# Specify Model B
mod.b2 <- 'NonComp.f =~ odd1sc + odd2sc + odd3sc + odds4sc + odds5sc + odds6sc
NA.f =~ odds1sc + odds2sc + odds3sc
NonComp.f ~~ NA.f'
# Fit Model B
fit.mod.b2.wlsmvs.mi <- runMI(model = mod.b2, data = bag.sem, fun = "cfa",
estimator = "WLSMVS",
std.lv = TRUE, verbose = TRUE, control = list(rel.tol = 1e-4),
ordered = c("odd1sc", "odd2sc", "odd3sc", "odds1sc", "odds2sc",
"odds3sc", "odds4sc", "odds5sc", "odds6sc"))
Here is the output:
lavaan.mi object based on 30 imputed data sets.
See class?lavaan.mi help page for available methods.
Convergence information:
The model converged on 30 imputed data sets
Rubin's (1987) rules were used to pool point and SE estimates across 30 imputed data sets, and to calculate degrees of freedom for each parameter's t test and CI.
Parameter Estimates:
Information Expected
Information saturated (h1) model Unstructured
Standard Errors Robust.sem
Latent Variables:
Estimate Std.Err t-value df P(>|t|)
NonComp.f =~
odd1sc 0.841 0.020 41.949 Inf 0.000
odd2sc 0.851 0.018 46.639 Inf 0.000
odd3sc 0.795 0.022 36.032 Inf 0.000
odds4sc 0.495 0.037 13.320 730.651 0.000
odds5sc 0.638 0.031 20.569 1093.553 0.000
odds6sc 0.679 0.029 23.579 1050.360 0.000
NA.f =~
odds1sc 0.815 0.021 39.312 785.371 0.000
odds2sc 0.902 0.015 59.176 789.892 0.000
odds3sc 0.694 0.029 23.941 713.587 0.000
Covariances:
Estimate Std.Err t-value df P(>|t|)
NonComp.f ~~
NA.f 0.950 0.016 60.938 660.708 0.000
Intercepts:
Estimate Std.Err t-value df P(>|t|)
.odd1sc 0.000
.odd2sc 0.000
.odd3sc 0.000
.odds4sc 0.000
.odds5sc 0.000
.odds6sc 0.000
.odds1sc 0.000
.odds2sc 0.000
.odds3sc 0.000
NonComp.f 0.000
NA.f 0.000
Thresholds:
Estimate Std.Err t-value df P(>|t|)
odd1sc|t1 -0.710 0.051 -13.877 Inf 0.000
odd1sc|t2 -0.102 0.047 -2.185 Inf 0.029
odd2sc|t1 -0.722 0.051 -14.070 Inf 0.000
odd2sc|t2 -0.027 0.047 -0.580 Inf 0.562
odd3sc|t1 -0.668 0.051 -13.196 Inf 0.000
odd3sc|t2 -0.011 0.047 -0.229 Inf 0.819
odds4sc|t1 -0.143 0.047 -3.050 1261.238 0.002
odds4sc|t2 0.521 0.049 10.637 2043.255 0.000
odds5sc|t1 -0.541 0.049 -10.985 2409.018 0.000
odds5sc|t2 0.100 0.047 2.144 3309.839 0.032
odds6sc|t1 -0.708 0.051 -13.838 754.554 0.000
odds6sc|t2 -0.013 0.047 -0.281 Inf 0.778
odds1sc|t1 -0.636 0.050 -12.665 1664.714 0.000
odds1sc|t2 0.027 0.047 0.578 Inf 0.563
odds2sc|t1 -0.434 0.048 -8.997 2695.879 0.000
odds2sc|t2 0.217 0.047 4.622 Inf 0.000
odds3sc|t1 -0.362 0.048 -7.582 1167.343 0.000
odds3sc|t2 0.344 0.048 7.212 6106.076 0.000
Variances:
Estimate Std.Err t-value df P(>|t|)
.odd1sc 0.293
.odd2sc 0.276
.odd3sc 0.368
.odds4sc 0.754
.odds5sc 0.593
.odds6sc 0.539
.odds1sc 0.336
.odds2sc 0.186
.odds3sc 0.519
NonComp.f 1.000
NA.f 1.000
Scales y*:
Estimate Std.Err t-value df P(>|t|)
odd1sc 1.000
odd2sc 1.000
odd3sc 1.000
odds4sc 1.000
odds5sc 1.000
odds6sc 1.000
odds1sc 1.000
odds2sc 1.000
odds3sc 1.000
And here are the warnings:
Warning messages:
1: In lavaan::lavaan(model = "NonComp.f =~ odd1sc + odd2sc + odd3sc + odds4sc + odds5sc + odds6sc\n NA.f =~ odds1sc + odds2sc + odds3sc\n NonComp.f ~~ NA.f", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
2: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
3: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
4: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
5: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
6: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
7: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
8: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
9: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
10: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
11: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
12: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
13: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
14: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
15: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
16: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
17: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
18: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
19: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
20: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
21: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
22: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
23: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
24: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
25: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
26: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
27: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
28: In lavaan(slotOptions = structure(list(model.type = "cfa", ... :
lavaan WARNING: not all elements of the gradient are (near) zero;
the optimizer may not have found a local solution;
use lavInspect(fit, "optim.gradient") to investigate
Given that I am new to R/lavaan and my knowledge base for SEM is moderate at best, I am hoping someone is able to explain these warning messages to me and whether they are something I should be concerned about.
Thank you in advance!