lavaan WARNING: the optimizer warns that a solution has NOT been found!
# Here's the model I am aiming for:
model <- '
# measurement model
latentvar1 =~ obsvar1 + obsvar2 + obsvar3 + obsvar4
latentvar2 =~ obsvar5 + obsvar6 + obsvar7 + obsvar8 + obsvar9 + obsvar10
latentvar3 =~ obsvar11 + obsvar12 + obsvar13 + obsvar14 + obsvar15 + obsvar16 + obsvar17 + obsvar18 + obsvar19
latentvar4 =~ obsvar20 + obsvar21 + obsvar22 +obsvar23
latentvarA =~ latentvar1 + latentvar2 + latentvar3 + latentvar4
latentvar5=~ obsvar24 + obsvar25 + obsvar26 + obsvar27 + obsvar28 + obsvar29 + obsvar30 + obsvar31 + obsvar32 + obsvar33 + obsvar34 + obsvar35
latentvar6 =~ obsvar36 + obsvar37 + obsvar38 + 39 + obsvar40 + obsvar41
latentvarB =~ latentvar5 + latentvar6
latentvar7 =~ obsvar42 + obsvar43 + obsvar44
latentvar8 =~ obsvar45 + obsvar46 + obsvar47
latentvar9 =~ obsvar48 + obsvar49 + obsvar50
latentvar10 =~ obsvar51 + obsvar52
latentvar11 =~ obsvar53 + obsvar54
latentvar12 =~ obsvar55 + obsvar56
latentvarC =~ latentvar7 + latentvar8 + latentvar9 + latentvar10 + latentvar11 + latentvar12
latentvarD=~ obsvar57 + obsvar58 + obsvar59 + obsvar60 + obsvar61 + obsvar62 + obsvar63 + obsvar64
latentvarE=~ obsvar65 + obsvar66 + obsvar67 + obsvar68
latentvarF=~ obsvar69 + obsvar70 + obsvar71 + obsvar72
# regressions
latentvarB~ latentvarA
latentvarC ~ latentvarA
latentvarD ~ latentvarA
latentvarE ~ latentvarA
latentvarF ~ latentvarA
'
fit <- sem(model, data= data)
summaryfit, fit.measures=TRUE, standardized=TRUE)
Below is the SEM I have been trying to run via lavaan. I'm finding that when I remove the latent vars that contain latent vars, the model runs. But when I run the model that I actually want (i.e. one containing several latent vars that themselves contain latent vars), I get the error:
--fit <- sem(model, data= AsburyPEFit.data)
summaryfit, fit.measures=TRUE, standardized=TRUE)
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/503855d6-cdbc-4b62-b3ba-3405cdcc276e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
fit <- sem(model, data= data)
summaryfit, fit.measures=TRUE, standardized=TRUE)
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lav...@googlegroups.com.
Might this be related to a relatively small sample size - N = 450?
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/04137508-3b46-4eb4-a44a-53860f75c3bb%40googlegroups.com.
Maybe I can run the sem with only the means for the overall constructs, having already run the cfa on the whole of each construct in relation to their subscales. Or is that bad practice?
--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+un...@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
To view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/04137508-3b46-4eb4-a44a-53860f75c3bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I will give factor score regression a try. Can you direct me to the documentation for this, so I know the parameter options available?
lavaan::fsr(
devtools::install_github("simsem/semTools/semTools")