I was eager to know how to modelling latent interactions for structural equation models in lavaan. There is this lavaan google group https://groups.google.com/forum/#!forum/lavaan where one can find a lot of comments by searching for “latent interactions”. Basicly there is one paper from Mash (2004) and one from Lin (2010) explaining the methods in detail. Inspired by https://rpubs.com/mkearney/103098 (data not available) I compiled a script summarizing the methods developed by Marsh (2004) and Lin (2010) by using the
See http://rpubs.com/candrea/latintsem .
Fit values for a CFA with a single factor can only be computed with models with more than 3 observed variables. With 3 obeserved variables and one factor you have to compute 6 free parameters (with one fixed). But your covariance matrix has also 6 nonredundant elements. Hence you get df=0 degress of freedom. A chi-squared distribution with df=0 is constant 0, hence we can expect the test statistic to be 0.
CFA single factor
In the PISA 2012 Technical Report on page 312 (chapter 16), the formula (16.3) for the Partial Credit Model is printed for computing scale parameters. Looking at it twice, one can see that something must be wrong with the subscribs used for the sumations.
By consulting the chapter “Polytomous Rasch Models and their Estimation” in the book “Rasch Models” (Fischer, 1995), and combining the formulas (15.3) with (15.8) there, we get
Now by comparing the meaning of all the symbols and applying it on the formula from PISA Technical Report – by respecting as much as possible of the notations used by them – we get
We see that we have to change in the numerator of the very first formula above to , and to .
That makes sense!
First of all see the excellent installation manual by Martyn Plummer and Bill Northcott (JAGS Version 3.4.0 installation manual) at section 2 “Mac OS X”.
For the rest of us (me included) thinking ./configure without any options will do the job are getting the following error:
configure: error: "You need to install the LAPACK library"
(It will not work even with the –with-lapack=’-framework vecLib’ option.)
Do not follow this instruction! You do not have to install the LAPACK library because on OS X 10.9 the optimized (accelerated by Apple engineers) version of LAPACK is allready installed, see the LAPACK(7) Mac OS X Manual Page.
From now on just type the slightly modified commands in your bash-shell (terminal):
export CFLAGS="-g -Os -mmacosx-version-min=10.6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -arch i386 -arch x86_64"
export CXXFLAGS="-g -Os -mmacosx-version-min=10.6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -arch i386 -arch x86_64"
export FFLAGS="-g -Os -mmacosx-version-min=10.6 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -arch i386 -arch x86_64"
export LDFLAGS="-mmacosx-version-min=10.6 -arch i386 -arch x86_64"
./configure --disable-dependency-tracking --with-included-ltdl
make -j 8
sudo make install
Of course, make sure you have installed all the required tools before executing the commands.