Bug In summary() function

320 views
Skip to first unread message

Brandon McCormick

unread,
Jun 3, 2020, 7:15:35 PM6/3/20
to lavaan
I posted previously about an error in the summary function, but I found out more info that may help trace the bug. 

I am running a mediation analysis with a binary predictor, three latent mediators, and two outcome variables. I also have 3 latent covariates and 3 other covariates with n = 3324. The model converged normally. My model used multiple reputations. So the fit object is a lavaan.mi

Previously, when I called the summary() function, I received this error 

Error in dimnames(W) <- dimnames(B) : 'dimnames' applied to non-array

I updated all packages to make sure that wasn't the problem and restarted R. 

Now I can call the Summary() function and I get a list of parameters with an estimated value next to each. If I try to call any additional arguments such as standardized = TRUE or fit.measures = TRUE, I get an error stating they are unused arguments. I get this even when I call lavaan::summary(fit, standardized = TRUE). If I call parameterestimates(), I can get the estimates and I can also get the standardized values if I call standardized = TRUE. However, if I add additional arguments such as se = TRUE, I do not get any additional information. I am able to get fit measures with the fitMeasures() function. 

I tried to replicate the error in the HS data set (with and without mi), but could not get it to replicate. Therefore, I am thinking it is a problem with the size of the lavaan.mi object (about 250 MB).

Here is my code:

library(lavaan)
library(semTools)
library(Amelia)

set.seed(6819)


mTBI_SEM_Data_Amelia <- amelia(mTBI_SEM_Data, m = 40, noms = c("Ethnicity", "HI_Bi_B21", "Sex"), sqrts  = c("NV1", "NV2", "NV3", "NV4", "NV5", "NV6", "NV7", "NV8", "NV9", "NV10", "NV11", "NV12", "NV13", "NV15", "NV16", "NV17", "NV18", "NV19", "NV20", "NV21", "VO1", "VO2", "VO3", "VO4", "VO5", "VO6", "VO7", "VO8", "VO9", "VO10", "VO11"), empri = .01*nrow(mTBI_SEM_Data))


mTBI_SEM_Data_Amelia <- transform(mTBI_SEM_Data_Amelia, NVtot = NV1 + NV2 + NV3 + NV4 + NV5 + NV6 + NV7 + NV8 + NV9 + NV10 + NV11 + NV12 + NV13  + NV15 + NV16 + NV17 + NV18 + NV19 + NV20 + NV21)


mTBI_SEM_Data_Amelia <- transform(mTBI_SEM_Data_Amelia, VOtot = VO1 + VO2 + VO3 + VO4 + VO5 + VO6 + VO7 + VO8 + VO9 + VO10 + VO11)


mTBI_SEM_Data_Amelia <- transform(mTBI_SEM_Data_Amelia, VOtot_log = log(VOtot +1))


mTBI_SEM_Data_Amelia <- transform(mTBI_SEM_Data_Amelia, NVtot_log = log(NVtot +1))


mTBI_SEM_Data_Imps <- mTBI_SEM_Data_Amelia$imputations


mTBI_Off_Med2 <- '
  
#Wave 1 LV’s 
  
# IM_W1 
  
IM_W1 =~ NA* IM1_W1 + IM2_W1 + IM3_W1 + IM4_W1 + IM5_W1

IM_W1 ~~ 1* IM_W1

IM1_W1 ~~ IM2_W1
IM2_W1 ~~ IM5_W1
IM3_W1 ~~ IM5_W1

#AD_W1  

AD_W1 =~ NA* AD1_W1 + AD2_W1 + AD3_W1 + AD4_W1 + AD5_W1 + AD6_W1 + AD7 _W1 + AD8_W1 + AD9 _W1 + AD10_W1 + AD11_W1 + AD12_W1 + AD13_W1 + AD14_W1

AD_W1 ~~ 1* AD_W1

AD1_W1 ~~  AD2_W1 + AD6_W1 + AD7_W1 + AD11_W1
AD3_W1 ~~  AD4_W1 + AD7_W1 + AD8_W1 + AD10_W1 + AD14_W1 
AD4_W1 ~~ AD9_W1
AD5_W1 ~~  AD2_W1 + AD4_W1 
AD6_W1 ~~  AD7_W1
AD8_W1 ~~ AD4_W1 + AD5_W1 + AD9_W1 + AD10_W1
AD11_W1 ~~ AD12_W1
AD10_W1 ~~ AD9_W1 + AD12_W1 + AD13_W1
AD13_W1 ~~ AD4_W1 + AD12_W1

ASB_CUT_W1 =~ NA* CU1_W1 + CU2_W1 + CU3_W1 + CU4_W1 + ASB1_W1 + ASB2_W1 + ASB3_W1 + ASB4_W1 + ASB5_W1 + ASB6_W1 + ASB7_W1 + ASB8_W1 +  ASB9_W1 + ASB10_W1

