# Chi-square Discriminant Validity Test with Lavaan (R)?

I have a four factor scale that I just finished CFA on, and I was advised to use the chi-square test of differences to check for discriminant validity to reinforce my AVE based test for it. I read here (http://zencaroline.blogspot.com/2007/05/discriminant-validity.html, which cites Bagozzi & Yi, 1991, and an application in Deery, Erwin, and Iverson, 1999) that if I have more than two factors, I need to do this test, pairwise, for each pair of constructs, with one unconstrained regular model and one model with the correlation between the two constructs locked to 1. I /think/ I might understand how to do it (or I could be catastrophically wrong), and I was hoping someone far more veteran at this might be able to confirm for me. One possibility was:

fullmod<-'d1=~x1+x2+x3+x4
d2=~x5+x6+x7
d3=~x8+x9+x10
d4=~x11+x12'
fullunconsmod<-cfa(model=fullmod,data=data)
dvc12<-'d1=~x1+x2+x3+x4 #checking for discriminant validity between dimensions 1 and 2
d2=~1*d1 #make d2 perf corr with d1 in this model
d3=~x8+x9+x10
d4=~x11+x12'
cfacha<-cfa(model=dvc12,data=data)
anova(cfacha,fullunconsmod)

Then so on with the syntax changed as appropriate for dvc13, dvc14, dvc23, dvc24, and dvc34 for the respective dimension pairs. Am I doing this right? I'm extra curious because while the command seems to run, I get the warning: "Warning message: In lavTestLRT(object = , SB.classic = TRUE, : lavaan WARNING: some models are based on a different set of observed variables" and some of the chi square values come out the same.

Another possibility I came up with after reading a LISREL doc and seeing if I can make the syntax match was:

dvc12<-'d1=~x1+x2+x3+x4
d1=~x5+x6+x7       #d1, not d2
d3=~x8+x9+x10
d4=~x11+x12'
cfacha<-cfa(model=dvc12,data=data)
anova(cfacha,fullunconsmod)

And so on for dvc13, 14, 23, 24, and 34. Is this it? Or am I just utterly missing something?

Thank you!

Your first batch of code is not quite right. Your fullunconsmod is not fixing the correlation between d1 and d2 to 1, but rather, is making d2 a second-order factor onto which d1 is exclusively loading, and otherwise, x5 - x7 are dropped from the model. Your code based on the LISREL doc is closer to what you want (though I'm still not sure it will run the way you intend, because you have declared d1 twice, consisting of two different sets of variables that load on to.

There are two ways you could go about specifying this kind of nested model:

1. Fix the correlation between the two factors to 1

So if your full model looks like this:

full.mod = '
d1=~x1+x2+x3+x4
d2=~x5+x6+x7
d3=~x8+x9+x10
d4=~x11+x12
'

Then Option 1. would look like this:

nested.mod.1 = '
d1=~x1+x2+x3+x4
d2=~x5+x6+x7
d3=~x8+x9+x10
d4=~x11+x12

d1 ~~ 1*d2
'

Note that ~~ is the lavaan() syntax for constraining a covariance--not a correlation (by default). To be sure you are fixing the correlation between d1 and d2 to 1, you can either manually fix each variance to 1 (e.g., d1 ~~ 1*d1), or use the std.lv = TRUE option in the CFA command, which will over-ride the marker variable default (which will fix the first loading of each factor to 1).

To do Option 2 is a bit more straightforward--take the variables from d2 and just have them load on d1 instead:

nested.mod.2 = '
d1=~x1+x2+x3+x4+x5+x6+x7
d3=~x8+x9+x10
d4=~x11+x12
'

Each option should yield identical model fit/results when you compare the nested model to the full model.