Model Estimation Failure in lavaan with Ordered Factor Variable

171 views
Skip to first unread message

Pablo

unread,
May 13, 2023, 6:20:10 AM5/13/23
to lavaan

Hi, 

 

I am encountering difficulties with model estimation in lavaan when including an ordered factor variable in my analysis. I have a structural equation model where the ordered factor variable "Conc" represents concentration with four levels: 0, 2, 20, and 200. When the Conc variable is a numeric and not a factor, the model converges smoothly but after switching it it just gives a lot of warnings.

Here is a simplified version of my model specification:

 


#Aquatic communitites

Detri ~ Conc

Herbivores ~ Conc

Predators ~ Conc

Macrozoo ~ Conc

Microzoo ~ Conc

fito ~ Conc

 

#Processes

periph ~ Conc

decomp ~ Conc

mf ~ Conc

 

#Biota interdependencies

Detri ~~ Herbivores

Detri ~~ Microzoo

Detri ~~ Predators

Detri ~~ Macrozoo

Detri ~~ fito

 

Herbivores ~~ Predators

Herbivores ~~ Macrozoo

Herbivores ~~ Microzoo

Herbivores ~~ fito

 

Predators ~~ Macrozoo

Predators ~~ Microzoo

Predators ~~ fito

 

Macrozoo ~~ fito

Macrozoo ~~ Microzoo

 

Microzoo ~~ fito

 

#Functional interdependencies

mf ~~ periph

mf ~~ fito

mf ~~ Herbivores

periph ~~ Herbivores

periph ~~ fito

Upon attempting model estimation, I encountered the following warning messages:

 

Warning: lavaan WARNING: exogenous variable(s) declared as ordered in data: Conc

Warning: lavaan WARNING: Model estimation FAILED! Returning starting values.

Warning: lavaan WARNING: parameter table does not contain intercepts for one or more variables: [Detri Herbivores Predators Macrozoo Microzoo fito periph decomp mf]

Warning: lavaan WARNING: estimation of the baseline model failed.

I have already recoded the "Conc" variable as an ordered factor with the correct levels (0, 2, 20, and 200) using the factor() function in R.

 

Could you please provide guidance on how to properly handle ordered factor variables in lavaan? Additionally, any insights into resolving the warning messages related to the estimation failure would be greatly appreciated.

 

Thank you for your assistance.

 

Sincerely,

Pablo

Message has been deleted

Terrence Jorgensen

unread,
May 16, 2023, 5:57:36 AM5/16/23
to lavaan

difficulties with model estimation in lavaan when including an ordered factor variable "Conc" in my analysis

Because it is an exogenous predictor, not an endogenous outcome.  

Warning: lavaan WARNING: exogenous variable(s) declared as ordered in data: Conc

Models are for explaining outcomes, not for explaining predictors.  In a probit regression, the link function is applied to the dependent variable on the lefthand side of the formula, not predictors on the righthand side.

Could you please provide guidance on how to properly handle ordered factor variables in lavaan? 

Specify dummy codes or contrast codes.  


If those 4 levels are in fact numeric, you could continue to treat it as a numeric predictor, but that would estimate a single linear effect.  You could use contr.poly() to generate appropriate orthonormal polynomial contrast codes for those 4 values:

contr.poly(4, scores = c(0, 2, 20, 200))
             .L          .Q            .C
[1,] -0.3311854  0.44803135 -0.6630113992
[2,] -0.3192508  0.30718648  0.7441205378
[3,] -0.2118393 -0.83571774 -0.0818532592
[4,]  0.8622756  0.08049991  0.0007441205

 
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