ASB_CUT_W1  ~~ 1* ASB_CUT_W1

ASB2_W1 ~~ ASB1_W1 + ASB4_W1 + ASB8_W1 + ASB10_W1 + CU1_W1 
ASB3_W1 ~~  ASB2_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 + ASB2_W2 
IM2_W2 ~~   AD3_W2 + AD10_W2 + AD14_W2
IM3_W2 ~~ AD4_W2
IM4_W2 ~~   AD3_W2 + AD4_W2 + AD6_W2 + ASB6_W2 
IM5_W2 ~~   IM3_W2 + AD5_W2
ASB2_W2 ~~  ASB5_W2
ASB3_W2 ~~  AD3_W2  + AD9_W2 
AD3_W2 ~~  CU2_W2
AD7_W2 ~~  AD8_W2 + CU1_W2
AD12_W2 ~~  ASB9_W2
AD14_W2 ~~ AD11_W2 + ASB2_W2 + ASB8_W2
ASB7_W2 ~~ AD4_W2 + AD5_W2 + AD7_W2 + AD8_W2

#correlate LV’s W2

IM_W2 ~~ c* AD_W2 + ASB_CUT_W2
AD_W2 ~~ ASB_CUT_W2

#correlate LV’s W1

IM_W1 ~~ c* AD_W1 + ASB_CUT_W1
AD_W1 ~~ ASB_CUT_W1

#Regression paths 
#direct effects

NVtot_log ~ C1 *  HI_Bi_B21 
VOtot_log ~ C2 * HI_Bi_B21 

#Mediation: A paths

IM_W2 ~ A1 * HI_Bi_B21 
AD_W2 ~ A2 * HI_Bi_B21 
ASB_CUT_W2 ~ A3*  HI_Bi_B21 

#Mediation: B paths

NVtot_log ~ B1_1 * IM_W2
NVtot_log ~ B2_1 * AD_W2
NVtot_log ~ B3_1 * ASB_CUT_W2 

VOtot_log ~ B1_2 * IM_W2
VOtot_log ~ B2_2 * AD_W2
VOtot_log ~ B3_2 * ASB_CUT_W2 

#Effect estimates

indirect1_1 := A1 * B1_1
indirect2_1 := A2 * B2_1
indirect3_1 := A3 * B3_1

indirect1_2 := A1 * B1_2
indirect2_2 := A2 * B2_2
indirect3_2 := A3 * B3_2

total1_1 := C1 + (A1 * B1_1)
total2_1 := C1 + (A2 * B2_1)
total3_1 := C1 + (A3 * B3_1)

total1_2 := C2 + (A1 * B1_2)
total2_2 := C2 + (A2 * B2_2)
total3_2 := C2 + (A3 * B3_2)

#control paths: W1 LV’s

IM_W2 ~ IM_W1
AD_W2 ~ AD_W1
ASB_CUT_W2 ~ ASB_CUT_W1

NVtot_log ~ IM_W1 + AD_W1 + ASB_CUT_W1
VOtot_log ~ IM_W1 + AD_W1 + ASB_CUT_W1

#control paths: other vars

IM_W2 ~ Age_W3 + Sex + Ethnicity + Neighborhood_SES + PC_EDU
AD_W2 ~ Age_W3 + Sex + Ethnicity + Neighborhood_SES + PC_EDU
ASB_CUT_W2 ~ Age_W3 + Sex + Ethnicity + Neighborhood_SES + PC_EDU

NVtot_log ~ Age_W3 + Sex + Ethnicity + Neighborhood_SES + PC_EDU
VOtot_log ~ Age_W3 + Sex + Ethnicity + Neighborhood_SES + PC_EDU'

fitmTBI_Off_Med2 <- sem.mi(mTBI_Off_Med2 , data = mTBI_SEM_Data_Imps)
summary(fitmTBI_Off_Med2 , standardized=TRUE, fit.measures=TRUE, ci=TRUE)

Terrence Jorgensen

unread,
Jun 4, 2020, 6:29:34 PM6/4/20
to lavaan
I posted previously about an error in the summary function

Please don't start a new thread about the same topic.  It makes it difficult to keep responses consistent.
 
I am thinking it is a problem with the size of the lavaan.mi object (about 250 MB).

That's pretty big, and you have quite a large model.  You could test this hypothesis by fitting a smaller part of your model (fewer variables) to a subset of your data (smaller N).

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

 

Brandon McCormick

unread,
Jun 4, 2020, 6:43:17 PM6/4/20
to lavaan
I apologize for the multiple posts (I will delete the original), this was the result of the sessioninfo():

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 
 
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] Amelia_1.7.6   Rcpp_1.0.4.6   semTools_0.5-3 lavaan_0.6-6  

