Warning message: In lavaan::lavaan(model = model1, data = mat, estimator = "ML", : lavaan WARNING: the optimizer warns that a solution has NOT been found!

141 views
Skip to first unread message

Matt Hoper

unread,
May 13, 2021, 6:35:15 AM5/13/21
to lavaan
I have been trying to use the lavaan SEM to work out a latent variable value from 3 observed variables. I have 3 sets of exam results from 6 people (Data set attached). I have used the below code within R Studio to try and produce the figure and a semPaths diagram. The error message in the subject is showing when I run the "model.fit" line you can see below.

I was worried about the size of the data set, so have tried to increase the number of observations for each exam to over 1000, but am still receiving the same error message.

R Code

library(lavaan)
library(semPlot)
library(qgraph)


dataset <-read.csv("Exam_Results.csv", header = T, sep=",")
mat <- as.matrix(dataset)


model1 <-"
OverallSoftwareKnowledge=~ Zeta_Total_Score + AutoCAD_Total_Score + Archibus_Total_Score
"


model.fit <- sem(model1, data=mat, estimator = "ML")


summary(model.fit)


semPaths(model.fit, what="paths", whatLabels="par", rotation=1)


Output

> library(lavaan)
> library(semPlot)
> library(qgraph)
> dataset <-read.csv("Exam_Results.csv", header = T, sep=",")
> mat <- as.matrix(dataset)
> model1 <-"
+ OverallSoftwareKnowledge=~ Zeta_Total_Score + AutoCAD_Total_Score + Archibus_Total_Score
+ "
> model.fit <- sem(model1, data=mat, estimator = "ML")
Warning message:
In lavaan::lavaan(model = model1, data = mat, estimator = "ML",  :
  lavaan WARNING:
    the optimizer warns that a solution has NOT been found!
> summary(model.fit)
lavaan 0.6-8 did NOT end normally after 1339 iterations
** WARNING ** Estimates below are most likely unreliable

  Estimator                                         ML
  Optimization method                           NLMINB
  Number of model parameters                         6
                                                      
  Number of observations                             6
                                                      
Model Test User Model:
                                                      
  Test statistic                                    NA
  Degrees of freedom                                NA

Parameter Estimates:

  Standard errors                             Standard
  Information                                 Expected
  Information saturated (h1) model          Structured

Latent Variables:
                              Estimate  Std.Err  z-value  P(>|z|)
  OverallSoftwareKnowledge =~                                    
    Zeta_Total_Scr               1.000                           
    AutCAD_Ttl_Scr             258.829       NA                  
    Archbs_Ttl_Scr              -1.331       NA                  

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)
   .Zeta_Total_Scr    0.585       NA                  
   .AutCAD_Ttl_Scr   88.762       NA                  
   .Archbs_Ttl_Scr    2.558       NA                  
    OvrllSftwrKnwl   -0.001       NA                  

> semPaths(model.fit, what="paths", whatLabels="par", rotation=1)
Exam_Results.csv
Reply all
Reply to author
Forward
0 new messages