Announcement

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

  • ml_mediation or gsem

    I am trying to fit a multilevel model that includes mediators. In particular I am interested in whether women have higher responses to stress than men (cortisol is my outcome). I believe there are two pathways that may explain these differences. One path way hypothesizes that women will report more stressors in a day which will lead to higher negative affect for women. The final portion of this path is that negative affect will lead to higher cortisol levels. (so, gender -> stressors -> NA -> cortisol). These data are taken from a daily diary study in which people provided data over four days However, the documentation on ml_mediation doesn't show me how to fit more than one mediator, and, sadly, gsem keeps telling me that "<- is specified where a option is expected." The "<-" symbol appears to be part of the syntax, but my Stata doesn't seem to like it. Anyhow, I'm wondering if anyone would suggest whether gsem or ml-mediation is better for my model and how to fit more than one mediator. Further, can anyone explain why the arrows "<-" that are specified in the gsem syntax won't work in my commands. Thanks (long time reader, first time user).

  • #2
    This would be easier to work with if you showed us the exact syntax you used, and the output
    from Stata.

    I am guessing here, but I believe the call to gsem should look something like
    Code:
    gsem ... (gender -> stressors) (stressors -> NA) (NA -> cortisol) ...
    gsem does not allow multiple path arrows, -> or <-, to appear within a pair of binding parentheses.

    Comment


    • #3
      Thanks Jeff! Sorry to take so long to get back to you. I used the SEM Builder to make my model and Stata kindly provides me with the correct commands. I ran an easy SEM model using the mean values of my variables to get a sense of how my variables are related in this path (see below)

      sem (gender-> possaffect, ) (gender -> Mean -> cortisol, ) (possaffect -> negaffect, ) (negaffect -> cortisol> , ), nocapslatent

      However, this poses another problem. I now want to use the gsem in SEM Builder to run a multilevel SEM on four days of data collected on positive affect, negative affect, and cortisol. Each day has one measure of positive and negative affect and an aggregate measure of cortisol: These comprise my level-1 variables. These variables are nested within individuals in level 2, which I'll call "id." So, I have four days of data collected within individuals. I used the double oval that SEM Builder has to represent the level-2 variable (id) with an arrow pointing to the level 1 variables. However, the literature online only mentions how to make this work with one level-1 variable.

      I am not sure how to "draw' this in the SEM Builder. That is, do I put a double oval over each mediator and the outcome?

      id id id
      gender -> possaffect -> negaffect -> cortisol

      I tried this and crashed Stata and had to have the university restart my session. Or, does the double oval only go over first mediator?

      id id
      gender -> possaffect -> negaffect -> cortisol

      which seems to me reflects the 4 days of the direct effect (gender -> cortisol) and the indirect effect (gender -> possaffect -> negaffect -> cortisol), which in this iteration means NO oval above negaffect. Does this sound correct? I apologize in advance if this is not clear and wish I had better capacity to draw this out. I would like to keep using the SEM Builder, which is new to me and I've figured out most of the functions I need, except for how to model more than one mediator in a gsem command without crashing the system. Sorry to take so much of your time; I really appreciate it.


      Comment


      • #4
        Jeff, I saw my reply and it looks like the formatting changed the "models" I made for you above. I guess the main question is, how do I draw the multilevel model for the SEM model I made at the beginning of the post. Where do I put the double ovals? I can go back to syntax from there.

        Comment


        • #5
          Suppose we started with the following path diagram.
          Click image for larger version

Name:	sem1.png
Views:	1
Size:	14.5 KB
ID:	1306881



          Adding a group-level latent variable would look something like the following.
          Click image for larger version

Name:	sem2.png
Views:	1
Size:	17.9 KB
ID:	1306882



          But we need a path from the latent variable to at least one of our outcome variables.
          Click image for larger version

Name:	sem3.png
Views:	1
Size:	18.7 KB
ID:	1306883



          The corresponding gsem syntax is

          Code:
          gsem    (gender -> possaffect)                          ///
                  (gender -> cortisol)                            ///
                  (possaffect -> negaffect)                       ///
                  (negaffect -> cortisol)                         ///
                  (M[id] -> cortisol),                            ///
                  latent(M)                                       ///
                  nocapslatent

          Comment


          • #6
            Thanks Jeff. Sorry for the late reply. How does one include other predictors, such as between-person mean level predictors? For example, in regular MLM, I may want to know if a person's neuroticism scores, age, gender, and affect predict the level 1 intercept. Further, I may want to know how to do a cross-level interaction. I am a little confused by the writing of the code in the model you gave me because it indicates that the M(id) is going directly to the cortisol outcome, but in MLM it should predict each person's (id) individual intercept for the level 1 variables, which would be that person's positive affect and negative affect score for each day (varying across 4 days). I am happy if the syntax you provided captures this, but its not super intuitive.

            to make matters worse, I have about 70 dyads in this study, and my preliminary analysis indicates that their cortisol measures are non-independent. I would like to account for mutual influence of these participants and have been told to create a 3-level MSEM model (described by Preacher et al., 2011) and including "dyad" as a level unto itself (I've assigned everyone in the sample a dyad id, but only people in a marriage will have two people in the dyad "group," everyone else is in a group of 1, that is, they are the only member of the dyad. However, I'm not sure if gsem can handle 3 level MLM mediation. Sorry to hand all of this to you, but this seems a little tough to conceptualize and looks like any misstep will give me false information. Thanks again. I've learned a lot.

            Comment

            Working...
            X