Does Lavaan use standardized scores?

2,309 views
Skip to first unread message

Alexandre F. Souza

unread,
Mar 7, 2013, 1:34:25 PM3/7/13
to lav...@googlegroups.com
Hello,

   I am new to both SEM and LAVAAN, and work with plant ecology.

   I am studying Grace's book Structural Equation Modeling and Natural Systems.

   There he states that input data can be either raw (if normally distributed) or standardized through z scores. As far as I got it,  the standardized form is preferable, and in lavaan it is carried out setting the option std.ov = TRUE in the sem function.

   Is that understanding ok? I am not so sure, because through the lavaan documentation examples keep std.ov as FALSE.

   Thanks for any comments,

   Alexandre

Alexander Beaujean

unread,
Mar 8, 2013, 12:00:22 AM3/8/13
to lav...@googlegroups.com
It's probably better to use the data in its natural metric for input and then in the summary() or parameterEstimates() function, use the standardized=TRUE argument to get fully standardized (i.e, latent and observed variables) results. They will be in the std.all column. 

As far as standardized results being preferable, that is not always the case. As with regression, it depends on your variables and what questions you are wanting to answer. Typically, it's good to examine unstandardized, standardized and (if applicable) structure coefficients.

Best,

Alex

Ruben Arslan

unread,
Mar 8, 2013, 10:47:12 AM3/8/13
to lav...@googlegroups.com
Alexandre,

if you don't care about the natural metric, you could standardise your data, e.g.
using 
df.s <- plyr::numcolwise(scale)(dataframe)
before using df.s in lavaan.
If natural metrics differ greatly (standard deviation differences in orders of magnitude) , they may cause problems with convergence.

Also, if your data isn't normally distributed, a standardization wouldn't change that, but various transforms would.
In plant ecology you might deal with non-normal count data a lot? Count data can be handled (without transforms) by Mplus, I think lavaan doesn't do that (for now..?)

Best
Ruben

--
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 post to this group, send email to lav...@googlegroups.com.
Visit this group at http://groups.google.com/group/lavaan?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Alexandre F. Souza

unread,
Mar 9, 2013, 8:02:03 PM3/9/13
to lav...@googlegroups.com
Hello,

   I would like to thank Alex and Ruben for their answers to my question.

   In ecology variables are seldom normally distributed and we usually log- or sqrt-transform them before parametric analyses. In some cases no transformation works.

   I changed my mind and understood that it is better to use raw or transformed variables, but not standardized variables as input to sem.

   All the best,

   Alexandre

Camille Williams

unread,
Apr 11, 2019, 2:51:33 AM4/11/19
to lavaan
Hi, 
I am using log transformed data and have the following two issues. Since things 'look better' when I scale my values before entering them in the model I want to do this, but it apparently gives me inaccurate SE and does not allow me to test metric or scalar invariance properly... What can I do? 

