Missing observed variables

881 views
Skip to first unread message

Arjan van Dam

unread,
Aug 3, 2016, 4:52:21 AM8/3/16
to lavaan
Hi, 

Reading the data gives a problem. I get the error message: missing observed variables in dataset.

Names() and Summary() can reproduce the data. What am I doing wrong? Hope somebody can help me. 

Greetings, 

Arjan van Dam 

Edward Rigdon

unread,
Aug 3, 2016, 8:32:06 AM8/3/16
to lav...@googlegroups.com
It will help if you share your R syntax and (if you can) a snippet of your data.

--
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.
For more options, visit https://groups.google.com/d/optout.

Arjan van Dam

unread,
Aug 3, 2016, 9:44:08 AM8/3/16
to lav...@googlegroups.com
Hi Edward, 

Thanks for your help. Probably it will be something stupid... ;-)

Looking forward to your reply. 

Vriendelijke groet,

Arjan van Dam
Fidare, Training en advies voor arbeid en gezondheid

Heijermanslaan 27
1215 JL Hilversum
Mobiel: (06) 488 656 06
E-mail: ar...@fidare.nl
Website: www.fidare.nl

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/qqovJfd7AEM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+un...@googlegroups.com.
CFA AGO FS NL JP.R
AGO_FS_NL_JP_demo.sav

Arjan van Dam

unread,
Aug 5, 2016, 1:23:30 AM8/5/16
to lavaan
Hi, 

Has anyone a clue what I am missing?

Thanks!

Greeting,

Arjan van Dam

Op woensdag 3 augustus 2016 10:52:21 UTC+2 schreef Arjan van Dam:

xinxi813

unread,
Aug 5, 2016, 1:59:05 AM8/5/16
to lav...@googlegroups.com
Dear list,

I have a single indicator construct. For the purpose of the model, I need to fix the latent variance at 1 and the indicator residual variance at 0. So I have to free the fixed loading. Meanwhile, I need to label this loading so that new defined parameters can be calculated based on the estimate of this loading. How do I do it in lavaan? Thank you very much.

I have tried the following code, did not work:

eta_pre =~ sd_pre*x_pre
eta_pre=~NA*x_pre
eta_pre~~1*eta_pre
x_pre~~ 0*x_pre

Error in lavParseModelString(model) :
lavaan ERROR: duplicate model element in: eta_pre=~NA*x_pre

Best regards,

ya

Terrence Jorgensen

unread,
Aug 6, 2016, 3:27:44 PM8/6/16
to lavaan
I have tried the following code, did not work:

eta_pre =~ sd_pre*x_pre
eta_pre=~NA*x_pre
eta_pre~~1*eta_pre
x_pre~~ 0*x_pre

Error in lavParseModelString(model) :
  lavaan ERROR: duplicate model element in: eta_pre=~NA*x_pre

Try putting it on the same line, like in the tutorial (under the "Modifiers" header): http://lavaan.ugent.be/tutorial/syntax2.html

eta_pre =~ sd_pre*x_pre + NA*x_pre 

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Terrence Jorgensen

unread,
Aug 6, 2016, 3:32:15 PM8/6/16
to lavaan
I get the error message: missing observed variables in dataset.

Look at the variable names that it says are missing, and you can see it is all the indicators per factor with the spaces removed.  Your syntax looks like Mplus, with spaces between indicators.  lavaan needs you to delimit those with the "+" operator:

Arjan van Dam

unread,
Aug 6, 2016, 3:47:17 PM8/6/16
to lav...@googlegroups.com
Hi Terrence, 

So stupid. I also work in Mplus and didn't notice it. Thanks a lot for pointing out my blind spot!!

Vriendelijke groet,

Arjan van Dam
Fidare, Training en advies voor arbeid en gezondheid

Heijermanslaan 27
1215 JL Hilversum
Mobiel: (06) 488 656 06
E-mail: ar...@fidare.nl
Website: www.fidare.nl

--
You received this message because you are subscribed to a topic in the Google Groups "lavaan" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/lavaan/qqovJfd7AEM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to lavaan+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages