Hi all,
I am trying to write the syntax for my model using the lavaan package in R and I am getting a rather long error message regarding my code.
I am not sure if I did this correctly given the path diagram (path diagram picture included in the attachment). I think my biggest problem is not knowing if I programmed my formative latent variables correctly.
In addition, I need to standardize coefficients for real GDP Growth (y2) and GDP per capita (y4). Does my code below currently do this for me or am I missing an important step?
Thank you in advance for help.
> data1 <- read.csv("/Users/demkic/Documents/R/specification1.csv", header=T)
>
> library(lava an)
This is lavaan 0.5-17
lavaan is BETA software! Please report any bugs.
> SE.Model <- '
+ #regressions
+ SE <~ X5 + X6 + X2 + X1
+ C <~ X7 + X11 + X10 + X8
+
+ #latent variable definitions
+ SE =~ Y2 + Y3 + Y1
+ C =~ Y4 + Y5 + Y6'
>
> fitSE <- sem(SE.Model, data = data1)
Warning messages:
1: In lav_data_full(data = data, group = group, group.label = group.label, :
lavaan WARNING: some observed variances are (at least) a factor 1000 times larger than others; use varTable(fit) to investigate
2: In lav_data_full(data = data, group = group, group.label = group.label, :
lavaan WARNING: small number of observations (nobs < nvar)
nobs = 8 nvar = 14
3: In lav_samplestats_from_data(lavdata = lavdata, missing = lavoptions$missing, :
lavaan WARNING: sample covariance can not be inverted
4: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :
lavaan WARNING: could not compute standard errors!
lavaan NOTE: this may be a symptom that the model is not identified.
5: In lavaan::lavaan(model = SE.Model, data = data1, model.type = "sem", :
lavaan WARNING: covariance matrix of latent variables is not positive definite; use inspect(fit,"cov.lv") to investigate.