loaded via a namespace (and not attached):
[1] compiler_4.0.0 tools_4.0.0    foreign_0.8-78 mnormt_1.5-7   pbivnorm_0.6.0 stats4_4.0.0  

I am relatively new to SEM, would it be better to test each mediation separately (three separate models)? (or do you happen to know any good papers who have used a similar method I could reference). 

David Simmonds

unread,
Jun 4, 2020, 6:53:33 PM6/4/20
to lav...@googlegroups.com
That's a really complicated model. I would start with the assumption that there's something problematic on the model, not R. Did you get small pieces working by themselves?

Best Regards,
David

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/8832757d-de2e-40d4-8d6a-21b79f77a77fo%40googlegroups.com.

Brandon McCormick

unread,
Jun 4, 2020, 6:56:32 PM6/4/20
to lav...@googlegroups.com
Yes, the model works up until the final model with covariates. It converges normally, but won’t display normally. fitMeasures() indicates good fit RMSEA = .029, CFI = .90

On Jun 4, 2020, at 5:53 PM, David Simmonds <davidms...@gmail.com> wrote:



David Simmonds

unread,
Jun 4, 2020, 7:25:49 PM6/4/20
to lav...@googlegroups.com
Did you try to display the path model, using semPaths?

Best Regards,
David

Terrence Jorgensen

unread,
Jun 4, 2020, 7:29:52 PM6/4/20
to lavaan
Error in dimnames(W) <- dimnames(B) : 'dimnames' applied to non-array

This is strange.  Can you try vcov(fitmTBI_Off_Med2, type = "within") and vcov(fitmTBI_Off_Med2, type = "between"), to see whether either of those return something unexpected?  (i.e., in both cases we expect a matrix with as many rows/columns as there are estimated parameters)

Brandon McCormick

unread,
Jun 4, 2020, 7:33:17 PM6/4/20
to lav...@googlegroups.com
This is what I got

vcov(fitmTBI_Off_Med2, type = "within")
Error in UseMethod("vcov") :
  no applicable method for 'vcov' applied to an object of class "c('lavaan.mi', 'lavaanList')"
vcov(fitmTBI_Off_Med2, type = "between")
Error in UseMethod("vcov") :
  no applicable method for 'vcov' applied to an object of class "c('lavaan.mi', 'lavaanList')"

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.


--

Brandon McCormick

Doctoral Student

Clinical Psychology - Psychology and Law 
The University of Alabama
101 McMillan
Tuscaloosa, AL 35401 
Phone 205-460-8678
b.mccorm...@gmail.com

The University of Alabama stacked logo with box A

Brandon McCormick

unread,
Jun 4, 2020, 7:58:48 PM6/4/20
to lav...@googlegroups.com
David, 

It seems SemPaths doesn't accept lavaan.mi objects. But I was able to display it in lavaanPlot

Terrence Jorgensen

unread,
Jun 5, 2020, 6:14:40 AM6/5/20
to lavaan
Error in UseMethod("vcov") : 
  no applicable method for 'vcov' applied to an object of class "c('lavaan.mi', 'lavaanList')"

I can't think of why this might occur.  I am using the same version of R on the same OS as you.  This makes it seem that R isn't finding the right information in semTools NAMESPACE.  When you run methods("vcov"), you should see vcov,lavaan.mi-method in the vector of results.  

Is it possible you are loading the lavaan.mi object into your workspace, which was created in an older version of R or semTools or lavaan, then saved to a file so you could save time by simply loading into your workspace?

Brandon McCormick

unread,
Jun 5, 2020, 11:19:15 AM6/5/20
to lav...@googlegroups.com
I think that could be possible, I can try creating a new workspace. 

On Jun 5, 2020, at 5:14 AM, Terrence Jorgensen <tjorge...@gmail.com> wrote:


--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Brandon McCormick

unread,
Jun 5, 2020, 5:34:16 PM6/5/20
to lav...@googlegroups.com
I created a new workspace, and re-ran everything. 

I still received these errors:

summary(fitmTBI_Off_Med2)
Error in dimnames(W) <- dimnames(B) : 'dimnames' applied to non-array

vcov(fitmTBI_Off_Med2, type = "within")
Error in dimnames(W) <- dimnames(B) : 'dimnames' applied to non-array

This is the session info

R version 4.0.0 (2020-04-24)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] Amelia_1.7.6   Rcpp_1.0.4.6   semTools_0.5-3 lavaan_0.6-6  

loaded via a namespace (and not attached):
[1] MASS_7.3-51.5  compiler_4.0.0 parallel_4.0.0 tools_4.0.0    foreign_0.8-78 mnormt_1.5-7  
[7] pbivnorm_0.6.0 stats4_4.0.0  


David Simmonds

unread,
Jun 7, 2020, 5:03:07 AM6/7/20
to lav...@googlegroups.com
Brandon,

