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
Related Posts with Problem with 11x11 correlation matrix in SEM
Can dummy variables help me to address the problem of unobserved characteristics?I'm analyzing the effect of different categories of expenditures on subjective well-being (SWB). The…
Too Large Wald chi2 StatisticsI am following the work of Acemolug, Restrepo(2020). Trying to figure out the effect of adopting rob…
Creating a variable that is a maximum value of another variable within the same group id var1 var2 var3 1 0 5 1 5 5 1 2 5 2 1 1 How do I create var3 that is the ma…
How to plot the jumping shaded area?Dear Professors, how can I plot the jumping highlighted area in the attached plot? Thanks! Array …
Exposure - days per month with different datesHello, I am using Stata 16.1 MP. I wish to create a monthly exposure variable. This would capture …
Subscribe to:
Post Comments (Atom)
0 Response to Problem with 11x11 correlation matrix in SEM
Post a Comment