AVE and CR in lavaan

2,922 views
Skip to first unread message

elenacla...@gmail.com

unread,
Nov 28, 2017, 12:03:33 PM11/28/17
to lavaan
Hello, I need some help on understanding an error that I keep getting.
I am using lavaan to test a model and would like to evaluate the performance of the cfa calculating the average variance extracted (AVE) and composite reliabilty (CR).
From a post on another website I have seen that this should be possible using reliability() of the SemTools package. However, when I apply the reliability command to my model (that works otherwise) I get an error that I am not able to tackle:

Errore in trueitem + erritem : array incompatibili   (incompatible)

Can anyone give me an indication on why I get this error (am I doing something wrong? is there an incompatibility between the packages?) and/or on how to calculate these indices?

Thanks in advance for any help!

Mikko Rönkkö

unread,
Nov 28, 2017, 2:15:40 PM11/28/17
to lav...@googlegroups.com
Hi,

Can you post the R file that produces this error?

Mikko

--
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.

elenacla...@gmail.com

unread,
Nov 30, 2017, 4:44:28 AM11/30/17
to lavaan
Thanks Mikko for the interest in the post.

This is my code:


library(xlsx)
library(lavaan)
library(semPlot)
library(coefficientalpha)
library(psy)
library(semTools)
library(SemPlot)
library(pastecs)

library(corrplot)
library(ggplot2)

data1<-read.xlsx('R_ins2.xlsx', sheetName='Foglio3', header=T)

model1 <- '
  # measurement model
    var1 =~ I2 +I5 + I6
    var2=~  Y1 + Y2 + Y3 + Y4 + Y5 + Y6
    var3=~ C1 + C2 + C3 + C4
    var4=~ T1 + T2 + T3 + T4
    var5=~  H1 + H2 + H3 + H6 + H7+ H9 +I4
    var6=~    AW1 + AW2+  AW3+  X6 + X7 + X8
'
m1_fit <- cfa(model1, data=data1)
summary(m1_fit, standardized=TRUE, rsq=T, fit.measures = TRUE)
reliability(m1_fit)


Thanks,
Elena

Terrence Jorgensen

unread,
Dec 2, 2017, 6:25:43 PM12/2/17
to lavaan
data1<-read.xlsx('R_ins2.xlsx', sheetName='Foglio3', header=T)

model1 <- '
  # measurement model
    var1 =~ I2 +I5 + I6
    var2=~  Y1 + Y2 + Y3 + Y4 + Y5 + Y6
    var3=~ C1 + C2 + C3 + C4
    var4=~ T1 + T2 + T3 + T4
    var5=~  H1 + H2 + H3 + H6 + H7+ H9 +I4
    var6=~    AW1 + AW2+  AW3+  X6 + X7 + X8
'
m1_fit <- cfa(model1, data=data1)
summary(m1_fit, standardized=TRUE, rsq=T, fit.measures = TRUE)
reliability(m1_fit)

You syntax looks fine, but without access to your data, we have no way of knowing what causes the error.  

Make sure you have the latest versions of lavaan and semTools installed, in case this was a bug that was already fixed.

install.packages("lavaan", repos="http://www.da.ugent.be", type="source")
devtools
::install_github("simsem/semTools/semTools")

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


elena ricci

unread,
Dec 6, 2017, 9:32:05 AM12/6/17
to lav...@googlegroups.com
Thanks a lot. I will try updating the packages, as they are not the latest ones, and if it does not work I will bother you again with the data files.

--
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/odMq4r5Qn_Q/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