Just out of curiosity, I would love to see the path diagram. I guess I should have mentioned that previously. 

Best Regards,
David

Terrence Jorgensen

unread,
Jun 12, 2020, 4:57:32 AM6/12/20
to lavaan
I created a new workspace, and re-ran everything. I still received these errors:

Then I would need a reprex (with enough data to reproduce the error that I cannot replicate) to track down the problem.  You can look into dump() to simply send me any objects as R syntax files.  

Brandon McCormick

unread,
Jun 13, 2020, 5:47:07 PM6/13/20
to lav...@googlegroups.com
Hi Terrence, 

I emailed you privately, 

Brandon

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.

Terrence Jorgensen

unread,
Jun 14, 2020, 5:59:31 AM6/14/20
to lavaan
Okay, your original problem somehow became a different problem.

When I load your workspace, sessionInfo() shows me this list of packages (note that my version numbers might differ from yours)

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

loaded via a namespace (and not attached):
 [1] compiler_4.0.0     emmeans_1.4.7      estimability_1.3   tools_4.0.0      
 [5] coda_0.19-3        lavaan_0.6-6       mvtnorm_1.1-0      mnormt_1.5-7      
 [9] grid_4.0.0         pbivnorm_0.6.0     xtable_1.8-4       stats4_4.0.0      
[13] semTools_0.5-3.906 lattice_0.20-41   

Whereas a fresh session in RStudio shows me only these namespaces loaded:

loaded via a namespace (and not attached):
[1] compiler_4.0.0 tools_4.0.0   

I ran the help-page example and got the later problems you described (i.e., the summary() showed only "est.ave" because it used the class?lavaanList method rather than the class?lavaan.mi method, and R could not find vcov() or any other methods for lavaan.mi objects).  So I saved your lavaan.mi object by itself, rather than within a workspace: 

saveRDS(fitmTBI_Off_Med2, "lavMI.rds")

Then restarted R and tried just loading semTools and imported your object:

library(semTools)
fit
<- readRDS("lavMI.rds")
summary
(fit)

Now I got your original error about dimnames(W).  Unlike you, I was perfectly able to run

vcov(fit, type = "within") # Error in dimnames(W) <- dimnames(B) : 'dimnames' applied to non-array
vcov
(fit, type = "between") # no problem, because this is calculated before W (within)

So the later problem (that your R could not find the right vcov() method) must be due to your attached namespaces, which I can only guess would be fixed if you no longer load anything but semTools before trying to inspect your results.  You could try removing one loaded package at a time to see which one is the culprit -- I would be interested to know.

But the first problem (finally) is that the within-imputations VCOV cannot be calculated because your model object did not save the VCOV from each individual imputation.  Here is what you can see in your object's first imputation:

fit@vcovList[[1]]

$se
[1] "standard"

$information
[1] "expected" "expected"

$vcov
NULL

The $vcov element should be a matrix, the output of vcov(lavaan(model = parTable(fit), data = fit@DataList[[1]])) , which you get by fitting the model to your first imputation only in lavaan.  That works fine, so I'm not sure why it wasn't saved in any of your imputations when you fit the model using runMI():

str(lapply(fit@vcovList, "[[", i = "vcov"))

List of 40
 $ : NULL
 $ : NULL
     ... (all 40)
 $ : NULL
 $ : NULL

I tried restarting R again to re-fit your model using the information inside the object, to see if it saved the $vcov element this time:

library(semTools)
fit
<- readRDS("lavMI.rds")
fit2
<- lavaan.mi(model = parTable(fit),
                  data
= lapply(fit@DataList[1:3], head, n = 500), # subset already takes several minutes
                  show
.progress = TRUE)
fit2@vcovList

It did not.  So I tried using lavaan() on the individual data sets:

fitList <- lapply(lapply(fit@DataList[1:3], head, n = 500),
                 
function(dat) lavaan(model = parTable(fit), data = dat))
lapply
(fitList, function(x) vcov(x)[1:5, 1:5])

vcov() is available from each imputation, so I think there is something going wrong inside lavaanList().  I wonder if it is related to your model being so massive (380 parameters means VCOV is 380x380), or that your variables appear to be profoundly nonnormal:

hist(fit@DataList[[1]]$CU1_W2) # for example


Brandon McCormick

unread,
Jun 14, 2020, 11:56:19 AM6/14/20
to lav...@googlegroups.com
Thank you for unpacking all of this, I will do some further investigating!

On Jun 14, 2020, at 4:59 AM, Terrence Jorgensen <tjorge...@gmail.com> wrote:


<Auto Generated Inline Image 1>


Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/88a632be-fe29-428f-a324-683560d18bf1o%40googlegroups.com.
<Auto Generated Inline Image 1>
Reply all
Reply to author
Forward
0 new messages