I built the model with one latent variable (WDI that was calculated by sum dam+ditch + aqued then standardized the result). for other variables, I used transformed data (look the attachment) because the original data is not normally distributed.
library(lavaan)
model <- '
# measurement model
WDI =~ ln.dams + ln.ditch +ln.aqued (should I use original or transformed variables to build latent variable???)
# regressions
ln.intro ~ WDI+
asn.dev+ln.area+sqr.diversity
sqr.impact ~ ln.intro+WDI+
asn.dev+sqr.diversity
sqr.diversity ~ ln.area
# residual correlations
WDI ~~ ln.area
fit.light <- sem(model, data = light)
summary(fit.light, standardized = TRUE)
however, when I built the model I have 3 error messages which are
Warning messages:
1: In vnames(FLAT, "ov.x", warn = TRUE) :
lavaan WARNING: model syntax contains variance/covariance/intercept formulas
involving (an) exogenous variable(s): [asn.dev ln.area]; Please use fixed.x=FALSE or leave them alone
2: In lavaan::lavaan(model = model, data = light, model.type = "sem", :
lavaan WARNING: some estimated variances are negative
3: In lavaan::lavaan(model = model, data = light, model.type = "sem", :
lavaan WARNING: covariance matrix of latent variables is not positive definite; use inspect(fit,"cov.lv") to investigate.
so, I am wondering what mistake I had to have those error.
Should I use original data instead?