1. I get the following warning in my model. From the lavInspect (fit, "optim.gradient), I see that I have most values at 0.000 and some at - 0.004 or -0.005. This wanring is also obtained when I do not include any covariance or set the TBV intercepts to different values. 
My model 
TBV0.model <- 'TBV =~ NA*CorticalWhiteMatterVol_log 
+ Brain_Stem_log 
+ Left_VentralDC_log + Right_VentralDC_log 
+ lhCortexVol_log + rhCortexVol_log
+ Left_Accumbens_area_log + Right_Accumbens_area_log
+ Left_Cerebellum_Cortex_log + Right_Cerebellum_Cortex_log 
+ Left_Caudate_log + Right_Caudate_log 
+ Left_Hippocampus_log + Right_Hippocampus_log
+ Left_Pallidum_log + Right_Pallidum_log 
+ Left_Putamen_log + Right_Putamen_log 
+ Right_Thalamus_Proper_log + Left_Thalamus_Proper_log
+ Left_Amygdala_log + Right_Amygdala_log
TBV ~~ 1*TBV 
TBV ~ c(0, 0.031)* 1
lhCortexVol_log ~~ rhCortexVol_log
Left_Caudate_log ~~ Right_Caudate_log
Left_Putamen_log ~~ Right_Putamen_log
Left_Cerebellum_Cortex_log ~~ Right_Cerebellum_Cortex_log
Right_Thalamus_Proper_log ~~ Left_Thalamus_Proper_log
Left_Accumbens_area_log ~~ Right_Accumbens_area_log
Left_VentralDC_log ~~ Right_VentralDC_log
Left_Amygdala_log ~~ Right_Amygdala_log
Left_Hippocampus_log ~~ Right_Hippocampus_log
Left_Pallidum_log ~~ Right_Pallidum_log 

Right_Putamen_log ~~ Right_Amygdala_log
Left_Putamen_log ~~ Left_Amygdala_log
Right_Putamen_log ~~ Left_Amygdala_log
Left_Putamen_log ~~ Right_Amygdala_log
'
Ex_fit_TBV<- cfa(TBV0.model, data=Abide_MGCFA, group = "DX_GROUP")
Warning message:
In lavaan::lavaan(model = TBV0.model, data = Abide_MGCFA, group = "DX_GROUP",  :
  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. I also get very high std.all = intercepts: CFA with log values WITHOUT scaling 
> summary(Ex_fit_TBV, standardize = T )
lavaan 0.6-3 ended normally after 978 iterations

  Optimization method                           NLMINB
  Number of free parameters                        160

  Number of observations per group         
  Control                                          352
  ASD                                              302

  Estimator                                         ML
  Model Fit Test Statistic                    2400.863
  Degrees of freedom                               390
  P-value (Chi-square)                           0.000

Chi-square for each group:

  Control                                     1180.281
  ASD                                         1220.582

Parameter Estimates:

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


Group 1 [Control]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  TBV =~                                                                
    CrtclWhtMttrV_    0.045    0.002   18.113    0.000    0.045    0.812
    Brain_Stem_log    0.043    0.002   17.286    0.000    0.043    0.787
    Lft_VntrlDC_lg    0.038    0.002   15.823    0.000    0.038    0.741
    Rght_VntrlDC_l    0.036    0.002   15.565    0.000    0.036    0.732
    lhCortexVol_lg    0.033    0.003   12.868    0.000    0.033    0.634
    rhCortexVol_lg    0.034    0.003   12.998    0.000    0.034    0.639
    Lft_Accmbns_r_    0.043    0.005    7.897    0.000    0.043    0.417
    Rght_Accmbns__    0.041    0.005    7.977    0.000    0.041    0.421
    Lft_Crbllm_Cr_    0.027    0.003    9.424    0.000    0.027    0.489
    Rght_Crbllm_C_    0.028    0.003    8.855    0.000    0.028    0.463
    Left_Caudat_lg    0.044    0.003   12.734    0.000    0.044    0.629
    Right_Caudt_lg    0.048    0.004   13.046    0.000    0.048    0.641
    Lft_Hppcmps_lg    0.037    0.003   13.934    0.000    0.037    0.674
    Rght_Hppcmps_l    0.038    0.003   13.379    0.000    0.038    0.654
    Left_Palldm_lg    0.040    0.003   13.678    0.000    0.040    0.665
    Right_Plldm_lg    0.039    0.003   13.429    0.000    0.039    0.656
    Left_Putamn_lg    0.035    0.003   11.913    0.000    0.035    0.596
    Right_Putmn_lg    0.035    0.003   12.266    0.000    0.035    0.611
    Rght_Thlms_Pr_    0.036    0.002   17.732    0.000    0.036    0.801
    Lft_Thlms_Prp_    0.034    0.002   16.772    0.000    0.034    0.772
    Left_Amygdl_lg    0.041    0.003   11.877    0.000    0.041    0.595
    Rght_Amygdl_lg    0.042    0.004   11.511    0.000    0.042    0.580

Covariances:
                                Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .lhCortexVol_log ~~                                                                 
   .rhCortexVol_lg                 0.002    0.000   12.285    0.000    0.002    0.966
 .Left_Caudate_log ~~                                                                
   .Right_Caudt_lg                 0.003    0.000   11.876    0.000    0.003    0.909
 .Left_Putamen_log ~~                                                                
   .Right_Putmn_lg                 0.002    0.000   11.587    0.000    0.002    0.860
 .Left_Cerebellum_Cortex_log ~~                                                      
   .Rght_Crbllm_C_                 0.002    0.000    9.772    0.000    0.002    0.635
 .Right_Thalamus_Proper_log ~~                                                       
   .Lft_Thlms_Prp_                 0.001    0.000    8.897    0.000    0.001    0.682
 .Left_Accumbens_area_log ~~                                                         
   .Rght_Accmbns__                 0.006    0.001   11.009    0.000    0.006    0.747
 .Left_VentralDC_log ~~                                                              
   .Rght_VntrlDC_l                 0.001    0.000    8.513    0.000    0.001    0.600
 .Left_Amygdala_log ~~                                                               
   .Rght_Amygdl_lg                 0.002    0.000    9.043    0.000    0.002    0.592
 .Left_Hippocampus_log ~~                                                            
   .Rght_Hppcmps_l                 0.001    0.000    8.121    0.000    0.001    0.533
 .Left_Pallidum_log ~~                                                               
   .Right_Plldm_lg                 0.001    0.000    8.721    0.000    0.001    0.583
 .Right_Putamen_log ~~                                                               
   .Rght_Amygdl_lg                 0.001    0.000    4.924    0.000    0.001    0.290
 .Left_Putamen_log ~~                                                                
   .Left_Amygdl_lg                 0.001    0.000    3.738    0.000    0.001    0.216
 .Right_Putamen_log ~~                                                               
   .Left_Amygdl_lg                 0.000    0.000    3.436    0.001    0.000    0.198
 .Left_Putamen_log ~~                                                                
   .Rght_Amygdl_lg                 0.000    0.000    2.809    0.005    0.000    0.160

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               0.000                               0.000    0.000
   .CrtclWhtMttrV_    5.670    0.003 1928.156    0.000    5.670  102.771
   .Brain_Stem_log    4.305    0.003 1495.363    0.000    4.305   79.703
   .Lft_VntrlDC_lg    3.613    0.003 1308.749    0.000    3.613   69.757
   .Rght_VntrlDC_l    3.617    0.003 1370.427    0.000    3.617   73.044
   .lhCortexVol_lg    5.429    0.003 1933.187    0.000    5.429  103.039
   .rhCortexVol_lg    5.430    0.003 1934.671    0.000    5.430  103.118
   .Lft_Accmbns_r_    2.883    0.005  527.384    0.000    2.883   28.110
   .Rght_Accmbns__    2.898    0.005  554.175    0.000    2.898   29.538
   .Lft_Crbllm_Cr_    4.733    0.003 1628.268    0.000    4.733   86.787
   .Rght_Crbllm_C_    4.737    0.003 1474.385    0.000    4.737   78.585
   .Left_Caudat_lg    3.607    0.004  962.971    0.000    3.607   51.327
   .Right_Caudt_lg    3.619    0.004  908.733    0.000    3.619   48.436
   .Lft_Hppcmps_lg    3.610    0.003 1237.236    0.000    3.610   65.945
   .Rght_Hppcmps_l    3.614    0.003 1160.374    0.000    3.614   61.848
   .Left_Palldm_lg    3.294    0.003 1038.040    0.000    3.294   55.328
   .Right_Plldm_lg    3.249    0.003 1017.033    0.000    3.249   54.208
   .Left_Putamn_lg    3.828    0.003 1236.407    0.000    3.828   65.901
   .Right_Putmn_lg    3.809    0.003 1256.364    0.000    3.809   66.964
   .Rght_Thlms_Pr_    3.874    0.002 1602.477    0.000    3.874   85.412
   .Lft_Thlms_Prp_    3.866    0.002 1629.038    0.000    3.866   86.828
   .Left_Amygdl_lg    3.221    0.004  883.101    0.000    3.221   47.069
   .Rght_Amygdl_lg    3.239    0.004  841.303    0.000    3.239   44.842

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               1.000                               1.000    1.000
   .CrtclWhtMttrV_    0.001    0.000   11.112    0.000    0.001    0.340
   .Brain_Stem_log    0.001    0.000   11.457    0.000    0.001    0.380
   .Lft_VntrlDC_lg    0.001    0.000   11.888    0.000    0.001    0.451
   .Rght_VntrlDC_l    0.001    0.000   11.951    0.000    0.001    0.464
   .lhCortexVol_lg    0.002    0.000   12.523    0.000    0.002    0.598
   .rhCortexVol_lg    0.002    0.000   12.505    0.000    0.002    0.592
   .Lft_Accmbns_r_    0.009    0.001   13.033    0.000    0.009    0.826
   .Rght_Accmbns__    0.008    0.001   13.028    0.000    0.008    0.823
   .Lft_Crbllm_Cr_    0.002    0.000   12.919    0.000    0.002    0.761
   .Rght_Crbllm_C_    0.003    0.000   12.964    0.000    0.003    0.786
   .Left_Caudat_lg    0.003    0.000   12.541    0.000    0.003    0.605
   .Right_Caudt_lg    0.003    0.000   12.496    0.000    0.003    0.590
   .Lft_Hppcmps_lg    0.002    0.000   12.328    0.000    0.002    0.545
   .Rght_Hppcmps_l    0.002    0.000   12.421    0.000    0.002    0.573
   .Left_Palldm_lg    0.002    0.000   12.377    0.000    0.002    0.558
   .Right_Plldm_lg    0.002    0.000   12.418    0.000    0.002    0.570
   .Left_Putamn_lg    0.002    0.000   12.632    0.000    0.002    0.644
   .Right_Putmn_lg    0.002    0.000   12.585    0.000    0.002    0.627
   .Rght_Thlms_Pr_    0.001    0.000   11.248    0.000    0.001    0.358
   .Lft_Thlms_Prp_    0.001    0.000   11.562    0.000    0.001    0.404
   .Left_Amygdl_lg    0.003    0.000   12.636    0.000    0.003    0.646
   .Rght_Amygdl_lg    0.003    0.000   12.682    0.000    0.003    0.664


Group 2 [ASD]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  TBV =~                                                                
    CrtclWhtMttrV_    0.053    0.003   18.279    0.000    0.053    0.855
    Brain_Stem_log    0.050    0.003   18.161    0.000    0.050    0.851
    Lft_VntrlDC_lg    0.038    0.003   15.004    0.000    0.038    0.750
    Rght_VntrlDC_l    0.036    0.003   14.030    0.000    0.036    0.715
    lhCortexVol_lg    0.042    0.003   13.999    0.000    0.042    0.713
    rhCortexVol_lg    0.043    0.003   14.044    0.000    0.043    0.715
    Lft_Accmbns_r_    0.040    0.007    6.045    0.000    0.040    0.348
    Rght_Accmbns__    0.039    0.006    6.990    0.000    0.039    0.398
    Lft_Crbllm_Cr_    0.033    0.003   10.792    0.000    0.033    0.582
    Rght_Crbllm_C_    0.037    0.003   11.864    0.000    0.037    0.628
    Left_Caudat_lg    0.043    0.003   12.689    0.000    0.043    0.663
    Right_Caudt_lg    0.047    0.004   13.321    0.000    0.047    0.687
    Lft_Hppcmps_lg    0.044    0.004   11.130    0.000    0.044    0.598
    Rght_Hppcmps_l    0.047    0.003   14.047    0.000    0.047    0.715
    Left_Palldm_lg    0.042    0.003   12.554    0.000    0.042    0.657
    Right_Plldm_lg    0.040    0.003   12.325    0.000    0.040    0.648
    Left_Putamn_lg    0.030    0.003   10.100    0.000    0.030    0.552
    Right_Putmn_lg    0.036    0.003   10.711    0.000    0.036    0.579
    Rght_Thlms_Pr_    0.040    0.002   16.329    0.000    0.040    0.795
    Lft_Thlms_Prp_    0.038    0.003   14.691    0.000    0.038    0.739
    Left_Amygdl_lg    0.058    0.005   11.602    0.000    0.058    0.618
    Rght_Amygdl_lg    0.055    0.005   10.317    0.000    0.055    0.561

Covariances:
                                Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .lhCortexVol_log ~~                                                                 
   .rhCortexVol_lg                 0.002    0.000   11.130    0.000    0.002    0.957
 .Left_Caudate_log ~~                                                                
   .Right_Caudt_lg                 0.002    0.000   10.518    0.000    0.002    0.846
 .Left_Putamen_log ~~                                                                
   .Right_Putmn_lg                 0.002    0.000    9.942    0.000    0.002    0.740
 .Left_Cerebellum_Cortex_log ~~                                                      
   .Rght_Crbllm_C_                 0.002    0.000   11.118    0.000    0.002    0.898
 .Right_Thalamus_Proper_log ~~                                                       
   .Lft_Thlms_Prp_                 0.001    0.000    9.338    0.000    0.001    0.762
 .Left_Accumbens_area_log ~~                                                         
   .Rght_Accmbns__                 0.007    0.001    9.681    0.000    0.007    0.684
 .Left_VentralDC_log ~~                                                              
   .Rght_VntrlDC_l                 0.001    0.000    7.873    0.000    0.001    0.580
 .Left_Amygdala_log ~~                                                               
   .Rght_Amygdl_lg                 0.004    0.000    8.954    0.000    0.004    0.640
 .Left_Hippocampus_log ~~                                                            
   .Rght_Hppcmps_l                 0.001    0.000    7.282    0.000    0.001    0.502
 .Left_Pallidum_log ~~                                                               
   .Right_Plldm_lg                 0.001    0.000    8.256    0.000    0.001    0.587
 .Right_Putamen_log ~~                                                               
   .Rght_Amygdl_lg                 0.001    0.000    5.678    0.000    0.001    0.363
 .Left_Putamen_log ~~                                                                
   .Left_Amygdl_lg                 0.001    0.000    2.830    0.005    0.001    0.173
 .Right_Putamen_log ~~                                                               
   .Left_Amygdl_lg                 0.001    0.000    2.420    0.016    0.001    0.147
 .Left_Putamen_log ~~                                                                
   .Rght_Amygdl_lg                 0.001    0.000    4.016    0.000    0.001    0.247

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               0.031                               0.031    0.031
   .CrtclWhtMttrV_    5.666    0.004 1591.272    0.000    5.666   91.597
   .Brain_Stem_log    4.302    0.003 1274.897    0.000    4.302   73.385
   .Lft_VntrlDC_lg    3.614    0.003 1254.754    0.000    3.614   72.229
   .Rght_VntrlDC_l    3.619    0.003 1242.944    0.000    3.619   71.550
   .lhCortexVol_lg    5.429    0.003 1594.381    0.000    5.429   91.781
   .rhCortexVol_lg    5.428    0.003 1562.458    0.000    5.428   89.943
   .Lft_Accmbns_r_    2.891    0.007  434.827    0.000    2.891   25.033
   .Rght_Accmbns__    2.900    0.006  520.078    0.000    2.900   29.941
   .Lft_Crbllm_Cr_    4.729    0.003 1457.027    0.000    4.729   83.878
   .Rght_Crbllm_C_    4.740    0.003 1409.608    0.000    4.740   81.147
   .Left_Caudat_lg    3.612    0.004  962.462    0.000    3.612   55.405
   .Right_Caudt_lg    3.621    0.004  923.668    0.000    3.621   53.172
   .Lft_Hppcmps_lg    3.611    0.004  855.776    0.000    3.611   49.265
   .Rght_Hppcmps_l    3.618    0.004  957.005    0.000    3.618   55.090
   .Left_Palldm_lg    3.300    0.004  905.177    0.000    3.300   52.108
   .Right_Plldm_lg    3.256    0.004  918.531    0.000    3.256   52.877
   .Left_Putamn_lg    3.833    0.003 1228.972    0.000    3.833   70.750
   .Right_Putmn_lg    3.813    0.004 1067.099    0.000    3.813   61.431
   .Rght_Thlms_Pr_    3.875    0.003 1325.588    0.000    3.875   76.305
   .Lft_Thlms_Prp_    3.866    0.003 1289.980    0.000    3.866   74.257
   .Left_Amygdl_lg    3.222    0.005  599.307    0.000    3.222   34.500
   .Rght_Amygdl_lg    3.238    0.006  574.278    0.000    3.238   33.060

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               1.000                               1.000    1.000
   .CrtclWhtMttrV_    0.001    0.000    9.954    0.000    0.001    0.269
   .Brain_Stem_log    0.001    0.000   10.022    0.000    0.001    0.275
   .Lft_VntrlDC_lg    0.001    0.000   11.173    0.000    0.001    0.438
   .Rght_VntrlDC_l    0.001    0.000   11.367    0.000    0.001    0.489
   .lhCortexVol_lg    0.002    0.000   11.402    0.000    0.002    0.491
   .rhCortexVol_lg    0.002    0.000   11.394    0.000    0.002    0.489
   .Lft_Accmbns_r_    0.012    0.001   12.170    0.000    0.012    0.879
   .Rght_Accmbns__    0.008    0.001   12.128    0.000    0.008    0.841
   .Lft_Crbllm_Cr_    0.002    0.000   11.847    0.000    0.002    0.661
   .Rght_Crbllm_C_    0.002    0.000   11.732    0.000    0.002    0.605
   .Left_Caudat_lg    0.002    0.000   11.614    0.000    0.002    0.561
   .Right_Caudt_lg    0.002    0.000   11.522    0.000    0.002    0.527
   .Lft_Hppcmps_lg    0.003    0.000   11.795    0.000    0.003    0.643
   .Rght_Hppcmps_l    0.002    0.000   11.390    0.000    0.002    0.489
   .Left_Palldm_lg    0.002    0.000   11.632    0.000    0.002    0.568
   .Right_Plldm_lg    0.002    0.000   11.662    0.000    0.002    0.580
   .Left_Putamn_lg    0.002    0.000   11.901    0.000    0.002    0.696
   .Right_Putmn_lg    0.003    0.000   11.843    0.000    0.003    0.665
   .Rght_Thlms_Pr_    0.001    0.000   10.816    0.000    0.001    0.368
   .Lft_Thlms_Prp_    0.001    0.000   11.219    0.000    0.001    0.454
   .Left_Amygdl_lg    0.005    0.000   11.748    0.000    0.005    0.618
   .Rght_Amygdl_lg    0.007    0.001   11.881    0.000    0.007    0.685


If I scale my log values before inputing them in the model, I
1. No longer have this warning 
2. I have the same std.all values for my loadings and covariances but not for the intercept. Why is this? 

CFA with log values WITH scaling 
> summary(Ex_fit_TBV, standardize = T )
lavaan 0.6-3 ended normally after 99 iterations

  Optimization method                           NLMINB
  Number of free parameters                        160

  Number of observations per group         
  Control                                          352
  ASD                                              302

  Estimator                                         ML
  Model Fit Test Statistic                    2400.863
  Degrees of freedom                               390
  P-value (Chi-square)                           0.000

Chi-square for each group:

  Control                                     1180.281
  ASD                                         1220.582

Parameter Estimates:

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


Group 1 [Control]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  TBV =~                                                                
    CrtclWhtMttrV_    0.767    0.042   18.113    0.000    0.767    0.812
    Brain_Stem_log    0.756    0.044   17.286    0.000    0.756    0.787
    Lft_VntrlDC_lg    0.752    0.048   15.823    0.000    0.752    0.741
    Rght_VntrlDC_l    0.724    0.047   15.565    0.000    0.724    0.732
    lhCortexVol_lg    0.598    0.046   12.868    0.000    0.598    0.634
    rhCortexVol_lg    0.596    0.046   12.998    0.000    0.596    0.639
    Lft_Accmbns_r_    0.393    0.050    7.897    0.000    0.393    0.417
    Rght_Accmbns__    0.423    0.053    7.977    0.000    0.423    0.421
    Lft_Crbllm_Cr_    0.481    0.051    9.424    0.000    0.481    0.489
    Rght_Crbllm_C_    0.469    0.053    8.855    0.000    0.469    0.463
    Left_Caudat_lg    0.649    0.051   12.734    0.000    0.649    0.629
    Right_Caudt_lg    0.666    0.051   13.046    0.000    0.666    0.641
    Lft_Hppcmps_lg    0.576    0.041   13.934    0.000    0.576    0.674
    Rght_Hppcmps_l    0.616    0.046   13.379    0.000    0.616    0.654
    Left_Palldm_lg    0.644    0.047   13.678    0.000    0.644    0.665
    Right_Plldm_lg    0.645    0.048   13.429    0.000    0.645    0.656
    Left_Putamn_lg    0.614    0.052   11.913    0.000    0.614    0.596
    Right_Putmn_lg    0.584    0.048   12.266    0.000    0.584    0.611
    Rght_Thlms_Pr_    0.757    0.043   17.732    0.000    0.757    0.801
    Lft_Thlms_Prp_    0.713    0.043   16.772    0.000    0.713    0.772
    Left_Amygdl_lg    0.503    0.042   11.877    0.000    0.503    0.595
    Rght_Amygdl_lg    0.492    0.043   11.511    0.000    0.492    0.580

Covariances:
                                Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .lhCortexVol_log ~~                                                                 
   .rhCortexVol_lg                 0.507    0.041   12.285    0.000    0.507    0.966
 .Left_Caudate_log ~~                                                                
   .Right_Caudt_lg                 0.583    0.049   11.876    0.000    0.583    0.909
 .Left_Putamen_log ~~                                                                
   .Right_Putmn_lg                 0.539    0.046   11.587    0.000    0.539    0.860
 .Left_Cerebellum_Cortex_log ~~                                                      
   .Rght_Crbllm_C_                 0.489    0.050    9.772    0.000    0.489    0.635
 .Right_Thalamus_Proper_log ~~                                                       
   .Lft_Thlms_Prp_                 0.227    0.025    8.897    0.000    0.227    0.682
 .Left_Accumbens_area_log ~~                                                         
   .Rght_Accmbns__                 0.583    0.053   11.009    0.000    0.583    0.747
 .Left_VentralDC_log ~~                                                              
   .Rght_VntrlDC_l                 0.275    0.032    8.513    0.000    0.275    0.600
 .Left_Amygdala_log ~~                                                               
   .Rght_Amygdl_lg                 0.278    0.031    9.043    0.000    0.278    0.592
 .Left_Hippocampus_log ~~                                                            
   .Rght_Hppcmps_l                 0.240    0.030    8.121    0.000    0.240    0.533
 .Left_Pallidum_log ~~                                                               
   .Right_Plldm_lg                 0.313    0.036    8.721    0.000    0.313    0.583
 .Right_Putamen_log ~~                                                               
   .Rght_Amygdl_lg                 0.152    0.031    4.924    0.000    0.152    0.290
 .Left_Putamen_log ~~                                                                
   .Left_Amygdl_lg                 0.121    0.032    3.738    0.000    0.121    0.216
 .Right_Putamen_log ~~                                                               
   .Left_Amygdl_lg                 0.102    0.030    3.436    0.001    0.102    0.198
 .Left_Putamen_log ~~                                                                
   .Rght_Amygdl_lg                 0.091    0.033    2.809    0.005    0.091    0.160

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               0.000                               0.000    0.000
   .CrtclWhtMttrV_    0.021    0.050    0.423    0.672    0.021    0.023
   .Brain_Stem_log    0.008    0.051    0.160    0.873    0.008    0.009
   .Lft_VntrlDC_lg   -0.017    0.054   -0.320    0.749   -0.017   -0.017
   .Rght_VntrlDC_l   -0.034    0.053   -0.641    0.521   -0.034   -0.034
   .lhCortexVol_lg   -0.007    0.050   -0.132    0.895   -0.007   -0.007
   .rhCortexVol_lg    0.000    0.050    0.009    0.992    0.000    0.001
   .Lft_Accmbns_r_   -0.039    0.050   -0.773    0.439   -0.039   -0.041
   .Rght_Accmbns__   -0.013    0.054   -0.239    0.811   -0.013   -0.013
   .Lft_Crbllm_Cr_    0.026    0.052    0.505    0.614    0.026    0.027
   .Rght_Crbllm_C_   -0.031    0.054   -0.571    0.568   -0.031   -0.030
   .Left_Caudat_lg   -0.043    0.055   -0.785    0.433   -0.043   -0.042
   .Right_Caudt_lg   -0.026    0.055   -0.463    0.643   -0.026   -0.025
   .Lft_Hppcmps_lg   -0.023    0.046   -0.495    0.621   -0.023   -0.026
   .Rght_Hppcmps_l   -0.047    0.050   -0.939    0.348   -0.047   -0.050
   .Left_Palldm_lg   -0.055    0.052   -1.064    0.287   -0.055   -0.057
   .Right_Plldm_lg   -0.064    0.052   -1.228    0.219   -0.064   -0.065
   .Left_Putamn_lg   -0.051    0.055   -0.933    0.351   -0.051   -0.050
   .Right_Putmn_lg   -0.037    0.051   -0.725    0.468   -0.037   -0.039
   .Rght_Thlms_Pr_   -0.019    0.050   -0.385    0.700   -0.019   -0.021
   .Lft_Thlms_Prp_   -0.003    0.049   -0.068    0.946   -0.003   -0.004
   .Left_Amygdl_lg   -0.019    0.045   -0.421    0.673   -0.019   -0.022
   .Rght_Amygdl_lg   -0.001    0.045   -0.020    0.984   -0.001   -0.001

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               1.000                               1.000    1.000
   .CrtclWhtMttrV_    0.304    0.027   11.112    0.000    0.304    0.340
   .Brain_Stem_log    0.351    0.031   11.457    0.000    0.351    0.380
   .Lft_VntrlDC_lg    0.465    0.039   11.888    0.000    0.465    0.451
   .Rght_VntrlDC_l    0.454    0.038   11.951    0.000    0.454    0.464
   .lhCortexVol_lg    0.533    0.043   12.523    0.000    0.533    0.598
   .rhCortexVol_lg    0.516    0.041   12.505    0.000    0.516    0.592
   .Lft_Accmbns_r_    0.732    0.056   13.033    0.000    0.732    0.826
   .Rght_Accmbns__    0.831    0.064   13.028    0.000    0.831    0.823
   .Lft_Crbllm_Cr_    0.736    0.057   12.919    0.000    0.736    0.761
   .Rght_Crbllm_C_    0.807    0.062   12.964    0.000    0.807    0.786
   .Left_Caudat_lg    0.644    0.051   12.541    0.000    0.644    0.605
   .Right_Caudt_lg    0.638    0.051   12.496    0.000    0.638    0.590
   .Lft_Hppcmps_lg    0.398    0.032   12.329    0.000    0.398    0.545
   .Rght_Hppcmps_l    0.508    0.041   12.421    0.000    0.508    0.573
   .Left_Palldm_lg    0.523    0.042   12.377    0.000    0.523    0.558
   .Right_Plldm_lg    0.552    0.044   12.418    0.000    0.552    0.570
   .Left_Putamn_lg    0.682    0.054   12.632    0.000    0.682    0.644
   .Right_Putmn_lg    0.575    0.046   12.585    0.000    0.575    0.627
   .Rght_Thlms_Pr_    0.320    0.028   11.248    0.000    0.320    0.358
   .Lft_Thlms_Prp_    0.345    0.030   11.562    0.000    0.345    0.404
   .Left_Amygdl_lg    0.461    0.036   12.636    0.000    0.461    0.646
   .Rght_Amygdl_lg    0.478    0.038   12.682    0.000    0.478    0.664


Group 2 [ASD]:

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  TBV =~                                                                
    CrtclWhtMttrV_    0.905    0.050   18.279    0.000    0.905    0.855
    Brain_Stem_log    0.888    0.049   18.161    0.000    0.888    0.851
    Lft_VntrlDC_lg    0.735    0.049   15.004    0.000    0.735    0.750
    Rght_VntrlDC_l    0.722    0.051   14.030    0.000    0.722    0.715
    lhCortexVol_lg    0.756    0.054   13.999    0.000    0.756    0.713
    rhCortexVol_lg    0.765    0.054   14.044    0.000    0.765    0.715
    Lft_Accmbns_r_    0.369    0.061    6.045    0.000    0.369    0.348
    Rght_Accmbns__    0.395    0.057    6.991    0.000    0.395    0.398
    Lft_Crbllm_Cr_    0.592    0.055   10.792    0.000    0.592    0.582
    Rght_Crbllm_C_    0.617    0.052   11.864    0.000    0.617    0.628
    Left_Caudat_lg    0.634    0.050   12.689    0.000    0.634    0.663
    Right_Caudt_lg    0.652    0.049   13.321    0.000    0.652    0.687
    Lft_Hppcmps_lg    0.684    0.061   11.130    0.000    0.684    0.598
    Rght_Hppcmps_l    0.757    0.054   14.047    0.000    0.757    0.715
    Left_Palldm_lg    0.677    0.054   12.554    0.000    0.677    0.657
    Right_Plldm_lg    0.655    0.053   12.325    0.000    0.655    0.648
    Left_Putamn_lg    0.529    0.052   10.100    0.000    0.529    0.552
    Right_Putmn_lg    0.605    0.056   10.711    0.000    0.605    0.579
    Rght_Thlms_Pr_    0.841    0.052   16.329    0.000    0.841    0.795
    Lft_Thlms_Prp_    0.798    0.054   14.691    0.000    0.798    0.739
    Left_Amygdl_lg    0.712    0.061   11.602    0.000    0.712    0.618
    Rght_Amygdl_lg    0.646    0.063   10.317    0.000    0.646    0.561

Covariances:
                                Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .lhCortexVol_log ~~                                                                 
   .rhCortexVol_lg                 0.532    0.048   11.130    0.000    0.532    0.957
 .Left_Caudate_log ~~                                                                
   .Right_Caudt_lg                 0.418    0.040   10.518    0.000    0.418    0.846
 .Left_Putamen_log ~~                                                                
   .Right_Putmn_lg                 0.504    0.051    9.942    0.000    0.504    0.740
 .Left_Cerebellum_Cortex_log ~~                                                      
   .Rght_Crbllm_C_                 0.567    0.051   11.118    0.000    0.567    0.898
 .Right_Thalamus_Proper_log ~~                                                       
   .Lft_Thlms_Prp_                 0.356    0.038    9.338    0.000    0.356    0.762
 .Left_Accumbens_area_log ~~                                                         
   .Rght_Accmbns__                 0.618    0.064    9.681    0.000    0.618    0.684
 .Left_VentralDC_log ~~                                                              
   .Rght_VntrlDC_l                 0.266    0.034    7.873    0.000    0.266    0.580
 .Left_Amygdala_log ~~                                                               
   .Rght_Amygdl_lg                 0.553    0.062    8.954    0.000    0.553    0.640
 .Left_Hippocampus_log ~~                                                            
   .Rght_Hppcmps_l                 0.341    0.047    7.282    0.000    0.341    0.502
 .Left_Pallidum_log ~~                                                               
   .Right_Plldm_lg                 0.351    0.043    8.256    0.000    0.351    0.587
 .Right_Putamen_log ~~                                                               
   .Rght_Amygdl_lg                 0.294    0.052    5.678    0.000    0.294    0.363
 .Left_Putamen_log ~~                                                                
   .Left_Amygdl_lg                 0.125    0.044    2.830    0.005    0.125    0.173
 .Right_Putamen_log ~~                                                               
   .Left_Amygdl_lg                 0.114    0.047    2.420    0.016    0.114    0.147
 .Left_Putamen_log ~~                                                                
   .Rght_Amygdl_lg                 0.189    0.047    4.016    0.000    0.189    0.247

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               0.031                               0.031    0.031
   .CrtclWhtMttrV_   -0.053    0.061   -0.867    0.386   -0.053   -0.050
   .Brain_Stem_log   -0.037    0.060   -0.618    0.537   -0.037   -0.036
   .Lft_VntrlDC_lg   -0.003    0.056   -0.046    0.963   -0.003   -0.003
   .Rght_VntrlDC_l    0.017    0.058    0.293    0.770    0.017    0.017
   .lhCortexVol_lg   -0.016    0.061   -0.257    0.797   -0.016   -0.015
   .rhCortexVol_lg   -0.024    0.062   -0.394    0.694   -0.024   -0.023
   .Lft_Accmbns_r_    0.034    0.061    0.553    0.580    0.034    0.032
   .Rght_Accmbns__    0.003    0.057    0.047    0.962    0.003    0.003
   .Lft_Crbllm_Cr_   -0.049    0.059   -0.841    0.400   -0.049   -0.048
   .Rght_Crbllm_C_    0.017    0.057    0.298    0.766    0.017    0.017
   .Left_Caudat_lg    0.031    0.055    0.556    0.578    0.031    0.032
   .Right_Caudt_lg    0.010    0.055    0.178    0.859    0.010    0.010
   .Lft_Hppcmps_lg    0.005    0.066    0.077    0.938    0.005    0.004
   .Rght_Hppcmps_l    0.031    0.061    0.516    0.606    0.031    0.030
   .Left_Palldm_lg    0.043    0.059    0.725    0.468    0.043    0.042
   .Right_Plldm_lg    0.055    0.058    0.941    0.347    0.055    0.054
   .Left_Putamn_lg    0.043    0.055    0.782    0.434    0.043    0.045
   .Right_Putmn_lg    0.024    0.060    0.405    0.685    0.024    0.023
   .Rght_Thlms_Pr_   -0.003    0.061   -0.057    0.955   -0.003   -0.003
   .Lft_Thlms_Prp_   -0.021    0.062   -0.335    0.737   -0.021   -0.019
   .Left_Amygdl_lg    0.000    0.066    0.001    1.000    0.000    0.000
   .Rght_Amygdl_lg   -0.019    0.066   -0.287    0.774   -0.019   -0.017

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    TBV               1.000                               1.000    1.000
   .CrtclWhtMttrV_    0.302    0.030    9.954    0.000    0.302    0.269
   .Brain_Stem_log    0.299    0.030   10.022    0.000    0.299    0.275
   .Lft_VntrlDC_lg    0.421    0.038   11.173    0.000    0.421    0.438
   .Rght_VntrlDC_l    0.499    0.044   11.367    0.000    0.499    0.489
   .lhCortexVol_lg    0.552    0.048   11.402    0.000    0.552    0.491
   .rhCortexVol_lg    0.560    0.049   11.394    0.000    0.560    0.489
   .Lft_Accmbns_r_    0.988    0.081   12.170    0.000    0.988    0.879
   .Rght_Accmbns__    0.828    0.068   12.128    0.000    0.828    0.841
   .Lft_Crbllm_Cr_    0.683    0.058   11.847    0.000    0.683    0.661
   .Rght_Crbllm_C_    0.583    0.050   11.732    0.000    0.583    0.605
   .Left_Caudat_lg    0.514    0.044   11.614    0.000    0.514    0.561
   .Right_Caudt_lg    0.474    0.041   11.522    0.000    0.474    0.527
   .Lft_Hppcmps_lg    0.842    0.071   11.795    0.000    0.842    0.643
   .Rght_Hppcmps_l    0.548    0.048   11.390    0.000    0.548    0.489
   .Left_Palldm_lg    0.603    0.052   11.632    0.000    0.603    0.568
   .Right_Plldm_lg    0.593    0.051   11.662    0.000    0.593    0.580
   .Left_Putamn_lg    0.641    0.054   11.901    0.000    0.641    0.696
   .Right_Putmn_lg    0.725    0.061   11.843    0.000    0.725    0.665
   .Rght_Thlms_Pr_    0.413    0.038   10.816    0.000    0.413    0.368
   .Lft_Thlms_Prp_    0.529    0.047   11.219    0.000    0.529    0.454
   .Left_Amygdl_lg    0.822    0.070   11.748    0.000    0.822    0.618
   .Rght_Amygdl_lg    0.906    0.076   11.881    0.000    0.906    0.685

Questions 
(1) why my std.all values are so high when using log transformed data without scaling prior to its input in the model ?
(2) why std.all loadings and variances are the same when scaling and not scaling my data before inputing the values in my model?

Since I am only interested in seeing if there are group differences in loadings and intercepts, can I use the scaled log values as input? If so, do I report the std.lv, since my observed variables have already been scaled? 

Thank you very much for your time. 

Terrence Jorgensen

unread,
Apr 12, 2019, 4:37:04 AM4/12/19
to lavaan
I am using log transformed data

Why?  If your data are not normally distributed, you can just use a robust estimator, so that your parameters are still interpretable.

cfa(..., estimator = "MLR")


Since things 'look better'

What does that mean, by what criteria?  You can obtain standardized estimates without transforming your data, as you were already told in another thread.

What can I do? 

Analyze the original data, using a robust estimator, and compare models that test your null hypotheses of invariance.

  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

Your model is having trouble converging.  Perhaps analyzing log-transformed data is making estimation difficult.

(1) why my std.all values are so high when using log transformed data without scaling prior to its input in the model ?

Because the means of z scores are 0 by definition, whereas your log-transformed variables clearly have higher means.
(2) why std.all loadings and variances are the same when scaling and not scaling my data before inputing the values in my model?

That is why it is pointless to standardize your data before analysis.  The standardized estimates already provide that information.  (The fact that the raw estimates do not match the std.all estimates means that you weren't fitting your model to z scores, so I'm not sure what you mean by "scaling".)

Since I am only interested in seeing if there are group differences in loadings and intercepts, can I use the scaled log values as input? 

Standardized estimates are not the data-generating parameters, so they are not the values relevant to testing measurement invariance.  You need to analyze your raw data, using a robust estimator if variables are non-normal (but continuous), and compare models with and without equality constraints on certain parameters (e.g., test equality of loadings, then equality of intercepts, etc.).


http://lavaan.ugent.be/resources/books.html  (numerous books describe the process with lavaan)

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

Camille Williams

unread,
Apr 12, 2019, 8:18:22 AM4/12/19
to lavaan
Hi, 

Thank you very much for time and patience with me. I am discovering this on my own and appreciate your help.  

I want to be analyzing log transformed data, because I am interested in the group differences in slope and intercept of these volumes once they have been log transformed. . This is why I insist on using log transformations on my volumes. The slope obtained following log-log transformation differs from that of the linear model.

Can I use an estimator on my log transformed data in the cfa ? 

What I did to "scale" my variables is first apply a log transformation and then the scale function. for example: 
Right_Cerebellum_Cortex_log = scale(log10(`Right-Cerebellum-Cortex`))


thank you again,
Camille

maryam nasseri

unread,
Apr 12, 2019, 10:47:59 AM4/12/19
to lav...@googlegroups.com
Hi Terrence and everyone else,

I'm having a similar issue. You and others recommended me to use the raw original data and a robust estimator (and not scaling/z-score my data as input); when I do this I get multiple warning messages and the summary() function returns an Error of subscript out of bound! I am printing the exact code I used below; any thoughts? Many thanks for any help/info:

mydata<- read.csv("data.csv")   #this is my raw original data
lex.modelB<- 'group1=~ mtld + hdd + ndwesz + ndwerz + vocd + mattr + msttr  
+ 	      group2=~ logttr + rttr + uber + maas
+ 	      group3=~ lv + nv + vv1 + vv2 +cvv1 + adjv + ld
+ 	      group4=~ ls1 + ls2 + vs2 + cvs1'

fitB<- sem(lex.modelB, mydata, sample.nobs=210, estimator = "MLM")   # using a robust estimator

Warning messages:
1: In lav_data_full(data = data, group = group, cluster = cluster,  :
  lavaan WARNING: some observed variances are (at least) a factor 1000 times larger than others; use varTable(fit) to investigate
2: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
3: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not invert information matrix

4: In lav_object_post_check(object) :
  lavaan WARNING: some estimated ov variances are negative
5: In lavaan::lavaan(model = lex.modelB, data = lexdata, sample.nobs = 210,  :
  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

summary(fitB, ci = TRUE, fit.measures=TRUE, standardized = TRUE)
lavaan 0.6-3 ended normally after 599 iterations

  Optimization method                           NLMINB
  Number of free parameters                         50

  Number of observations                           210

  Estimator                                         ML
  Model Fit Test Statistic                    2597.331
  Degrees of freedom                               203
  P-value (Chi-square)                           0.000
Error in TEST[[2]] : subscript out of bounds

--
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 post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.

Edward Rigdon

unread,
Apr 12, 2019, 10:58:25 AM4/12/19
to lav...@googlegroups.com
Dividing by a constant to reduce differences in variances, is not the same as standardization using estimates from the data, like standard deviations. If one observed variable has a variance in single digits and abother has a variance in teh range of 10,000, dividing the latter variable by 100 changes nothing statistically (you can easily undo the rescaling after the fact), but eliminates a potential problem. With the warning about a large difference in variances, that is the first thing I would do, before worrying about the otehr warning / error messages.

maryam nasseri

unread,
Apr 13, 2019, 11:13:24 AM4/13/19
to lav...@googlegroups.com
Thanks Edward, this explanation makes sense. I'm going to re-do the whole thing with this method instead of standardisation, to see if the fit also improves.

Just a question, if SEs are not calculated for a model (e.g., NA), is it valid to report the results of fit indices still? Are we supposed to report standard errors for a publication also? How do we interpret SEs together with fit indices?

Many thanks to whoever could help with this

Best

Edward Rigdon

unread,
Apr 13, 2019, 11:24:43 AM4/13/19
to lav...@googlegroups.com
If the software fails to estimate standard errors, I would be suspicious of the values reported for fit indices and parameter estimates. The model may not be identified, meaning that the reported parameter estimates may not be optimal--or there might be another problem that casts doubt on the model results. Moreover, without standard errors, you don't know what range of other values for the parameters would also be consistent with your model and data.
Message has been deleted

Camille Williams

unread,
Apr 15, 2019, 4:26:59 AM4/15/19
to lavaan
Hi,

Since I am interested in the loading and intercept obtained from the log transformation (to study allometry), I applied the log10 transformation to my data with the estimator = "MLR" since applying the log transformation made my data non-normal. 

However, my model is having trouble converging because analyzing log-transformed data is making estimation difficult. I get this warning not for the configural, but for the metric and scalar invariance models: 
  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

When I examine my optim.gradient, I see that I have 2 (2/139) of my residual correlations that are at - 0.001 in the scalar invariance cfa and 2 (2/139) other residual correlations that are at - 0.001 in the metric invariance model.

I have so many correlations (139) because I have one latent variable total brain vol which is inferred from 22 local brain volumes, which are obviously correlated with each other and must be taken into account to establish appropriate fit. 

I do not get this error when I do not include any residual correlations but my fit is terrible based on the CFI TLI RMSEA & SRMR. When I add in theoretically supported residual correlations that have on the modindices between 105 and 300 in my model, I still get this warning:
> TBV0.model <- 'TBV =~ NA*CorticalWhiteMatterVol_log 
+ + Brain_Stem_log 
+ + Left_VentralDC_log + Right_VentralDC_log 
+ + lhCortexVol_log + rhCortexVol_log
+ + Left_Accumbens_area_log + Right_Accumbens_area_log
+ + Left_Cerebellum_Cortex_log + Right_Cerebellum_Cortex_log 
+ + Left_Caudate_log + Right_Caudate_log 
+ + Left_Hippocampus_log + Right_Hippocampus_log
+ + Left_Pallidum_log + Right_Pallidum_log 
+ + Left_Putamen_log + Right_Putamen_log 
+ + Right_Thalamus_Proper_log + Left_Thalamus_Proper_log
+ + Left_Amygdala_log + Right_Amygdala_log
+ TBV ~ c(0, 0.031)* 1
+ TBV ~~ 1*TBV 
+ lhCortexVol_log ~~ rhCortexVol_log
+ Left_Caudate_log ~~ Right_Caudate_log
+ Left_Putamen_log ~~ Right_Putamen_log
+ Left_Cerebellum_Cortex_log ~~ Right_Cerebellum_Cortex_log
+ Right_Thalamus_Proper_log ~~ Left_Thalamus_Proper_log
+ Left_Accumbens_area_log ~~ Right_Accumbens_area_log
+ Left_VentralDC_log ~~ Right_VentralDC_log
+ Left_Amygdala_log ~~ Right_Amygdala_log
+ Left_Hippocampus_log ~~ Right_Hippocampus_log
+ Left_Pallidum_log ~~ Right_Pallidum_log 
+ '
> fit_TBV<- cfa(TBV0.model, data=Abide_MGCFA, group = "DX_GROUP",estimator = "MLR")
Warning message:
In lavaan::lavaan(model = TBV0.model, data = Abide_MGCFA, group = "DX_GROUP",  :
  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

I'm starting to think that lavaan may not be adapted for me to investigate group differences in allometric scaling (log transformed loadings) and intercepts with this method.

Thank you very much for your patience and help,

Camille 

On Friday, April 12, 2019 at 10:37:04 AM UTC+2, Terrence Jorgensen wrote:

Terrence Jorgensen

unread,
Apr 16, 2019, 4:43:48 AM4/16/19
to lavaan
Can I use an estimator on my log transformed data in the cfa ? 

If you want to interpret results on the log scale, then that is fine, I was just checking that this was intentional (most researchers follow textbook advice to transform data to make it more normal, which is quite outdated advice in my opinion).  I still would not recommend scaling your log-transformed variables, since standardized estimates are already available after estimation.

Camille Williams

unread,
Nov 13, 2019, 3:38:27 AM11/13/19
to lavaan
Hi Terrence, 

Refresher: I am looking at group differences in the allometric scaling (power) relationship between total brain volume and each local volume (e.g. hippocampus, amygdala...). To look at this non-linear (power) relationship: Local Volume = Intercept + TBV^a, we use a log transformation to obtain a linear equation: log10(Local Volume) = Intercept + a * log10(TBV). 
I want to compare my MGCFA and LMEMs results. 

Question on Latent Variable Interpretation with the log10 transformation of observed variables 
In my LMEMs, the log10(TBV) is the log10 transformation of my sum of local volumes (grey & white matter in the brain). 
In my MGCFA, my observed variables are log10 transformed local volumes and they all load on my single latent variable. My colleagues and I were wondering if the latent variable corresponds to the log10(sum(local volumes)) or the sum(log10(local volumes)). To be coherent with the LMEMs, it should be the former. 

Thank you very much for your valuable time and input,

Camille 

Camille Williams

unread,
Nov 13, 2019, 3:43:00 AM11/13/19
to lavaan
Reply all
Reply to author
Forward
0 new messages