Hi, I run a sem model and after it the medsem command. I am used to save estimates or other information in matrix. Nevertheless, I struggle to save what I need in a matrix after medsem.
. sem (track <- genere status g8_year escs Test exam)(Test -> test_mat test_ita) (exam <- escs) (Test <- escs) (exam <- Test) , cov(e.test_mat e.test_ita) stand
Endogenous variables
Observed: track exam
Measurement: test_mat test_ita
Latent: Test
Exogenous variables
Observed: genere status g8_year escs
Fitting target model:
Iteration 0: log likelihood = -24211512 (not concave)
Iteration 1: log likelihood = -22875775
Iteration 2: log likelihood = -22763706
Iteration 3: log likelihood = -22438590
Iteration 4: log likelihood = -22232191 (not concave)
Iteration 5: log likelihood = -22218698
Iteration 6: log likelihood = -22218385
Iteration 7: log likelihood = -22201595
Iteration 8: log likelihood = -22200426
Iteration 9: log likelihood = -22196191 (not concave)
Iteration 10: log likelihood = -22195964
Iteration 11: log likelihood = -22195452
Iteration 12: log likelihood = -22193869 (not concave)
Iteration 13: log likelihood = -22193788
Iteration 14: log likelihood = -22193619
Iteration 15: log likelihood = -22192947
Iteration 16: log likelihood = -22192825
Iteration 17: log likelihood = -22192595 (not concave)
Iteration 18: log likelihood = -22192586
Iteration 19: log likelihood = -22192529
Iteration 20: log likelihood = -22192453
Iteration 21: log likelihood = -22192441
Iteration 22: log likelihood = -22192440
Iteration 23: log likelihood = -22192439
Iteration 24: log likelihood = -22192439
Iteration 25: log likelihood = -22192439
Structural equation model Number of obs = 1,390,094
Estimation method = ml
Log likelihood = -22192439
( 1) [track]Test = 1
--------------------------------------------------------------------------------
| OIM
Standardized | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
Structural |
track |
exam | .3215363 .0009896 324.92 0.000 .3195967 .3234758
Test | .0948188 .0033013 28.72 0.000 .0883485 .1012891
genere | .1867788 .0007195 259.58 0.000 .1853686 .1881891
status | -.032329 .0007326 -44.13 0.000 -.0337648 -.0308932
g8_year | .0044418 .0007263 6.12 0.000 .0030183 .0058653
escs | .2065371 .0007388 279.55 0.000 .2050891 .2079852
_cons | -5.706288 1.110743 -5.14 0.000 -7.883304 -3.529271
-------------+----------------------------------------------------------------
exam |
Test | .5950091 .000676 880.24 0.000 .5936842 .5963339
escs | .1242635 .0007211 172.32 0.000 .1228501 .1256769
_cons | -7.74e-09 .0008181 -0.00 1.000 -.0016035 .0016035
-------------+----------------------------------------------------------------
Test |
escs | .2344724 .0008851 264.90 0.000 .2327375 .2362072
---------------+----------------------------------------------------------------
Measurement |
test_mat |
Test | .7625226 .0005642 1351.49 0.000 .7614168 .7636284
_cons | 4.935014 .0030737 1605.58 0.000 4.928989 4.941038
-------------+----------------------------------------------------------------
test_ita |
Test | .8658559 .0005414 1599.30 0.000 .8647947 .866917
_cons | 5.271815 .0032664 1613.97 0.000 5.265413 5.278217
---------------+----------------------------------------------------------------
var(e.track)| .7257198 .0006177 .7245102 .7269315
var(e.exam)| .59585 .0007703 .5943421 .5973617
var(e.test_mat)| .4185593 .0008604 .4168763 .4202491
var(e.test_ita)| .2502936 .0009375 .2484628 .2521379
var(e.Test)| .9450227 .0004151 .9442095 .9458366
--------------------------------------------------------------------------------
Then, I run medsem:
. medsem, indep(escs) med(Test) dep(track) mcreps(5000) rit rid
Significance testing of indirect effect (unstandardised)
+--------------------------------------------------------------------------+
Estimates | Delta | Sobel | Monte Carlo*
|--------------------------------------------------------------------------|
Indirect effect | 0.011 | 0.011 | 0.011
Std. Err. | 0.000 | 0.000 | 0.000
z-value | 81.870 | 81.870 | 81.868
p-value | 0.000 | 0.000 | 0.000
Conf. Interval | 0.011 , 0.011 | 0.011 , 0.011 | 0.011 , 0.011
|--------------------------------------------------------------------------|
*You typed in mcreps < #of obs, your mcreps is however set to #of obs!
Baron and Kenny approach to testing mediation
STEP 1 - Test:escs (X -> M) with B=0.011 and p=0.000
STEP 2 - track:Test (M -> Y) with B=1.000 and p=.
As either STEP 1 or STEP 2 (or both) are not significant,
there is no mediation!
RIT = (Indirect effect / Total effect)
(0.011 / 0.112) = 0.097
Meaning that about 10 % of the effect of escs
on track is mediated by Test!
RID = (Indirect effect / Direct effect)
(0.011 / 0.101) = 0.108
That is, the mediated effect is about 0.1 times as
large as the direct effect of escs on track!
+--------------------------------------------------------------------------+
Note: to read more about this package help medsem
My question: How can I access to stored information of medsem? For instance, p-value or z-value.
. sem (track <- genere status g8_year escs Test exam)(Test -> test_mat test_ita) (exam <- escs) (Test <- escs) (exam <- Test) , cov(e.test_mat e.test_ita) stand
Endogenous variables
Observed: track exam
Measurement: test_mat test_ita
Latent: Test
Exogenous variables
Observed: genere status g8_year escs
Fitting target model:
Iteration 0: log likelihood = -24211512 (not concave)
Iteration 1: log likelihood = -22875775
Iteration 2: log likelihood = -22763706
Iteration 3: log likelihood = -22438590
Iteration 4: log likelihood = -22232191 (not concave)
Iteration 5: log likelihood = -22218698
Iteration 6: log likelihood = -22218385
Iteration 7: log likelihood = -22201595
Iteration 8: log likelihood = -22200426
Iteration 9: log likelihood = -22196191 (not concave)
Iteration 10: log likelihood = -22195964
Iteration 11: log likelihood = -22195452
Iteration 12: log likelihood = -22193869 (not concave)
Iteration 13: log likelihood = -22193788
Iteration 14: log likelihood = -22193619
Iteration 15: log likelihood = -22192947
Iteration 16: log likelihood = -22192825
Iteration 17: log likelihood = -22192595 (not concave)
Iteration 18: log likelihood = -22192586
Iteration 19: log likelihood = -22192529
Iteration 20: log likelihood = -22192453
Iteration 21: log likelihood = -22192441
Iteration 22: log likelihood = -22192440
Iteration 23: log likelihood = -22192439
Iteration 24: log likelihood = -22192439
Iteration 25: log likelihood = -22192439
Structural equation model Number of obs = 1,390,094
Estimation method = ml
Log likelihood = -22192439
( 1) [track]Test = 1
--------------------------------------------------------------------------------
| OIM
Standardized | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
Structural |
track |
exam | .3215363 .0009896 324.92 0.000 .3195967 .3234758
Test | .0948188 .0033013 28.72 0.000 .0883485 .1012891
genere | .1867788 .0007195 259.58 0.000 .1853686 .1881891
status | -.032329 .0007326 -44.13 0.000 -.0337648 -.0308932
g8_year | .0044418 .0007263 6.12 0.000 .0030183 .0058653
escs | .2065371 .0007388 279.55 0.000 .2050891 .2079852
_cons | -5.706288 1.110743 -5.14 0.000 -7.883304 -3.529271
-------------+----------------------------------------------------------------
exam |
Test | .5950091 .000676 880.24 0.000 .5936842 .5963339
escs | .1242635 .0007211 172.32 0.000 .1228501 .1256769
_cons | -7.74e-09 .0008181 -0.00 1.000 -.0016035 .0016035
-------------+----------------------------------------------------------------
Test |
escs | .2344724 .0008851 264.90 0.000 .2327375 .2362072
---------------+----------------------------------------------------------------
Measurement |
test_mat |
Test | .7625226 .0005642 1351.49 0.000 .7614168 .7636284
_cons | 4.935014 .0030737 1605.58 0.000 4.928989 4.941038
-------------+----------------------------------------------------------------
test_ita |
Test | .8658559 .0005414 1599.30 0.000 .8647947 .866917
_cons | 5.271815 .0032664 1613.97 0.000 5.265413 5.278217
---------------+----------------------------------------------------------------
var(e.track)| .7257198 .0006177 .7245102 .7269315
var(e.exam)| .59585 .0007703 .5943421 .5973617
var(e.test_mat)| .4185593 .0008604 .4168763 .4202491
var(e.test_ita)| .2502936 .0009375 .2484628 .2521379
var(e.Test)| .9450227 .0004151 .9442095 .9458366
--------------------------------------------------------------------------------
Then, I run medsem:
. medsem, indep(escs) med(Test) dep(track) mcreps(5000) rit rid
Significance testing of indirect effect (unstandardised)
+--------------------------------------------------------------------------+
Estimates | Delta | Sobel | Monte Carlo*
|--------------------------------------------------------------------------|
Indirect effect | 0.011 | 0.011 | 0.011
Std. Err. | 0.000 | 0.000 | 0.000
z-value | 81.870 | 81.870 | 81.868
p-value | 0.000 | 0.000 | 0.000
Conf. Interval | 0.011 , 0.011 | 0.011 , 0.011 | 0.011 , 0.011
|--------------------------------------------------------------------------|
*You typed in mcreps < #of obs, your mcreps is however set to #of obs!
Baron and Kenny approach to testing mediation
STEP 1 - Test:escs (X -> M) with B=0.011 and p=0.000
STEP 2 - track:Test (M -> Y) with B=1.000 and p=.
As either STEP 1 or STEP 2 (or both) are not significant,
there is no mediation!
RIT = (Indirect effect / Total effect)
(0.011 / 0.112) = 0.097
Meaning that about 10 % of the effect of escs
on track is mediated by Test!
RID = (Indirect effect / Direct effect)
(0.011 / 0.101) = 0.108
That is, the mediated effect is about 0.1 times as
large as the direct effect of escs on track!
+--------------------------------------------------------------------------+
Note: to read more about this package help medsem
My question: How can I access to stored information of medsem? For instance, p-value or z-value.