Hi:
I have been succesful in the past using Stas' Kolenikov -polychoric- in combination with code provided by Joseph Coveney some time ago, to use polychoric correlations before -sem- and -factormat- :
local thevars ..."list of variables goes here"...
polychoric `thevars'
mat polychR = r(R)
forvalues i=1/`: word count `thevars' ' {
forvalues j=1/`i' {
local setcor `setcor' `=polychR[`i',`j']'
}
if `i' < `: word count `thevars' ' local setcor `setcor' \
}
local N = _N
clear
ssd init `thevars'
ssd set obs `N'
ssd set cor `setcor'
..."sem or factormat with options start here..."
I have been asked to analyze 96 variables and a very complex model, and I get an error when running the last line of the code (ssd set cor `setcor'):
matrix not positive semidefinite
One or more numeric values are incorrect because real data can generate only positive semidefinite
covariance or correlation matrices.
The dataset has no missing values, and when I previously split the variables in two blocks (because the variables are part of two different questionnaires) I had no problem at all.
Mystified.
Marta
I have been succesful in the past using Stas' Kolenikov -polychoric- in combination with code provided by Joseph Coveney some time ago, to use polychoric correlations before -sem- and -factormat- :
local thevars ..."list of variables goes here"...
polychoric `thevars'
mat polychR = r(R)
forvalues i=1/`: word count `thevars' ' {
forvalues j=1/`i' {
local setcor `setcor' `=polychR[`i',`j']'
}
if `i' < `: word count `thevars' ' local setcor `setcor' \
}
local N = _N
clear
ssd init `thevars'
ssd set obs `N'
ssd set cor `setcor'
..."sem or factormat with options start here..."
I have been asked to analyze 96 variables and a very complex model, and I get an error when running the last line of the code (ssd set cor `setcor'):
matrix not positive semidefinite
One or more numeric values are incorrect because real data can generate only positive semidefinite
covariance or correlation matrices.
The dataset has no missing values, and when I previously split the variables in two blocks (because the variables are part of two different questionnaires) I had no problem at all.
Mystified.
Marta
Comment