Item with no variance in CFA

2,220 views
Skip to first unread message

Antonello Preti

unread,
Nov 18, 2017, 2:14:25 PM11/18/17
to lavaan
Hi to all.
I have a problem with a CFA in lavaan.
I have a 16 items questionnaire and 92 participants (not so good).
Data are ordinal (items with likert 0 to 4).
Item '9' has no variance: all participants replied '0' on the item (which refers, indeed, to a rather rare occurrence).
Since data were ordinal, I used estimator="DWLS".
However, the model did not converge: "Error in lav_data_full(data = data, group = group, cluster = cluster,  :
lavaan ERROR: some variables have no values (only missings) or no variance".

Is there anything I can do?
Some imputation as in meta-analysis for studies with zero cases, or in penalized regression?

Thank you in advance for your attention.

Antonello


### example of data and codes

dat <- structure(list(ls1 = c(1, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 0,
1, 0, 3, 2, 0, 0, 1, 1, 1, 2, 2, 0, 0, 0, 0, 3, 0, 0, 2, 1, 1,
1, 0, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 3, 0, 0, 3, 2, 0, 0, 0, 0,
0, 0, 1, 0, 0, 2, 0, 1, 1, 0, 2, 0, 0, 0, 0, 0), ls2 = c(1, 1,
1, 0, 0, 0, 1, 0, 0, 2, 0, 0, 0, 3, 0, 2, 1, 0, 1, 1, 0, 0, 1,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 2, 0, 0, 0, 1, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 0, 0, 3,
0, 0, 0, 0, 0, 3, 1, 0, 1, 2, 0, 0, 0, 0, 1, 0, 3, 0, 0, 1, 0,
2, 0, 0, 0, 0, 1), ls3 = c(3, 4, 3, 2, 4, 1, 0, 1, 0, 3, 3, 3,
1, 1, 0, 3, 2, 3, 1, 0, 3, 1, 2, 0, 4, 3, 0, 1, 3, 4, 3, 3, 3,
3, 0, 4, 0, 0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, 0, 0, 0, 0, 2, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0,
2, 3, 1, 0, 0, 0, 0, 1, 4, 0, 0, 1, 0, 2, 0, 1, 1, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 0), ls15 = c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3,
1, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0), ls16 = c(0,
1, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
0, 0, 0, 0, 0, 0, 0)), .Names = c("ls1", "ls2", "ls3", "ls4",
"ls5", "ls6", "ls7", "ls8", "ls9", "ls10", "ls11", "ls12", "ls13",
"ls14", "ls15", "ls16"), class = "data.frame", row.names = 3883:3974)


### check data


dim(dat); head(dat)  


#############################################
### CFA
#############################################

### call the library

library(lavaan)
library(semTools)


#############################################
### modello a 4 fattori correlati
#############################################

Model4<- 'intrusive=~ls1+ls2+ls3
vivid=~ls5+ls6+ls7
audiovisual=~ls4+ls8+ls9+ls10+ls16
multisensory=~ls11+ls12+ls13+ls14+ls15'


fit <- cfa(Model4, data=dat, estimator="DWLS")

summary(fit, fit.measures=TRUE, standardized=TRUE)


reliability(fit)

### sessionInfo()
R version 3.4.1 (2017-06-30)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Italian_Italy.1252  LC_CTYPE=Italian_Italy.1252    LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C                 
[5] LC_TIME=Italian_Italy.1252   

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base    

other attached packages:
[1] semTools_0.4-14    lavaan_0.5-23.1097

loaded via a namespace (and not attached):
[1] compiler_3.4.1 mnormt_1.5-5   pbivnorm_0.6.0 stats4_3.4.1   quadprog_1.5-5


Edward Rigdon

unread,
Nov 18, 2017, 2:25:42 PM11/18/17
to lav...@googlegroups.com
No, there is no fix for a complete lack of variance. Anything you attempt would just be fabricating data. Delete the item if you want to analyze the other observed variables. Sorry.

--
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+unsubscribe@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.

Seongho Bae

unread,
Nov 25, 2017, 7:00:07 AM11/25/17
to lavaan
The 'zero-variance item' maybe not observable behaviour actually. That may too hard to respond to 'Yes'.

Best,
Seongho

2017년 11월 19일 일요일 오전 4시 14분 25초 UTC+9, Antonello Preti 님의 말:
Reply all
Reply to author
Forward
0 new messages