[R] CFA and Factor scores from ordered Likert scale items using SEM and Lavaan packages

John Fox jfox at mcmaster.ca
Thu Aug 8 05:35:41 CEST 2013


Dear J?nis,

On Wed, 7 Aug 2013 12:36:11 +0300
 J?nis Mucenieks <mucenieks at gmail.com> wrote:
> Hello!
> I'm trying to do some confirmatory factor analysis with for ordered Likert
> scale items using sem and lavaan packages. So far I have read a lot and
> searched a lot but working example has so far eluded me. Can someone please
> take a look at the data and tell me if what I'm doing is correct (lavaan
> case) and where is the error (sem case)?
> 

. . .

> 
> cfaEI.sem.o <- sem(EI.model.sem.o, R.EI.data, nrow(EI.data))
> summary(cfaEI.sem.o)
> fscores(cfaEI.sem.o, EI.data)
> 
> Error (can't get fscrores):
> Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric

fscores() can't handle ordinal data.

Also, though it's not relevant to this error, you could greatly simplify the model specification by using cfa() instead of specifyModel(). More generally, specifyEquations() is usually more convenient than specifyModel().

Best,
 John

> 
> Thank You!
> Janis
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

------------------------------------------------
John Fox
Sen. William McMaster Prof. of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
http://socserv.mcmaster.ca/jfox/



More information about the R-help mailing list