Skip to first unread message

Aug 22, 2019, 7:13:12 PM8/22/19

to lavaan

Hi~ I am Frederick, and currently I'm learning SEM and lavaan, also using available dataset to do some preliminary pathway analysis for type 2 diabetes.

The model is in the pic, a big one, with categorical var edu (low, mid, high) / income (low, mid, high) / smoking (current, ex, non) / t2dm(if having t2dm or not).

Since the dataset is remote access and protected, so I provide screen shot here.

Other var can be seen as intermediators or mediators, sex / age are two exogenous variables that used for adjusting other variables.

I've done this mainly in three steps, as only one latent variable diet I used.

(1) Test Diet latent variable by WLS estimation

(2) Build up whole model without categorical variable by WLS estimation , while the outcome (instead of t2dm) I used HbA1c or fasting glucose

(3) and then, I added education, income and smoking, and changed outcome variable to t2dm (having diabetes or not), by using WLSMV

* I didn't put income and education into one latent variable (issues for formative and reflective), but linked them with covariance ~~

sample sizes 80000+ , actually analyzed 60000+ (default setting for missing value), for (2) and (3) basically the same sample sizes

*some of the NA I put there is a reminder and habit for myself...

While before (3), until 2, the model was well-fitted with reasonable estimates without categorical variables.

But after introducing categorical variable, after estimation I received this warning

not all element of the gradient are (near) zero;

the optimizer may not have found a location solution;

...

I think it might indicate a false positive convergence....

then I used lavInspect(fit, "optim.gradient") to check, and did found several numbers (sorry i don't know how to call them) are above 0.01, and indeed , most of the larger numbers are related to categorical variables introduced, but also some non-categorical var appeared larger numbers as well, among them 8 were larger then 0.01, one larger than 0.1

then I tried to introduce (test) these categorical variables one by one, while for any of them, once introduced , it gave this warning...

Hope someone could help with this!~ Or any suggestions for model itself that can cause this error. Currenlty I'm kind of trapped here, while previous literature using similar method for this topic all used MPlus and didn't give any specific details...

Thanks~!

Aug 23, 2019, 5:25:54 AM8/23/19

to lavaan

Age might be a problem, because its scale seems huge relative to other variables. Is it measured in days or something? You could divide it by a constant to reduce its variance (e.g., divide by 10 to express its effect for every 10-unit increase). That should make sure its variance doesn't dominate the parameter space while the optimizer tries to find a solution. Also, why are you regressing age on anything, much less on gender, and setting that effect to 0? Did you mean to simply force the covariance between gender and age to be 0? Use a double-tilde for covariances. But age and gender should be exogenous, so just don't fix it to zero (there is no reason for that restriction, and it will only decrease model fit to the degree that the sample covariance is not zero).

Also, I doubt that "Diet" is actually a common factor. It seems like a composite. Do some searching about formative vs. reflective measurement. You can also ask on SEMNET, which is a general forum with more participation than this little software-help forum:

If the correlations among the Diet indicators are not following the pattern that would at least allow a common factor to be "faked" in your model, then I am guessing that is causing the convergence problems, because your model would probably put too much constraint on the relationships of each indicator with other outcomes that you use "Diet" to predict.

Terrence D. Jorgensen

Assistant Professor, Methods and Statistics

Research Institute for Child Development and Education, the University of Amsterdam

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu