Hello everyone,
Thank you in advance for taking the time to read my question and provide your valuable feedback.
I am currently conducting a path analysis using the sem command in Stata, and I am using estat teffects to estimate indirect effects. For categorical variables with three or more categories, I have created and included dichotomous dummy variables.
Below are the details of the variables included in the model:
Results:
Questions:
SEM Command
Could you please check whether the command is appropriate for the model? Should I include anything additional at the end of the command?
Identifying the Mediator
In the indirect effects, I found that burden_2015 has a significant indirect effect on phq2_cont_2017_new (coefficient = 0.024, p = 0.036). I would like to confirm how to identify the mediator responsible for this effect.
I am currently interpreting pp_sumscore_2015 as the mediator, because:
Can I obtain bootstrapped standard errors and confidence intervals when using survey weights in sem? If not, are there recommended alternative approaches to estimate robust standard errors or validate indirect effects under complex survey designs?
Thank you very much!
Thank you in advance for taking the time to read my question and provide your valuable feedback.
I am currently conducting a path analysis using the sem command in Stata, and I am using estat teffects to estimate indirect effects. For categorical variables with three or more categories, I have created and included dichotomous dummy variables.
Below are the details of the variables included in the model:
- Independent variables: black_dummy_2015 (dichotomous), others_dummy_2015 (dichotomous), burden_2015 (continuous)
- Presumed mediators: pp_sumscore_2015 (continuous), fu_sumscore_2015 (continuous)
- Dependent variable: phq2_cont_2017_new (continuous)
- Covariates: age_2015 (continuous), gender_2015 (dichotomous), income_middle_dummy_2015 (dichotomous), income_highest_dummy_2015 (dichotomous), education_nodegree_dummy_2015 (dichotomous), education_degree_dummy_2015 (dichotomous), martstat_2015 (dichotomous)
Code:
svyset lc7varunit [pweight=lw7cgfinwgt0], strata(lc7varstrat) singleunit(centered)
Code:
svy, subpop(if lfl7spdied == -1 & dementia == 1): sem (pp_sumscore_2015 <- black_dummy_2015 others_dummy_2015 burden_2015 age_2015 gender_2015 income_middle_dummy_2015 income_highest_dummy_2015 education_nodegree_dummy_2015 education_degree_dummy_2015 martstat_2015) (fu_sumscore_2015 <- black_dummy_2015 others_dummy_2015 burden_2015 age_2015 gender_2015 income_middle_dummy_2015 income_highest_dummy_2015 education_nodegree_dummy_2015 education_degree_dummy_2015 martstat_2015) (phq2_cont_2017_new <- pp_sumscore_2015 fu_sumscore_2015 black_dummy_2015 others_dummy_2015 burden_2015 age_2015 gender_2015 income_middle_dummy_2015 income_highest_dummy_2015 education_nodegree_dummy_2015 education_degree_dummy_2015 martstat_2015)
Code:
estat teffects
Code:
(running sem on estimation sample)
Survey: Structural equation model Number of obs = 1,331
Number of strata = 50 Population size = 18,912,604
Number of PSUs = 100 Subpop. no. obs = 307
Subpop. size = 3,361,659
Design df = 50
--------------------------------------------------------------------------------------------------
| Linearized
| Coefficient std. err. t P>|t| [95% conf. interval]
---------------------------------+----------------------------------------------------------------
Structural |
pp_sumscore_2015 |
black_dummy_2015 | .0890687 .1622231 0.55 0.585 -.236766 .4149034
others_dummy_2015 | -.0678564 .1954167 -0.35 0.730 -.4603625 .3246497
burden_2015 | -.1318287 .0613242 -2.15 0.036 -.255002 -.0086554
age_2015 | -.0020395 .0095503 -0.21 0.832 -.0212218 .0171428
gender_2015 | -.0381159 .1653286 -0.23 0.819 -.3701881 .2939564
income_middle_dummy_2015 | .3006744 .1805747 1.67 0.102 -.0620206 .6633694
income_highest_dummy_2015 | .7721241 .2168201 3.56 0.001 .3366282 1.20762
education_nodegree_dummy_2015 | .2559932 .2198835 1.16 0.250 -.1856558 .6976422
education_degree_dummy_2015 | .4560645 .2278168 2.00 0.051 -.001519 .9136481
martstat_2015 | .1020298 .2028707 0.50 0.617 -.305448 .5095077
_cons | 1.734164 .7383076 2.35 0.023 .2512293 3.217098
-------------------------------+----------------------------------------------------------------
fu_sumscore_2015 |
black_dummy_2015 | .1452391 .194036 0.75 0.458 -.2444936 .5349718
others_dummy_2015 | .0041426 .186676 0.02 0.982 -.3708073 .3790925
burden_2015 | .0227331 .0358777 0.63 0.529 -.0493294 .0947957
age_2015 | -.0040217 .0102904 -0.39 0.698 -.0246905 .0166472
gender_2015 | -.1689776 .1376654 -1.23 0.225 -.4454866 .1075314
income_middle_dummy_2015 | -.2985394 .183688 -1.63 0.110 -.6674877 .0704088
income_highest_dummy_2015 | -.1653101 .2074005 -0.80 0.429 -.5818862 .2512659
education_nodegree_dummy_2015 | -.0511278 .1695507 -0.30 0.764 -.3916805 .2894249
education_degree_dummy_2015 | .0996999 .1868298 0.53 0.596 -.2755588 .4749585
martstat_2015 | .4277025 .1346669 3.18 0.003 .157216 .6981889
_cons | 2.569397 .8823147 2.91 0.005 .7972161 4.341579
-------------------------------+----------------------------------------------------------------
phq2_cont_2017_new |
pp_sumscore_2015 | -.1607076 .0761298 -2.11 0.040 -.3136189 -.0077963
fu_sumscore_2015 | .1191574 .0975704 1.22 0.228 -.0768186 .3151334
black_dummy_2015 | -.4628109 .2232893 -2.07 0.043 -.9113005 -.0143212
others_dummy_2015 | -.2291025 .254611 -0.90 0.373 -.7405037 .2822987
burden_2015 | .0881379 .0820378 1.07 0.288 -.0766399 .2529157
age_2015 | .0083752 .0081676 1.03 0.310 -.0080298 .0247803
gender_2015 | .2038285 .1985 1.03 0.309 -.1948705 .6025275
income_middle_dummy_2015 | -.546194 .2274959 -2.40 0.020 -1.003133 -.089255
income_highest_dummy_2015 | -.2334033 .2455575 -0.95 0.346 -.7266201 .2598134
education_nodegree_dummy_2015 | -.3359974 .1884359 -1.78 0.081 -.714482 .0424873
education_degree_dummy_2015 | -.4722006 .2146012 -2.20 0.032 -.9032397 -.0411614
martstat_2015 | .084321 .230182 0.37 0.716 -.3780132 .5466551
_cons | 2.729005 .7229281 3.77 0.000 1.276962 4.181049
---------------------------------+----------------------------------------------------------------
var(e.pp_sumscore_2015)| 1.214646 .1007481 1.028245 1.434837
var(e.fu_sumscore_2015)| .8172417 .0808846 .6699094 .9969766
var(e.phq2_cont_2017_new)| 1.507177 .188914 1.171728 1.93866
--------------------------------------------------------------------------------------------------
Code:
Direct effects
--------------------------------------------------------------------------------------------------
| Linearized
| Coefficient std. err. t P>|t| [95% conf. interval]
---------------------------------+----------------------------------------------------------------
Structural |
pp_sumscore_2015 |
black_dummy_2015 | .0890687 .1622231 0.55 0.585 -.236766 .4149034
others_dummy_2015 | -.0678564 .1954167 -0.35 0.730 -.4603625 .3246497
burden_2015 | -.1318287 .0613242 -2.15 0.036 -.255002 -.0086554
age_2015 | -.0020395 .0095503 -0.21 0.832 -.0212218 .0171428
gender_2015 | -.0381159 .1653286 -0.23 0.819 -.3701881 .2939564
income_middle_dummy_2015 | .3006744 .1805747 1.67 0.102 -.0620206 .6633694
income_highest_dummy_2015 | .7721241 .2168201 3.56 0.001 .3366282 1.20762
education_nodegree_dummy_2015 | .2559932 .2198835 1.16 0.250 -.1856558 .6976422
education_degree_dummy_2015 | .4560645 .2278168 2.00 0.051 -.001519 .9136481
martstat_2015 | .1020298 .2028707 0.50 0.617 -.305448 .5095077
-------------------------------+----------------------------------------------------------------
fu_sumscore_2015 |
black_dummy_2015 | .1452391 .194036 0.75 0.458 -.2444936 .5349718
others_dummy_2015 | .0041426 .186676 0.02 0.982 -.3708073 .3790925
burden_2015 | .0227331 .0358777 0.63 0.529 -.0493294 .0947957
age_2015 | -.0040217 .0102904 -0.39 0.698 -.0246905 .0166472
gender_2015 | -.1689776 .1376654 -1.23 0.225 -.4454866 .1075314
income_middle_dummy_2015 | -.2985394 .183688 -1.63 0.110 -.6674877 .0704088
income_highest_dummy_2015 | -.1653101 .2074005 -0.80 0.429 -.5818862 .2512659
education_nodegree_dummy_2015 | -.0511278 .1695507 -0.30 0.764 -.3916805 .2894249
education_degree_dummy_2015 | .0996999 .1868298 0.53 0.596 -.2755588 .4749585
martstat_2015 | .4277025 .1346669 3.18 0.003 .157216 .6981889
-------------------------------+----------------------------------------------------------------
phq2_cont_2017_new |
pp_sumscore_2015 | -.1607076 .0761298 -2.11 0.040 -.3136189 -.0077963
fu_sumscore_2015 | .1191574 .0975704 1.22 0.228 -.0768186 .3151334
black_dummy_2015 | -.4628109 .2232893 -2.07 0.043 -.9113005 -.0143212
others_dummy_2015 | -.2291025 .254611 -0.90 0.373 -.7405037 .2822987
burden_2015 | .0881379 .0820378 1.07 0.288 -.0766399 .2529157
age_2015 | .0083752 .0081676 1.03 0.310 -.0080298 .0247803
gender_2015 | .2038285 .1985 1.03 0.309 -.1948705 .6025275
income_middle_dummy_2015 | -.546194 .2274959 -2.40 0.020 -1.003133 -.089255
income_highest_dummy_2015 | -.2334033 .2455575 -0.95 0.346 -.7266201 .2598134
education_nodegree_dummy_2015 | -.3359974 .1884359 -1.78 0.081 -.714482 .0424873
education_degree_dummy_2015 | -.4722006 .2146012 -2.20 0.032 -.9032397 -.0411614
martstat_2015 | .084321 .230182 0.37 0.716 -.3780132 .5466551
--------------------------------------------------------------------------------------------------
Indirect effects
--------------------------------------------------------------------------------------------------
| Linearized
| Coefficient std. err. t P>|t| [95% conf. interval]
---------------------------------+----------------------------------------------------------------
Structural |
pp_sumscore_2015 |
black_dummy_2015 | 0 (no path)
others_dummy_2015 | 0 (no path)
burden_2015 | 0 (no path)
age_2015 | 0 (no path)
gender_2015 | 0 (no path)
income_middle_dummy_2015 | 0 (no path)
income_highest_dummy_2015 | 0 (no path)
education_nodegree_dummy_2015 | 0 (no path)
education_degree_dummy_2015 | 0 (no path)
martstat_2015 | 0 (no path)
-------------------------------+----------------------------------------------------------------
fu_sumscore_2015 |
black_dummy_2015 | 0 (no path)
others_dummy_2015 | 0 (no path)
burden_2015 | 0 (no path)
age_2015 | 0 (no path)
gender_2015 | 0 (no path)
income_middle_dummy_2015 | 0 (no path)
income_highest_dummy_2015 | 0 (no path)
education_nodegree_dummy_2015 | 0 (no path)
education_degree_dummy_2015 | 0 (no path)
martstat_2015 | 0 (no path)
-------------------------------+----------------------------------------------------------------
phq2_cont_2017_new |
pp_sumscore_2015 | 0 (no path)
fu_sumscore_2015 | 0 (no path)
black_dummy_2015 | .0029923 .037042 0.08 0.936 -.0714087 .0773933
others_dummy_2015 | .0113987 .036488 0.31 0.756 -.0618896 .0846869
burden_2015 | .0238947 .011058 2.16 0.036 .001684 .0461054 ***********
age_2015 | -.0001515 .0016694 -0.09 0.928 -.0035045 .0032016
gender_2015 | -.0140094 .0328601 -0.43 0.672 -.0800109 .0519921
income_middle_dummy_2015 | -.0838938 .0579556 -1.45 0.154 -.2003011 .0325134
income_highest_dummy_2015 | -.1437841 .077325 -1.86 0.069 -.2990959 .0115277
education_nodegree_dummy_2015 | -.0472323 .0412695 -1.14 0.258 -.1301245 .0356598
education_degree_dummy_2015 | -.0614131 .0541666 -1.13 0.262 -.1702099 .0473838
martstat_2015 | .0345669 .0576572 0.60 0.552 -.0812409 .1503747
--------------------------------------------------------------------------------------------------
Total effects
--------------------------------------------------------------------------------------------------
| Linearized
| Coefficient std. err. t P>|t| [95% conf. interval]
---------------------------------+----------------------------------------------------------------
Structural |
pp_sumscore_2015 |
black_dummy_2015 | .0890687 .1622231 0.55 0.585 -.236766 .4149034
others_dummy_2015 | -.0678564 .1954167 -0.35 0.730 -.4603625 .3246497
burden_2015 | -.1318287 .0613242 -2.15 0.036 -.255002 -.0086554
age_2015 | -.0020395 .0095503 -0.21 0.832 -.0212218 .0171428
gender_2015 | -.0381159 .1653286 -0.23 0.819 -.3701881 .2939564
income_middle_dummy_2015 | .3006744 .1805747 1.67 0.102 -.0620206 .6633694
income_highest_dummy_2015 | .7721241 .2168201 3.56 0.001 .3366282 1.20762
education_nodegree_dummy_2015 | .2559932 .2198835 1.16 0.250 -.1856558 .6976422
education_degree_dummy_2015 | .4560645 .2278168 2.00 0.051 -.001519 .9136481
martstat_2015 | .1020298 .2028707 0.50 0.617 -.305448 .5095077
-------------------------------+----------------------------------------------------------------
fu_sumscore_2015 |
black_dummy_2015 | .1452391 .194036 0.75 0.458 -.2444936 .5349718
others_dummy_2015 | .0041426 .186676 0.02 0.982 -.3708073 .3790925
burden_2015 | .0227331 .0358777 0.63 0.529 -.0493294 .0947957
age_2015 | -.0040217 .0102904 -0.39 0.698 -.0246905 .0166472
gender_2015 | -.1689776 .1376654 -1.23 0.225 -.4454866 .1075314
income_middle_dummy_2015 | -.2985394 .183688 -1.63 0.110 -.6674877 .0704088
income_highest_dummy_2015 | -.1653101 .2074005 -0.80 0.429 -.5818862 .2512659
education_nodegree_dummy_2015 | -.0511278 .1695507 -0.30 0.764 -.3916805 .2894249
education_degree_dummy_2015 | .0996999 .1868298 0.53 0.596 -.2755588 .4749585
martstat_2015 | .4277025 .1346669 3.18 0.003 .157216 .6981889
-------------------------------+----------------------------------------------------------------
phq2_cont_2017_new |
pp_sumscore_2015 | -.1607076 .0761298 -2.11 0.040 -.3136189 -.0077963
fu_sumscore_2015 | .1191574 .0975704 1.22 0.228 -.0768186 .3151334
black_dummy_2015 | -.4598186 .2224514 -2.07 0.044 -.9066253 -.0130119
others_dummy_2015 | -.2177038 .2609541 -0.83 0.408 -.7418456 .306438
burden_2015 | .1120326 .0817759 1.37 0.177 -.0522192 .2762844
age_2015 | .0082238 .0084607 0.97 0.336 -.00877 .0252176
gender_2015 | .1898191 .2000359 0.95 0.347 -.2119649 .5916031
income_middle_dummy_2015 | -.6300879 .2394865 -2.63 0.011 -1.111111 -.149065
income_highest_dummy_2015 | -.3771875 .2564108 -1.47 0.148 -.8922037 .1378287
education_nodegree_dummy_2015 | -.3832297 .198443 -1.93 0.059 -.7818143 .0153549
education_degree_dummy_2015 | -.5336136 .2122434 -2.51 0.015 -.959917 -.1073103
martstat_2015 | .1188879 .2173001 0.55 0.587 -.3175723 .5553481
--------------------------------------------------------------------------------------------------
SEM Command
Could you please check whether the command is appropriate for the model? Should I include anything additional at the end of the command?
Identifying the Mediator
In the indirect effects, I found that burden_2015 has a significant indirect effect on phq2_cont_2017_new (coefficient = 0.024, p = 0.036). I would like to confirm how to identify the mediator responsible for this effect.
I am currently interpreting pp_sumscore_2015 as the mediator, because:
- (Direct effect) burden_2015 is significantly associated with pp_sumscore_2015 (coefficient = -0.132, p = 0.036), and
- (Direct effect) pp_sumscore_2015 is significantly associated with phq2_cont_2017_new (coefficient = -0.161, p = 0.04).
Does this justify concluding that burden_2015 significantly increases phq2_cont_2017_new through decreased pp_sumscore_2015?Bootstrapping with Survey Weights
Can I obtain bootstrapped standard errors and confidence intervals when using survey weights in sem? If not, are there recommended alternative approaches to estimate robust standard errors or validate indirect effects under complex survey designs?
Thank you very much!
