97 views

Skip to first unread message

Jan 31, 2020, 5:44:03 AM1/31/20

to lavaan

I am new to lavaan and am trying to run a model for 2 binary outcomes with 2 continuous predictors. However, when I run it, it says: "Warning message: 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."

When I replace the binary outcomes with continuous outcomes, the model produces standard errors without a warning message. What am I doing wrong here?

Below is code to reproduce the error message. I would be extremely grateful for any help.

Many thanks,

Rose

library(MASS)

library(lavaan)

toy_data <- as.data.frame(mvrnorm(n=100, mu = c(0,0,0,0), Sigma = diag(4)))

# Make new binary variables

toy_data$Y1 <- ifelse(toy_data$V1 > 0.5, 1, 0)

toy_data$Y2 <- ifelse(toy_data$V2 > 0.7, 1, 0)

# Rename continuous predictor variables as 'A' and 'B' for model

toy_data$A <- toy_data$V3

toy_data$B <- toy_data$V4

model1 <- '

# Regressions

Y1 ~ a1*A + b1*B #regression for Y1

Y2 ~ a2*A + b2*B #regression for Y2

# Variances and covariances

A~~va*A #variance in A

B~~vb*B #variance in B

Y1~~vy1*Y1 #variance in Y1

Y2~~vy2*Y2 #variance in Y2

A~~cvab*B #covariance between A and B

Y2~~cvy1y2*Y1 #covariance between Y1 and Y2

A~ia*1 #intercept for A

B~ib*1 #intercept for B

Y1~iy1(0.05)*1 #intercept for y1

Y2~iy2(0.17)*1 #intercept for y2

# Total effects

TotalY1:= a1 + b1

TotalY2:= a2 + b2'

Fit1 <- lavaan(model1, data=toy_data, ordered=c("Y1","Y2"), estimator = "WLSMV")

summary(Fit1)

### Re-run with continuous Y variables

toy_data$Y1 <- toy_data$V1

toy_data$Y2 <- toy_data$V2

Fit1 <- lavaan(model1, data=toy_data)

summary(Fit1)

Feb 4, 2020, 8:58:58 AM2/4/20

to lavaan

when I run it, it says: "Warning message: 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."

I get an error rather than a warning, because the syntax you posted contains illegal model syntax:

Y1~iy1(0.05)*1 #intercept for y1Y2~iy2(0.17)*1 #intercept for y2

Are you trying to simultaneously label and assign fixed values to those intercepts?

FYI, lavaan fixes the intercepts and variances of latent responses (assumed to underly ordered variables) by default, in order to identify the model. If you are freeing those in your syntax, that is probably why your model is not identified.

Terrence D. Jorgensen

Assistant Professor, Methods and Statistics

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

Feb 5, 2020, 6:56:21 AM2/5/20

to lavaan

Hi Terrence,

__ __

Thank you very much for your help. I realised my mistake and that I should not have assigned and labelled those intercepts. Even without the assigned values to the intercepts, the model ran with a warning that the information matrix could not be inverted. I now understand from your answer that it is because they are ordered variables, converted to latent responses by lavaan, and thus assigned fixed intercepts and variances.

The model runs if I no longer freely estimate the intercepts and variances of the ordered variables, so thank you!

As a follow-up question, when examining parameterTable for the model that ran successfully, I noticed the following parameters: Y1 ~*~ Y1 and Y2 ~*~ Y2 (both fixed as 1). I read that this represents scaling the factors in the Delta paramaterisation. Is this what you meant when you said lavaan assigns fixed intercepts and variances to the latent responses?

Thanks,

Rose

Feb 5, 2020, 3:20:10 PM2/5/20

to lavaan

Is this what you meant when you said lavaan assigns fixed intercepts and variances to the latent responses?

Yes, delta parameterization fixes the total latent variances to 1, whereas theta parameterization fixes the residual latent variance to 1. Either way, intercepts are fixed to zero by default. Kamata & Bauer's (2008) excellent tutorial refers to these parameterizations as marginal and conditional, respectively.

Reply all

Reply to author

Forward

0 new messages

Search

Clear search

Close search

Google apps

Main menu