I feel like I'm missing something basic here. In order to reuse the results of a polychoric correlation in a SEM model, I have to clear the original data set from which the correlation was run. Here's the code, which some of you no doubt recognize, and which works:
polychoric `thevars';
matrix polychR=r(R);
matrix dir;
matlist 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 ; /* here is where I lose the original observations */
ssd init `thevars' ;
ssd set obs `N' ;
ssd set cor `setcor' ;
sem (Y -> `thevars');
I want to do further analysis of the SEM results, which means I have to apply the estimates back on the original observations. I saved the estimates as follows:
estimates save temp, replace;
Then I do the following:
clear;
use original.dta;
estimates use temp;
If I use -sem- without the polychoric correlations, at this point I would use the -predict- command. Here is where I am breaking down. I also could not rerun the SEM model using the estimates as a seed. I admit feeling stupid at this point--this is no doubt simple. What am I missing?
Thanks.
Related Posts with Reusing SEM estimates
Predicting firm growth (panel data)Hi, Statalist. 1. Our task/problem I’m trying to predict if a startup will grow continuously for t…
How to make duplications/ repetitions of observationsHello, I am working with some data on children (siblings) from various households from an Indian pa…
Error Setting/Reshaping a Multiple Imputation DatasetHi everyone, I have several (potentially stupid) questions about multiple imputation. I've tried rea…
Modifying significant digits of the graph's y-axis increments on Stata graph editorHi, I'm trying to edit a graph's y-axis increments on Stata graph editor. For example, the y-axis i…
Autocorrelation heteroskadasicityHi guys, I have a panel data set with 2Ts 500N and 2Ts 30N I use OLS and Fixed effects estimations I…
Subscribe to:
Post Comments (Atom)
0 Response to Reusing SEM estimates
Post a Comment