Hi all,
I am running some SEM models and would like to store/save some values from the output table as scalars. I know how to extract the coefficients and standard error (by using _b and _se). But how to extract some other value, such as z value, p value, and confidence interval values?
For example, I used the code below
Then I got the output. How to exact the values highlighted in red? Can anyone help me?
I am running some SEM models and would like to store/save some values from the output table as scalars. I know how to extract the coefficients and standard error (by using _b and _se). But how to extract some other value, such as z value, p value, and confidence interval values?
For example, I used the code below
Code:
use https://stats.idre.ucla.edu/stat/data/hsb2, clear rename science y /* dependent variable */ rename math x /* independent variable */ rename read m /* mediator variable */ rename write w /* moderator variable 1 */ rename socst z /* moderator variable 2 */ generate mx=m*x /* mv by iv interaction */ sem (m <- x)(y <- m x mx)
Code:
------------------------------------------------------------------------------ | OIM | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- Structural | m | x | .724807 .0579824 12.50 0.000 .6111636 .8384504 _cons | 14.07254 3.100201 4.54 0.000 7.996255 20.14882 -----------+---------------------------------------------------------------- y | m | .9766164 .2875081 3.40 0.001 .4131109 1.540122 x | 1.03094 .2969707 3.47 0.001 .4488881 1.612992 mx | -.0115869 .0053091 -2.18 0.029 -.0219926 -.0011812 _cons | -20.83921 15.16952 -1.37 0.170 -50.57092 8.892495 -------------+---------------------------------------------------------------- var(e.m)| 58.71925 5.871925 48.26811 71.43329 var(e.y)| 49.70994 4.970994 40.86232 60.47326 ------------------------------------------------------------------------------ LR test of model vs. saturated: chi2(1) = 594.37, Prob > chi2 = 0.0000
Comment