I'm finding that the strengths of Mplus and Stata work synergistically together and compliment each other to compute FA,CFA, ESEM and CSEM analyses based on two split half samples of 351,000 patients and 97 variables.
I'm using my Stata 13.1 perpetual hex core license.
Mplus has successfully written out into a covs.txt files variance co-variance matrices based on (1) Bayes or (2) Expectation Maximization estimators, each a 30 hour run. I can study PSR and trace plots for each MCMC chain to asses convergence and stability.
I have also run these estimators in Stata, but I don't have the ability (available in Mplus) to graphically study MCMC chain mixing and examine possibly problematic estimates of covariances and variances.
The frustration is that Mplus cannot compute EFA or ESEM analysis with the ML estimator on a variance - covariance matrix; a correlation matrix is required!
Factormat in Stata will compute a FA with a variance-covariance matrix input (aka covariance matrix input) . However, Factormat requires that my covariance matrix be placed into a Stata conformable matrix for read in.
An advantage Stata has, is that I can display eigen values, eigen vectors, the determinant, and assess whether the matrix is positive definite. And subsequently combine collinear variables with principal components analysis.
The Mplus covs.txt file contains 4656 elements with a white space, probably tab, delimiter. It can be seen as a lower triangle matrix with 97 variances in the diagonal and 4559 off diagonal covariances. The file can be read into the Stata editor row - wise starting from left, going to the to right, and then moving down rows starting at the top and ending at the bottom. I've used the import command. I suspect that using the data editor is not necessarily the best way to solve the problem.
The Stata editor displays the data as six columns all as V1 (variable 1)
The covariance input can also be seen as a singly dimensioned vector of 4656 elements.
The question is: How do I read in the .txt file and produce in Stata a lower triangle covariance matrix, say matrix Covs?
I suspect one solution is to use the mkmat command, but I don't yet see a way to give it the proper arguments to make the matrix I want.
Factormat allows me to add names to the matrix, once I have built the matrix Covs.
Also, I have used the _getcovcorr command with other commands to change the covariance matrix into a correlation matrix successfully.
Thanks to the Statalist team for strategy suggestions and code suggestions; I'll post the final code we arrive at.
I'm using my Stata 13.1 perpetual hex core license.
Mplus has successfully written out into a covs.txt files variance co-variance matrices based on (1) Bayes or (2) Expectation Maximization estimators, each a 30 hour run. I can study PSR and trace plots for each MCMC chain to asses convergence and stability.
I have also run these estimators in Stata, but I don't have the ability (available in Mplus) to graphically study MCMC chain mixing and examine possibly problematic estimates of covariances and variances.
The frustration is that Mplus cannot compute EFA or ESEM analysis with the ML estimator on a variance - covariance matrix; a correlation matrix is required!
Factormat in Stata will compute a FA with a variance-covariance matrix input (aka covariance matrix input) . However, Factormat requires that my covariance matrix be placed into a Stata conformable matrix for read in.
An advantage Stata has, is that I can display eigen values, eigen vectors, the determinant, and assess whether the matrix is positive definite. And subsequently combine collinear variables with principal components analysis.
The Mplus covs.txt file contains 4656 elements with a white space, probably tab, delimiter. It can be seen as a lower triangle matrix with 97 variances in the diagonal and 4559 off diagonal covariances. The file can be read into the Stata editor row - wise starting from left, going to the to right, and then moving down rows starting at the top and ending at the bottom. I've used the import command. I suspect that using the data editor is not necessarily the best way to solve the problem.
The Stata editor displays the data as six columns all as V1 (variable 1)
The covariance input can also be seen as a singly dimensioned vector of 4656 elements.
The question is: How do I read in the .txt file and produce in Stata a lower triangle covariance matrix, say matrix Covs?
I suspect one solution is to use the mkmat command, but I don't yet see a way to give it the proper arguments to make the matrix I want.
Factormat allows me to add names to the matrix, once I have built the matrix Covs.
Also, I have used the _getcovcorr command with other commands to change the covariance matrix into a correlation matrix successfully.
Thanks to the Statalist team for strategy suggestions and code suggestions; I'll post the final code we arrive at.
Comment