data1 <- read.csv("data1.csv", header =T)
model1 <- 'cog =~ cog1 + cog2 + cog3; soc =~ soc_1 + soc_2 + soc_3; reg =~ reg1 + reg2 + reg3 + reg4 + reg5 + reg6 + reg7; out =~ out1 + out2 + out3; cog ~ out; soc ~ out; reg ~ out'
Hello,I am new to lavaan and I am having some trouble with my code. I was wondering if I can get some help in this group :)This is my code:data1 <- read.csv("data1.csv", header =T)
model1 <- 'cog =~ cog1 + cog2 + cog3; soc =~ soc_1 + soc_2 + soc_3; reg =~ reg1 + reg2 + reg3 + reg4 + reg5 + reg6 + reg7; out =~ out1 + out2 + out3; cog ~ out; soc ~ out; reg ~ out'
SEMmodel <- cfa(model=model1, data=data1,missing = "fiml", estimator = "mlr", se = "robust.huber.white", debug = TRUE)And this is the error I get:Warning messages:1: In lav_data_full(data = data, group = group, cluster = cluster, :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, cluster = cluster, :lavaan WARNING: small number of observations (nobs < nvar)
3: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats, :lavaan WARNING:Could not compute standard errors! The information matrix couldnot be inverted. This may be a symptom that the model is notidentified.
4: In lav_test_yuan_bentler(lavobject = NULL, lavsamplestats = lavsamplestats, :lavaan WARNING: could not invert information matrix
5: In lav_object_post_check(object) :lavaan WARNING: covariance matrix of latent variablesis not positive definite;use lavInspect(fit, "cov.lv") to investigate.
6: In lavaan::lavaan(model = modelideation, data = mrimpact_apq_numeric, :lavaan WARNING: not all elements of the gradient are (near) zero;the optimizer may not have found a local solution;use lavInspect(fit, "optim.gradient") to investigate
I thought that if I normalise the data and if I use some dimensionality reduction method it might help with the first two errors, but I am not sure. Also not sure how to address the other 4 warnings.
Any help would be very much appreciated.