Hi All,
I am trying to run an SEM model with specified number of observations, means, SDs, and correlation matrix for 11 variables. It appears that Stata cannot handle a correlation matrix with 11 variables in SEM because when I run the syntax, I get the following error message: “matrix not positive semidefinite. One or more numeric values are incorrect because real data can generate only positive semidefinite covariance or correlation matrices. r(459);”
The issue is not about numeric values because I tried many other numbers in the correlation matrix and got the same error message. However, when I reduce the number of variables to 10 and have a 10 by 10 correlation matrix, it runs ok as expected. I appreciate any help.
Here is my entire code:
set more off
clear all
ssd init knsh knut knen knem perform inte soca innov masu trans know
ssd set obs 1520
ssd set means 3.24 4.79 3.82 4.87 3.55 4.72 3.53 4.07 4.01 4.33 3.53
ssd set sd 1.08 1.44 1.09 1.99 1.45 1.98 1.72 0.97 1.86 1.17 1.16
#delimit ;
ssd set corr 1 \
0.96 1 \
0.40 0.52 1 \
0.48 0.63 0.54 1 \
0.46 0.33 0.72 0.28 1 \
0.37 0.77 0.57 0.58 0.23 1 \
0.62 0.63 0.59 0.55 0.39 0.29 1 \
0.55 0.14 0.21 0.70 0.64 0.77 0.46 1 \
0.31 0.27 0.29 0.18 0.36 0.34 0.45 0.30 1 \
0.52 0.39 0.72 0.81 0.33 0.62 0.17 0.45 0.60 1 \
0.43 0.34 0.20 0.47 0.24 0.44 0.68 0.38 0.33 0.46 1;
#delimit cr
ssd describe
ssd list
* RESEARCH MODEL
sem (KS@1 -> knsh) (KU@1 -> knut) (KEnh2@1 -> knen) (KEmbed@1 -> knem) ///
(Performance@1 -> perform) (IT@1 -> inte) (SC@1 -> soca) ///
(Innovation@1 -> innov) (MS@1 -> masu) (TMS@1 -> trans) (K@1 -> know) ///
(IT SC MS -> TMS) (KEnh2 -> K) (IT SC MS TMS -> KEnh2) (IT SC MS TMS K KEnh2 -> KEmbed) (IT SC MS TMS K KEmbed -> KS) ///
(IT SC MS TMS K KS -> KU) (KU -> Perfomance), ///
latent(KS KU KEnh2 KEmbed Performance IT SC Innovation MS TMS K) ///
reliability (knsh .99999 knut .99999 knen .99999 knem .99999 perform .99999 inte .99999 soca .99999 innov .99999 masu .99999 trans .99999 know .99999) ///
covstruct(_lexogenous, unstructured) nocapslatent
estat eqgof
estat gof, stats(all)
estat mindices
0 Response to Problem with 11x11 correlation matrix in SEM
Post a Comment