CFA error

40 views
Skip to first unread message

Anders Dahlen Lauvsnes

unread,
May 4, 2020, 5:47:59 PM5/4/20
to lavaan
Hi,

I am trying to do a CFA on a known 6 item psychometric instrument, with 2 known factors, items 1-4 and 5-6.
See below for code and error:

Model <- '
f1 =~ ConcPrWraUp.NT4BLQ2 + ConcPrOrd.NT4BLQ2 + ConcPrThou.NT4BLQ2 + ConcPrAppo.NT4BLQ2
f2 =~ ConcPrFidg.NT4BLQ2 + ConcPrOverlyAct.NT4BLQ2' 
fit <- cfa(Model, data=data,std.lv=TRUE) 

Error in lav_data_full(data = data, group = group, cluster = cluster,  : 
  lavaan ERROR: unordered factor(s) detected; make them numeric or ordered: ConcPrWraUp.NT4BLQ2 ConcPrOrd.NT4BLQ2 ConcPrThou.NT4BLQ2 ConcPrAppo.NT4BLQ2 ConcPrFidg.NT4BLQ2 ConcPrOverlyAct.NT4BLQ2

car...@web.de

unread,
May 4, 2020, 5:53:18 PM5/4/20
to lav...@googlegroups.com
The error message tells you what to do. What's your question?
Am 04.05.20, 23:48 schrieb Anders Dahlen Lauvsnes <and...@cybehave.com>:
--
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 view this discussion on the web visit https://groups.google.com/d/msgid/lavaan/7f396508-a7f4-4778-b7fe-d07dd34d33e5%40googlegroups.com.

Anders Dahlen Lauvsnes

unread,
May 4, 2020, 5:56:17 PM5/4/20
to lavaan
So just covert the variables from factors to numeric? or do I need to order them some other way?


mandag 4. mai 2020 23.53.18 UTC+2 skrev car...@web.de følgende:
The error message tells you what to do. What's your question?
Am 04.05.20, 23:48 schrieb Anders Dahlen Lauvsnes <and...@cybehave.com>:
Hi,

I am trying to do a CFA on a known 6 item psychometric instrument, with 2 known factors, items 1-4 and 5-6.
See below for code and error:

Model <- '
f1 =~ ConcPrWraUp.NT4BLQ2 + ConcPrOrd.NT4BLQ2 + ConcPrThou.NT4BLQ2 + ConcPrAppo.NT4BLQ2
f2 =~ ConcPrFidg.NT4BLQ2 + ConcPrOverlyAct.NT4BLQ2' 
fit <- cfa(Model, data=data,std.lv=TRUE) 

Error in lav_data_full(data = data, group = group, cluster = cluster,  : 
  lavaan ERROR: unordered factor(s) detected; make them numeric or ordered: ConcPrWraUp.NT4BLQ2 ConcPrOrd.NT4BLQ2 ConcPrThou.NT4BLQ2 ConcPrAppo.NT4BLQ2 ConcPrFidg.NT4BLQ2 ConcPrOverlyAct.NT4BLQ2

--
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.
Message has been deleted

Sandra Jaworeck

unread,
May 14, 2020, 2:49:46 AM5/14/20
to lavaan
Ordinal variables should not simply be treated metrically. You can order your factors by using the following code:

yourdata[,c("factorvariable1", "factorvariable2")] <-lapply(yourdata[,c("factorvariable1", "factorvariable2")], ordered)

Afterwards you have to indicate with your fit:

fit <- cfa(Model, data=data,std.lv=TRUE, ordered = c("factorvariable1", "factorvariable2"))

Note that multilevel SEM currently (0.6-5/0.6-6) does not work with ordered/categorical data!
Reply all
Reply to author
Forward
0 new messages