Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Estimating indirect effects using xtdpdml for SEM

    Hello,

    I am currently looking for some guidance regarding how to correctly estimate indirect effects using the xtdpdml shell for SEM. I have panel data on the country level for t=5, thus requiring the xtdpdml command.

    Assuming a simplified example from my research question, the regression using SEM would look somewhat like this. rch_nrg is Y, grwth_epriceres_cent is M and grwth_metalseur is the explanatory variable X.

    Code:
     sem (grwth_epriceres_cent -> rch_nrg, ) (grwth_metalseur -> rch_nrg, ) (grwth_metalseur -> grwth_epriceres_cent, ), nocapslatent
    From what I've read from the work of Richard Williams, Paul D. Allison and Enrique Moral-Benito as well as other entries in the forum, I cannot use the standard SEM command given that I deal with panel data. Thus, I am using the xtdpdml command. Similar to the SEM code above, I've run the code

    Code:
    xtset countryID timeID
    xtdpdml rch_nrg grwth_epriceres_cent grwth_metalseur, ylag(1) tsoff tfix vce(oim) difficult showcmd
    This then gives me the following SEM code:

    Code:
    sem (rch_nrg2 <- rch_nrg1@b1 grwth_epriceres_cent2@b2 grwth_metalseur2@b3 Alpha@1 ) (rch_nrg3 <- rch_nrg2@b1 grwth_epriceres_cent3@b2 grwth_metalseur3@b3 Alpha@1 ) (rch_nrg4 <- rch_nrg3@b1 grwth_epriceres_cent4@b2 grwth_metalseur4@b3 Alpha@1 ) (rch_nrg5 <- rch_nrg4@b1 grwth_epriceres_cent5@b2 grwth_metalseur5@b3 Alpha@1 ) (rch_nrg6 <- rch_nrg5@b1 grwth_epriceres_cent6@b2 grwth_metalseur6@b3 Alpha@1 ), var(Alpha) difficult iterate(250) technique(nr 25 bhhh 25) noxconditional vce(oim)
    However, despite the general information available on this command, it is not clear to me how estimate the indirect effect. Based on my understanding of SEM and xtdpdml, this only gives me the direct effect of both my X and M variable on Y. Would estimating the indirect effect, similar to the first code of SEM, then require me to "manually" insert the code for estimating X on M into the code above? Something along the lines of:

    Code:
    sem (rch_nrg2 <- rch_nrg1@b1 grwth_epriceres_cent2@b2 grwth_metalseur2@b3 Alpha@1 ) (rch_nrg3 <- rch_nrg2@b1 grwth_epriceres_cent3@b2 grwth_metalseur3@b3 Alpha@1 ) (rch_nrg4 <- rch_nrg3@b1 grwth_epriceres_cent4@b2 grwth_metalseur4@b3 Alpha@1 ) (rch_nrg5 <- rch_nrg4@b1 grwth_epriceres_cent5@b2 grwth_metalseur5@b3 Alpha@1 ) (grwth_epriceres_cent <- grwth_metalseur2@b1 Alpha@1 ) (grwth_epriceres_cent <- grwth_metalseur3@b1 Alpha@1 ) (grwth_epriceres_cent <- grwth_metalseur4@b1 Alpha@1 ) (grwth_epriceres_cent <- grwth_metalseur5@b1 Alpha@1 ), var(Alpha) difficult iterate(250) technique(nr 25 bhhh 25) noxconditional vce(robust)
    Does this make sense or is there another way estimating the indirect effect using the xtdpdml command that I have not (yet) come across?
    Thank you very much in advance!

  • #2
    If you use the staywide option, you should be able to use sem's post-estimation commands, including estat teffects. estat teffects reports direct, indirect, and total effects for each path (Sobel 1987), along with standard errors obtained by the delta method. Something like

    Code:
    use https://www3.nd.edu/~rwilliam/statafiles/wages, clear
    xtset id t
    xtdpdml wks L.lwage, inv(ed) pre(L.union) ti(Baseline Model) show staywide
    estat teffects
    Making sense of it all may be harder than usual because of the multiple time periods.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Thank you a lot, this helped!

      Comment

      Working...
      X